MemgraphAI

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

Events
Episodes
Beliefs
Context

Get started in 3 lines

python
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)

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.