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.
📦 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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9380249f2c26a826fe810e21230a0650edf5715b26dc4054c6e7f6713dcaf7
|
|
| MD5 |
ff056ad6128fe327e5f1fb0bb40daf7b
|
|
| BLAKE2b-256 |
3d023ac5ca3ad239680f354e036b8b61996f94ebecc9dc885a567cb8eb183474
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bc3994f9271fb136835d8a3194029ef069c283f2429d3be39ae83d9d6621063
|
|
| MD5 |
43d76c4d6ec6803951bca3f91a4c1d7c
|
|
| BLAKE2b-256 |
948bff1767f14d5a91d8ea9a6619f5b6b71735c3456e9f45fb7f4c5227d12a3d
|