Multi-Agent Graph Intelligence
AI agents shouldn't work in isolation. With MAGI, nothing important gets forgotten.
Think of it as the Guide for your agents — a self-hosted book that remembers everything, with "Don't Panic" in large friendly letters on the cover.
Wiki · Quick Start · API Docs · MCP Tools · Architecture · Deployment
AI agents are getting smarter every day — but they still suffer from a fundamental limitation: they forget.
Different agents working on the same problem rarely share context, history, or decisions. One agent discovers a breaking API change, another reviews code, a third generates documentation — and none of them know what the others have already learned.
Switch machines and your agent has amnesia. Switch providers and your context is gone. Every session starts cold.
In short: plenty to panic about.
Don't.
MAGI is a universal memory server for AI agents. It acts as a shared, persistent brain that any agent can read from and write to — regardless of framework, language, or orchestration model.
Host it on your own hardware, point every agent at the same server, and your context persists across sessions, machines, and providers. No vendor lock-in, no rebuilds, no cold starts.
MAGI exposes memory through multiple protocols — MCP (stdio), gRPC, REST API, and a Web UI — making it easy to integrate into existing workflows without forcing a specific toolchain.
MAGI isn't just another vector store or RAG backend.
Every memory write is committed to a Git repository — full history, diffs, rollback, auditable changes. The database is a derived index, not the source of truth.
Dedicated Writer, Reader, Index, and Coordinator node pools with session affinity for read-your-writes consistency. Supports both embedded and multi-node deployments.
Combines vector embeddings and BM25 for accurate recall across structured and unstructured memories.
Automatically links memories into a knowledge graph and surfaces behavioral patterns — preferences, habits, recurring decisions — across agents.
- Async write pipeline — returns
202 Acceptedin under 10ms - Caching layers — queries, embeddings, and hot memory
- Health probes —
/readyz,/livez, expanded/healthfor Kubernetes - Metrics endpoint — latency, queue depth, cache stats, and more
- Chaos tested — concurrent writes, search-during-ingestion, kill recovery
- 24 MCP tools — full agent integration out of the box
| Project | Description |
|---|---|
| magi | Memory server (this repo) — MCP, gRPC, REST API |
| magi-sync | Cross-machine memory sync — the Sub-Etha for your Guide. Watches Claude, OpenClaw, Codex files |
| magi-ui | Web dashboard (SPA) — memory browser, knowledge graph, analytics |
MAGI is fully self-hosted and supports multiple backends:
- SQLite — zero-config, single-file
- PostgreSQL (pgvector)
- MySQL / MariaDB
- SQL Server / Azure SQL
- Turso — embedded replicas with cloud sync
No cloud lock-in. No hosted dependency. Your data stays on your infrastructure.
- Teams building multi-agent systems
- Developers using Claude, Codex, local LLMs, or custom agents
- Organizations that need persistent, auditable AI memory
- Architects who want agent memory without vendor lock-in
Works with — or without — popular orchestrators like Openclaw, LangChain, CrewAI, or custom pipelines.
git clone https://github.com/j33pguy/magi.git
cd magi
docker compose up -d
curl http://localhost:8302/healthmagi mcp-configexport MAGI_HTTP_URL=http://localhost:8302
export MAGI_API_TOKEN=your-token
# Agent A stores a decision
curl -X POST "$MAGI_HTTP_URL/remember" \
-H "Authorization: Bearer $MAGI_API_TOKEN" \
-d '{"content":"API v3 deprecates /users","type":"decision","speaker":"agent-a"}'
# Agent B stores a lesson
curl -X POST "$MAGI_HTTP_URL/remember" \
-H "Authorization: Bearer $MAGI_API_TOKEN" \
-d '{"content":"Migrate clients before Q4","type":"lesson","speaker":"agent-b"}'
# Any agent recalls shared context
curl -X POST "$MAGI_HTTP_URL/recall" \
-H "Authorization: Bearer $MAGI_API_TOKEN" \
-d '{"query":"API changes","top_k":5}'graph LR
A[Agents] -->|MCP / gRPC / REST| M[MAGI]
U[Web UI] --> M
M --> S[Storage Backends]
M --> G[Git History]
| MAGI | mem0 | Zep | ChromaDB | |
|---|---|---|---|---|
| Git versioning | ✅ | ❌ | ❌ | ❌ |
| Distributed node mesh | ✅ | ❌ | ❌ | ❌ |
| Knowledge graph | ✅ | ❌ | ❌ | ❌ |
| Pattern detection | ✅ | ❌ | ❌ | ❌ |
| Async pipeline | ✅ | ❌ | ❌ | ❌ |
| Metrics endpoint | ✅ | ❌ | ❌ | ❌ |
| Health probes (k8s) | ✅ | ❌ | ❌ | ❌ |
| Typed memories | ✅ | ❌ | Partial | ❌ |
| Orchestrator-agnostic | ✅ | ❌ | ❌ | ❌ |
| Self-hosted | ✅ | Cloud-first | ✅ | ✅ |
| Multi-protocol | MCP+gRPC+REST | REST | REST | REST |
| Storage backends | SQLite, Turso, PostgreSQL, MySQL, SQL Server | Qdrant/Pinecone | Postgres | Chroma |
| Web UI | ✅ | ❌ | ❌ | ❌ |
Full documentation in the Wiki →
Getting Started · Architecture · MCP Tools · REST API · Multi-Agent Setup · Knowledge Graph · Deployment · Config · FAQ
This project is dedicated to Mary Margaret — a dear friend who believed that the things worth remembering are the things that connect us. MAGI carries her spirit: nothing important should ever be forgotten.
MAGI is not production-ready yet. It is useful today and improving fast, but expect breaking changes, rough edges, and the occasional surprise until a stable release is tagged. Back up your data, test in your own environment, and plan for things to break. Bring a towel. SQLite is the most-tested backend; PostgreSQL, MySQL/MariaDB, and SQL Server backends exist but see less CI coverage. The distributed node mesh is architected but currently ships as a single-node embedded process. Git-backed history is optional and off by default.
Elastic License 2.0 (ELv2) — free to use, modify, and self-host. Cannot be offered as a managed/hosted service without a commercial license from the author.
Don't Panic. Hack the Planet.