Magi
MAGI β Multi-Agent Graph Intelligence. Universal memory server for AI agents. MCP + gRPC + REST API with semantic search, knowledge graph, and behavioral pattern analysis.
Ask AI about Magi
Powered by Claude Β· Grounded in docs
I know everything about Magi. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MAGI
Multi-Agent Graph Intelligence
AI agents shouldn't work in isolation. With MAGI, nothing important gets forgotten.
Wiki Β· Quick Start Β· API Docs Β· MCP Tools Β· Architecture Β· Deployment
The Problem
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.
What Is MAGI?
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.
Why MAGI Is Different
MAGI isn't just another vector store or RAG backend.
Git-Backed Memory
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.
Distributed Node Mesh
Dedicated Writer, Reader, Index, and Coordinator node pools with session affinity for read-your-writes consistency. Supports both embedded and multi-node deployments.
Hybrid Semantic Search
Combines vector embeddings and BM25 for accurate recall across structured and unstructured memories.
Knowledge Graph + Pattern Detection
Automatically links memories into a knowledge graph and surfaces behavioral patterns β preferences, habits, recurring decisions β across agents.
Built for Production
- 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
Ecosystem
| Project | Description |
|---|---|
| magi | Memory server (this repo) β MCP, gRPC, REST API |
| magi-sync | Cross-machine memory sync agent β watches Claude, OpenClaw, Codex files |
| magi-ui | Web dashboard (SPA) β memory browser, knowledge graph, analytics |
Flexible Storage, Your Infrastructure
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.
Who Is MAGI For?
- 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.
Quick Start
git clone https://github.com/j33pguy/magi.git
cd magi
docker compose up -d
curl http://localhost:8302/health
MCP Config
magi mcp-config
Try It
export 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}'
Architecture
graph LR
A[Agents] -->|MCP / gRPC / REST| M[MAGI]
U[Web UI] --> M
M --> S[Storage Backends]
M --> G[Git History]
vs. Alternatives
| 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 | β | β | β | β |
Docs
Full documentation in the Wiki β
Getting Started Β· Architecture Β· MCP Tools Β· REST API Β· Multi-Agent Setup Β· Knowledge Graph Β· Deployment Β· Config Β· FAQ
In Memory Of
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.
β οΈ Stability
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. 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.
License
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.
