Quickstart
Make your first authenticated MuBit call in under 60 seconds. The terminal on the right runs the same code — a real round-trip against api.mubit.ai showing every payload the SDK returns. Switch the terminal between Python, Node, and Rust with the buttons in the title bar.
Get your API key
Sign in to the MuBit console and create a key from Settings → API keys. Keys look like mbt_<instance>_<key_id>_<secret> — three segments separated by underscores. The instance segment routes your call to the right region; the key id is safe to log; the secret is not.
MUBIT_API_KEY="mbt_<instance>_<key_id>_<secret>"
MUBIT_ENDPOINT="https://api.mubit.ai"The SDK reads both env vars on Client(). Set MUBIT_TRANSPORT="grpc" if you need lower latency from a backend service — see gRPC Transport.
Install
Authenticate and make your first call
The script below stores a memory in one session and recalls it from a second session — proving cross-session memory works without any local cache. The right-hand terminal runs this exact flow.
A successful recall returns roughly:
{
"final_answer": "Taylor prefers to receive updates in a concise written format delivered on Friday afternoons, and explicitly dislikes receiving phone calls.",
"confidence": 1.0,
"mode": "agent_routed",
"evidence": [
{ "id": "f7bfcb26-…", "score": 1.0, "content": "Taylor prefers concise written updates on Friday afternoons; no phone calls." }
]
}Didn't work? See Troubleshooting. The two most common causes are a stale MUBIT_API_KEY and an HTTP/gRPC endpoint mismatch.
Cross-session footgun: facts (intent="fact") are session-local. To recall a memory in a different session keyed by user_id, store it as a lesson with lesson_scope="global" — that's why the example above uses intent="lesson". See SDK helpers for the full set.
Pick your path
Most readers want the drop-in. Switch only when you outgrow it.
mubit.learn.init() auto-instruments your existing anthropic / openai / litellm / google-genai calls. Lessons inject before the call, reflection runs on session end.
Call remember, recall, get_context, archive, dereference yourself when you want explicit control over sessions, agents, and metadata.
Plug MuBit into the framework's own memory interface. CrewAI, LangGraph, LangChain, LlamaIndex, ADK, Agno, Vercel AI SDK, MCP.
Drop-in: mubit.learn
import os
import mubit.learn
import anthropic
mubit.learn.init(
api_key=os.environ["MUBIT_API_KEY"],
agent_id="code-reviewer",
auto_reflect=True,
)
# Existing Anthropic call now learns: lessons inject pre-call, reflection runs on session end.
resp = anthropic.Anthropic().messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=300,
messages=[{"role": "user", "content": "Review this diff..."}],
)mubit.learn.init() patches anthropic.Anthropic, openai.OpenAI, LiteLLM, and Google GenAI client classes in place. See LLM provider support for the full matrix and per-provider notes.
What to do next
- Inspect the full helper surface in SDK helpers —
remember,recall,get_context,archive,dereference. - Add multi-agent coordination with register_agent + handoff + feedback.
- Use temporal queries to filter by when events happened, not when they were ingested.
- Plug into your framework via Framework integrations.
- Browse the full control surface at Control HTTP reference.