Repolode
neo4j-labs

neo4j-labs/agent-memory

A graph-native memory system for AI agents that stores conversations, builds knowledge graphs and records reasoning, backed by Neo4j.

Stars
588
Forks
109
Open issues
104
Last commit
2 days ago

What is it?

Neo4j Agent Memory gives AI agents persistent memory organized in three layers: short-term memory for conversations and messages, long-term memory for entities, preferences and facts stored as a knowledge graph, and reasoning memory for traces of decisions and tool usage that can be retrieved for similar future tasks.

Entities are extracted from messages through a configurable pipeline using spaCy, GLiNER2.5 or an LLM, with typed relations and entity resolution to merge duplicates. The project offers two backends: a hosted NAMS service that needs only an API key, and a self-hosted bolt backend that connects directly to Neo4j or AuraDB and lets you bring your own embedding and LLM providers.

It also ships an MCP server exposing memory as tools for assistants such as Claude Desktop and Cursor, adapters for LangChain, Pydantic AI, Google ADK, CrewAI, LlamaIndex and other frameworks, and Python and TypeScript SDKs that share the same memory model.

Key features

  • 01Stores conversations with per-session history and vector plus text search.
  • 02Builds a knowledge graph of entities, preferences and facts with entity resolution and deduplication.
  • 03Records reasoning traces and tool usage, and retrieves similar past tasks.
  • 04Exposes memory as MCP tools with core and extended profiles.
  • 05Offers Python and TypeScript SDKs over a hosted NAMS service or a self-hosted Neo4j backend.
  • 06Supports multiple embedding and LLM providers, including OpenAI, Anthropic, Bedrock and LiteLLM.

Use cases

  • Giving a chatbot or assistant memory of user preferences across sessions.
  • Building agents that answer from a knowledge graph built from their own conversations.
  • Auditing and reusing an agent's past reasoning steps on similar tasks.
  • Adding persistent memory to Claude Desktop or Cursor via the MCP server.

Quick start

  1. 1

    Sign up for the hosted NAMS service and copy your API key

  2. 2

    Install the SDK with NAMS support and export the API key

    pip install 'neo4j-agent-memory[nams]==0.7.0'
  3. 3

    Run the Python example that creates a conversation and adds a message

Things to know

  • Officially a Neo4j Labs project with no SLAs or backward-compatibility guarantees.
  • Status is Beta and the API may change between releases.
  • The hosted NAMS path requires a sign-up and API key, and self-hosted Bolt needs a Neo4j database and model provider keys.
  • Some features and methods differ between the NAMS and Bolt backends.

Topics

FAQ

What is agent-memory?
A graph-native memory system for AI agents that stores conversations, builds knowledge graphs and records reasoning, backed by Neo4j. Neo4j Agent Memory gives AI agents persistent memory organized in three layers: short-term memory for conversations and messages, long-term memory for entities, preferences and facts stored as a knowledge graph, and reasoning memory for traces of decisions and tool usage that can be retrieved for similar future tasks.
Is agent-memory free to use? What license does it have?
agent-memory is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is agent-memory still maintained?
Actively maintained. The last commit to agent-memory was on Oct 19, 2026.
What can I use agent-memory for?
Giving a chatbot or assistant memory of user preferences across sessions. Building agents that answer from a knowledge graph built from their own conversations. Auditing and reusing an agent's past reasoning steps on similar tasks. Adding persistent memory to Claude Desktop or Cursor via the MCP server.
How do I install agent-memory?
Sign up for the hosted NAMS service and copy your API key Install the SDK with NAMS support and export the API key: pip install 'neo4j-agent-memory[nams]==0.7.0' Run the Python example that creates a conversation and adds a message
Where can I get agent-memory?
The source code and installation instructions are on GitHub: https://github.com/neo4j-labs/agent-memory

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects