Skip to main content

The Reliability Layer for Production AI Agents

Project description

StateBase Python SDK

The official Python client for StateBase - The Reliability Layer for Production AI Agents.

PyPI version

📦 Installation

pip install statebase

🚀 Quick Start

1. Initialize

from statebase import StateBase

sb = StateBase(api_key="sb_live_...")

2. Sessions (The Interaction Loop)

# Create a session
session = sb.sessions.create(
    agent_id="coding-assistant",
    user_id="user_123"
)

# ... inside your chat loop ...
user_input = "How do I fix this bug?"

# Get Context (RAG + State + History)
ctx = sb.sessions.get_context(session.id, query=user_input)

# Generate with LLM
# ... call openai ...
ai_response = "You should check the stack trace."

# Log the Turn
sb.sessions.add_turn(
    session_id=session.id,
    input=user_input,
    output=ai_response
)

3. Memory (Long-term Knowledge)

# Add a fact
sb.memory.add(
    user_id="user_123",
    content="User prefers TypeScript over JavaScript",
    tags=["preference", "coding"]
)

# Search
facts = sb.memory.search(
    user_id="user_123",
    query="coding preferences"
)

📚 Documentation

Full docs: docs.statebase.org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statebase-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statebase-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file statebase-0.1.1.tar.gz.

File metadata

  • Download URL: statebase-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for statebase-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee9380249f2c26a826fe810e21230a0650edf5715b26dc4054c6e7f6713dcaf7
MD5 ff056ad6128fe327e5f1fb0bb40daf7b
BLAKE2b-256 3d023ac5ca3ad239680f354e036b8b61996f94ebecc9dc885a567cb8eb183474

See more details on using hashes here.

File details

Details for the file statebase-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: statebase-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for statebase-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc3994f9271fb136835d8a3194029ef069c283f2429d3be39ae83d9d6621063
MD5 43d76c4d6ec6803951bca3f91a4c1d7c
BLAKE2b-256 948bff1767f14d5a91d8ea9a6619f5b6b71735c3456e9f45fb7f4c5227d12a3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page