memX is an open-source real-time shared memory layer designed for agent-based systems powered by LLMs. It enables coordination-first workflows via:
- ⚡ Real-time CRDT-style state sync
- 📐 JSON Schema enforcement for data sanity
- 🔐 API-key-based access control
- 📣 Pub/Sub updates for reactive agents
Modern multi-agent setups—whether using LangGraph, Autogen, or custom orchestration—lack a reliable way to share evolving context (state, goals, thoughts) between agents. memX provides a simple and secure memory layer that agents can read/write from in real-time — no message-passing or controller required.
Three autonomous agents solving a research task, fully decentralized:
Agent | Behavior |
---|---|
QueryAgent |
Seeds the research question + background context |
ExplorerAgent |
Adds search results + working notes |
SynthesizerAgent |
Summarizes the shared context into final insights |
MonitorAgent |
Logs real-time evolution of memory for observability |
All communication flows through shared keys in memX — not through chat or a controller.
✅ Real-time memory sync (WebSocket)
📬 Pub/Sub updates on change
📐 Per-key JSON Schema validation
🔐 Fine-grained ACLs via API keys
🐍 Python SDK (memx-sdk
) for easy integration
🐳 Docker-compatible for local hosting or cloud deployment
pip install memx-sdk
Visit: mem-x.vercel.com Generate scoped API keys with just a few clicks.
from memx_sdk import memxContext
ctx = memxContext(api_key="your_api_key")
ctx.set_schema("agent:goal", {
"type": "object",
"properties": {"x": {"type": "number"}, "y": {"type": "number"}},
"required": ["x", "y"]
})
ctx.set("agent:goal", {"x": 1, "y": 7})
print(ctx.get("agent:goal"))
uvicorn main:app --reload
docker-compose up --build
Swagger docs: http://localhost:8000/docs
- Log in at mem-x.vercel.com
- Generate API keys with scoped access control
Edit config/acl.json
to define access scopes:
{
"agent_key_1": ["agent:*"],
"planner_key": ["agent:goal"]
}
Set schema for a key via API:
POST /schema
Headers: x-api-key: your_key
Body:
{
"key": "agent:state",
"schema": {
"type": "object",
"properties": {"x": {"type": "number"}, "y": {"type": "number"}},
"required": ["x", "y"]
}
}
Or via SDK:
ctx.set_schema("agent:state", schema_dict)
core/ # FastAPI + WebSocket backend
sdk/ # Python SDK (pip installable)
config/ # Access control & schemas
examples/ # LLM agent integration demos
- LangGraph / Autogen workflows with shared memory
- Autonomous research or planning agents
- IoT / robotics with real-time state coordination
- Any multi-agent system needing structured memory
memX is built for developers pushing the frontier of multi-agent systems. Explore the SDK, try out agent demos, and contribute!