Agent Memory (Neo4j Agent Memory, a Neo4j Labs project) stores an agent's memory as a context graph in Neo4j. It combines three layers in one graph: short-term memory for conversations and messages, long-term memory for entities, preferences, and facts, and reasoning memory for the traces and tool calls an application records, so an agent can retrieve past decisions and similar tasks.
| Short-term memory | Long-term memory | Reasoning memory |
|---|---|---|
| Conversations and messages | Entities, preferences, facts | Reasoning traces and tool usage |
| Per-session history | Knowledge graph (POLE+O model) | Retrieve recorded decisions |
| Vector and text search | Entity resolution and deduplication | Similar-task retrieval |
Python and TypeScript SDKs share the same memory model. Two backends are available: NAMS, a hosted service where embedding and entity extraction run server-side, and a self-hosted Bolt backend that connects directly to Neo4j or AuraDB and adds write-Cypher, geospatial queries, and adoption of an existing graph as long-term memory. The SDK is async-only.
On the self-hosted backend, embedding and LLM models are set by provider string or provider instance. Native adapters cover OpenAI, Anthropic, Bedrock, Vertex AI, and sentence-transformers, and LiteLLM acts as a fallback for other providers such as Cohere, Mistral, and Ollama. An MCP server gives MCP clients such as Claude Desktop, Claude Code, Cursor, and VS Code Copilot persistent memory.
Features
- Entity extraction: multi-stage extraction with spaCy, GLiNER2.5, or an LLM, decoding typed relations in the same pass
- Background enrichment: adds context to entities from Wikipedia and Diffbot
- Framework integrations: LangChain, Pydantic AI, Google ADK, Strands, CrewAI, LlamaIndex, OpenAI Agents, and Microsoft Agent
- MCP server: a core profile with 6 read/write tools and an extended profile with 16, adding graph export, reasoning traces, and read-only Cypher
- Existing graphs: adopts a Neo4j graph already in production as long-term memory
- Buffered writes: fire-and-forget writes so agent responses do not wait on database round-trips
- Audit trail: explicit edges from reasoning steps to the entities they touched
- Consolidation and evals: entity deduplication primitives and an eval harness for labeled memory regression tests
- Vercel AI SDK provider: a companion npm package wraps the TypeScript SDK as a provider, middleware, and tools for NAMS-backed agents
- Local-only mode: runs without an LLM using local sentence-transformers and spaCy or GLiNER2.5

