Python SDK for TinyHumans Neocortex memory APIs.
- Python 3.9+
pip install tinyhumansaiFor local development from this repo:
cd packages/sdk-python
uv sync --group dev- Sign in to your TinyHumans account.
- Create a server API key in the TinyHumans dashboard.
- Export it before running examples:
export TINYHUMANS_TOKEN="your_api_key"
# aliases used by examples/backends
export TINYHUMANS_TOKEN="your_api_key"
# optional model id and base URL overrides
export TINYHUMANS_MODEL_ID="neocortex-mk1"
export TINYHUMANS_BASE_URL="https://api.tinyhumans.ai"import tinyhumansai as api
client = api.TinyHumansMemoryClient(token="YOUR_API_KEY")
client.ingest_memory(
item={
"key": "user-preference-theme",
"content": "User prefers dark mode",
"namespace": "preferences",
}
)
ctx = client.recall_memory(
namespace="preferences",
prompt="What does the user prefer?",
num_chunks=10,
)
print(ctx.context)example.py is the comprehensive SDK example and exercises all current client methods, including core, documents, mirrored routes, ingestion job polling, and cleanup.
cd packages/sdk-python
python example.pyclient = api.TinyHumansMemoryClient(
token="required",
model_id="neocortex-mk1", # optional
base_url="https://...", # optional
)Base URL resolution: explicit arg -> TINYHUMANS_BASE_URL -> SDK default.
Core methods:
ingest_memoryingest_memoriesrecall_memorydelete_memoryrecall_with_llmchat_memoryinteract_memoryrecall_memory_masterrecall_memories
Documents and mirrored routes:
insert_documentinsert_documents_batchlist_documentsget_documentdelete_documentget_graph_snapshotquery_memory_contextchat_memory_contextrecord_interactionsrecall_thoughts
Ingestion jobs:
get_ingestion_jobwait_for_ingestion_job
recall_with_llm supports:
- OpenAI
- Anthropic
- Google (Gemini)
- Custom OpenAI-compatible URL
API errors raise TinyHumansError with message, status, and body.