Memgraph Documentation
Memgraph is the memory operating system for AI agents. It captures raw interactions as Events, clusters them into Episodes, extracts long-term knowledge as Beliefs, and delivers synthesized Context back into your agent's prompt.
Memory Pipeline
Get started in 3 lines
pip install memgraph-sdk
from memgraph_sdk import MemgraphClient
client = MemgraphClient(api_key="mg_...", tenant_id="your-tenant-id")
# Store a memory
client.remember("User prefers dark mode", user_id="alice", category="preference")
# Retrieve context for your agent
context = client.search("What are Alice's preferences?", user_id="alice")
print(context)Quick Start
Install the SDK, get an API key, and store your first memory in under 5 minutes.
Core Concepts
Understand Events, Episodes, Beliefs, Context, and Cognitive Dreaming.
API Reference
Complete HTTP endpoint reference with request/response examples.
Self-Hosted
Deploy Memgraph on your own infrastructure with Docker or Kubernetes.
Cognitive Infrastructure
Beyond memory CRUD — Memgraph provides cognitive primitives for AI agent debugging and improvement.
Key capabilities
Multi-tenant isolation
Every query is scoped by tenant_id. Tenants cannot see each other's data.
Cognitive Dreaming
Background worker consolidates episodes into beliefs automatically, like sleep consolidation.
Vector search
pgvector-powered semantic search across beliefs and documents with confidence scoring.
RBAC
Role-based access control with admin, editor, and viewer roles.
Audit logging
Every key operation (auth, belief mutation, export) is logged for compliance.
Framework integrations
Pre-built integrations for LangChain, CrewAI, LlamaIndex, and OpenAI Agents.
