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.3.tar.gz
(5.7 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.3.tar.gz.
File metadata
- Download URL: statebase-0.1.3.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b6ab6bae6f1720dadaf58f43782ed9dc83954e2de2923a8b9e518b21ae1a196
|
|
| MD5 |
6667f241b0325fb3777ef3ba32d92dc2
|
|
| BLAKE2b-256 |
7fdd3a9585eb26369e2e25acbf439a655992e1f4ea483e9976d80468d227b411
|
File details
Details for the file statebase-0.1.3-py3-none-any.whl.
File metadata
- Download URL: statebase-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.7 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 |
0a3e24dc7d37e3a2ccb3a01703b59b7b75e81a64bf84e06a06ceefc2bf10aa93
|
|
| MD5 |
0cee1eee3180dd8e7702136aec08a4c3
|
|
| BLAKE2b-256 |
1fa94a0e5c1c3497d521894f18b589db1c90194a50b7891ca7ddf750d5a237b8
|