agent-memory  by neo4j-labs

Graph-native memory system for AI agents

Created 4 months ago
257 stars

Top 98.2% on SourcePulse

GitHubView on GitHub
Project Summary

A graph-native memory system for AI agents, neo4j-labs/agent-memory enables persistent storage of conversations, construction of knowledge graphs, and learning from agent reasoning, all powered by Neo4j. It targets developers building sophisticated AI agents that require structured, contextual memory beyond simple text logs, offering enhanced learning and decision-making capabilities.

How It Works

This project utilizes Neo4j's graph database capabilities to create a unified memory system. It distinguishes between short-term memory (conversations, session history), long-term memory (entities, facts, preferences, knowledge graph using the POLE+O model), and reasoning memory (traces of tool usage and decision-making). The system supports multi-stage entity and relationship extraction, background knowledge enrichment, and geospatial queries, allowing agents to build rich, interconnected contextual understanding. Pluggable providers for LLMs and embeddings (v0.3) enhance flexibility.

Quick Start & Requirements

  • Installation: pip install neo4j-agent-memory (with optional extras like [mcp], [openai], [litellm]).
  • Prerequisites: A running Neo4j instance (v5.20+ recommended for vector indexes) and Python 3.10+.
  • Setup: Options include a zero-code MCP server for AI assistants, a programmatic async Python API, or scaffolding a full-stack application using uvx create-context-graph.
  • Links: Full documentation is available at neo4j.com/labs/agent-memory.

Highlighted Details

  • MCP Server: Exposes memory functionalities as tools for AI assistants (e.g., Claude Desktop/Code), supporting various profiles and transports.
  • Pluggable Providers (v0.3): Integrates with over 100 LLM and embedding providers via native adapters (OpenAI, Anthropic, Bedrock, Vertex AI, sentence-transformers) or the LiteLLM universal fallback.
  • Advanced Features: Supports adopting existing Neo4j graphs, multi-tenant scoping, buffered writes for performance, consolidation primitives, and an evaluation harness.
  • Framework Integrations: Offers adapters for LangChain, Pydantic AI, Google ADK, Strands, CrewAI, and more.

Maintenance & Community

This is a Neo4j Labs project, meaning it is community-supported and not officially backed by Neo4j. Community interaction and development guidance are available via GitHub Issues.

Licensing & Compatibility

The project is licensed under the Apache License 2.0, a permissive license suitable for commercial use and integration into closed-source applications.

Limitations & Caveats

As a community-supported project, it lacks official Neo4j backing. The Python API is strictly asynchronous, requiring asyncio or compatible event loops. A running Neo4j instance is a mandatory prerequisite for operation.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
13
Issues (30d)
3
Star History
104 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.