Getting Started
MuBit gives your AI agents persistent memory — facts, lessons, and rules that survive across sessions and improve over time. The fastest way to start ismubit.learn, which auto-instruments your LLM calls with zero configuration.
Prerequisites
.env
.env
Install
- Python
- Bun
- npm
- pnpm
- yarn
- Deno
- Rust
pip
Quickstart with mubit.learn
Two lines of setup. Your LLM calls automatically get lesson injection, interaction capture, and reflection.
- Python
- Node.js
- Rust
learn_quickstart.py
- Before each LLM call: retrieves relevant lessons from MuBit and injects them into the system message
- After each call: ingests the interaction as memory
- On run end: reflects to extract new lessons and promotes recurring ones
Works with any LLM provider
mubit.learn auto-instruments calls to these libraries — no wrapper code needed:
| Provider | Python | Node.js |
|---|---|---|
| OpenAI | openai | openai |
| Anthropic | anthropic | @anthropic-ai/sdk |
| Google Gemini | google-generativeai | @google/generative-ai |
| LiteLLM | litellm | — |
| Vercel AI SDK | — | ai (via @mubit-ai/ai-sdk middleware) |
Advanced integration options
When you need more control over what gets stored and when, or you’re using an agent framework with its own memory interface, use these integration paths.SDK helpers
Use explicit helper methods for fine-grained control over memory, context assembly, and the learning loop.- Python
- Node.js
- Rust
getting_started.py
What this demonstrates
remember()is the default write path for single logical memory items.recall()is the default answer-oriented retrieval path.getContext()/get_context()assembles a reusable context block before you call your LLM.archive()anddereference()are the exact-reference pair for artifacts you want to recover later without semantic drift.- You only need raw
client.control.*methods when you want explicit control over async ingest jobs or raw wire payloads.
Exact-reference quick start
Use exact references when semantic discovery is not enough and a later step needs the exact stored artifact back.- Python
- Node.js
- Rust
Framework integrations
If you’re using an agent framework, MuBit provides native adapters that plug into the framework’s own memory interface:| Framework | Language | Install | Pattern |
|---|---|---|---|
| CrewAI | Python | pip install mubit-crewai[crewai] | StorageBackend for unified Memory |
| LangGraph | Python/JS | pip install mubit-langgraph[langgraph] | BaseStore adapter |
| LangChain | Python | pip install mubit-langchain[langchain] | BaseMemory subclass |
| Google ADK | Python | pip install mubit-adk[adk] | BaseMemoryService adapter |
| Vercel AI SDK | JS | npm install @mubit-ai/ai-sdk | wrapLanguageModel() middleware |
| MCP | Any | npm install @mubit-ai/mcp | 10 tools over stdio |
CrewAI
LangChain
LangGraph
Google ADK
Vercel AI SDK
What to do next
- Explore learn module options (auto-extract, lane scoping, step outcomes) at SDK methods.
- Use temporal queries to filter memory by when events happened, not when they were ingested.
- Control retrieval speed vs. depth with the budget parameter.
- Track when events occurred with occurrence time for accurate temporal reasoning.
- See temporal memory patterns for practical recipes.
- Add compaction safety with checkpoint.
- Register specialist agents and coordinate with handoff and feedback.
- Use gRPC for lower-latency backend services — see gRPC Transport Guide.
- Browse activity trails for debugging — see Activity & Audit Trail.
- Inspect the full control surface at Control HTTP reference.
- Common issues? See Troubleshooting.