A real-time shared memory layer for multi-agent LLM systems.
Built for coordination, not just storage — with pub/sub, schema enforcement, and API-key ACLs.
Think: Redis + schema + pub/sub + ACL — purpose-built for agents.
💡 Three autonomous LLM agents collaborate on a research task using memX — no chat, no controller, just shared memory.
🧠 Each agent reads/writes to shared keys:
Agent | What it does |
---|---|
QueryAgent |
Seeds the research question + background context |
ExplorerAgent |
Adds search results + working thoughts |
SynthesizerAgent |
Summarizes shared context into a final insight |
MonitorAgent |
Logs how memory evolves in real time |
💡 All communication happens only through shared keys in memX.
- 🔄 Real-time context sync (WebSocket)
- 📬 Pub/sub updates on key change
- 📐 JSON Schema validation (per key)
- 🔐 API key-based access control
- 🐍 Python SDK (
context-sdk
) for easy integration - 🐳 Docker-compatible self-hosting
pip install context-sdk
from context_sdk import AgentContext
ctx = AgentContext(api_key="agent_key_1")
ctx.set("agent:goal", "navigate kitchen")
ctx.subscribe("agent:goal", lambda data: print("Goal:", data["value"]))
uvicorn main:app --reload
docker-compose up --build
Visit: http://localhost:8000/docs for interactive Swagger UI.
Edit config/acl.json
:
{
"agent_key_1": ["agent:*"],
"planner_key": ["agent:goal"]
}
POST /schema
Headers: x-api-key
Body:
{
"key": "agent:state",
"schema": {
"type": "object",
"properties": {"x": {"type": "number"}, "y": {"type": "number"}},
"required": ["x", "y"]
}
}
Or dynamically via SDK:
ctx.set_schema("agent:state", schema_dict)
core/ # FastAPI + WebSocket backend
sdk/ # Python SDK (installable)
config/ # Contains acl.json, (optionally schemas.json)
examples/ # Agent examples