neo4j-labs/agent-memory

A graph-native memory system for AI agents and context graphs. Store conversations, build knowledge graphs, and let your agents learn from their own reasoning — all backed by Neo4j.

What it solves

AI agents often struggle with persistent, structured memory. This project provides a graph-native memory system that allows agents to store conversation history, build knowledge graphs of entities and preferences, and record their own reasoning processes for later retrieval.

How it works

It implements a three-layer memory architecture backed by Neo4j:

  • Short-Term Memory: Manages per-session conversation history using vector and text search.
  • Long-Term Memory: Maintains a knowledge graph of entities, facts, and preferences, utilizing entity resolution and deduplication.
  • Reasoning Memory: Records reasoning traces and tool usage to allow agents to retrieve similar past decisions and tasks.

The system supports multi-stage entity extraction (via spaCy, GLiNER2.5, or LLMs) and can be deployed as a hosted service (NAMS) or self-hosted via Neo4j Aura (Bolt). It also provides an MCP server to expose these memory capabilities as tools for AI assistants like Claude or Cursor.

Who it’s for

Developers building AI agents who need their agents to remember users across sessions, maintain a structured knowledge base, or audit the reasoning steps taken to reach a conclusion.

Highlights

  • Three-Layer Architecture: Separate storage for conversations, knowledge graphs, and reasoning traces.
  • Flexible Backend: Supports both a zero-infrastructure hosted service (NAMS) and direct Neo4j Aura connectivity.
  • Broad Integration: Native adapters for OpenAI, Anthropic, Bedrock, and Vertex AI, with LiteLLM support for 100+ providers.
  • Framework Support: Integrations for LangChain, Pydantic AI, CrewAI, LlamaIndex, and others.
  • MCP Server: Turn memory functions into tools for MCP-compatible AI assistants.
  • Advanced Graph Ops: Includes entity deduplication, geospatial queries, and the ability to adopt existing Neo4j graphs.

Related

  • Project
  • Project
  • Project
  • Project
  • Project