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 long-term persistence and structured knowledge. This project provides a graph-native memory system that allows agents to store conversations, build knowledge graphs of entities and preferences, and track their own reasoning processes so they can learn from past decisions.

How it works

It uses Neo4j as a backend to implement a multi-tiered memory architecture:

  • Short-Term Memory: Stores per-session conversation history using vector and text search.
  • Long-Term Memory: Maintains a knowledge graph of entities, facts, and preferences (using the POLE+O model) with entity resolution and deduplication.
  • Reasoning Memory: Records reasoning traces and tool usage to allow agents to retrieve similar past tasks.

The system includes a multi-stage extraction pipeline (using spaCy, GLiNER, or LLMs) to turn unstructured text into graph nodes and relationships, and offers both a hosted service (NAMS) and a self-hosted Bolt connection.

Who it’s for

Developers building AI agents who need their assistants to remember user preferences across sessions, maintain a complex world model, or provide an audit trail of how the agent reached a specific conclusion.

Highlights

  • Multi-language SDKs: Native support for Python and TypeScript.
  • Broad Integration: Works with LangChain, Pydantic AI, CrewAI, LlamaIndex, and other major agent frameworks.
  • MCP Server: Can be plugged directly into MCP-compatible assistants like Claude Desktop or Cursor without writing code.
  • Production Ready: Includes multi-tenant scoping, buffered writes for performance, and an evaluation harness for memory quality.
  • Flexible Model Support: Compatible with OpenAI, Anthropic, Bedrock, Vertex AI, and 100+ providers via LiteLLM.

Related

  • Project
  • Project
  • Project
  • Project
  • Project