{"id":49225284,"url":"https://github.com/neo4j-labs/agent-memory","last_synced_at":"2026-04-24T06:33:52.303Z","repository":{"id":334026416,"uuid":"1129311820","full_name":"neo4j-labs/agent-memory","owner":"neo4j-labs","description":"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.","archived":false,"fork":false,"pushed_at":"2026-04-23T01:02:08.000Z","size":10950,"stargazers_count":152,"open_issues_count":46,"forks_count":46,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-23T02:22:28.446Z","etag":null,"topics":["agent-memory","context-graph","context-graphs","graph-based-reasoning","knowledge-graph","neo4j"],"latest_commit_sha":null,"homepage":"https://neo4j.com/labs/agent-memory/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-06T23:07:16.000Z","updated_at":"2026-04-23T01:02:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/neo4j-labs/agent-memory","commit_stats":null,"previous_names":["neo4j-labs/agent-memory"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/neo4j-labs/agent-memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fagent-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fagent-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fagent-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fagent-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-labs","download_url":"https://codeload.github.com/neo4j-labs/agent-memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fagent-memory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32212807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-memory","context-graph","context-graphs","graph-based-reasoning","knowledge-graph","neo4j"],"created_at":"2026-04-24T06:33:50.082Z","updated_at":"2026-04-24T06:33:52.294Z","avatar_url":"https://github.com/neo4j-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neo4j Agent Memory\n\nA graph-native memory system for AI agents. Store conversations, build knowledge graphs, and let your agents learn from their own reasoning -- all backed by Neo4j.\n\n[![Neo4j Labs](https://img.shields.io/badge/Neo4j-Labs-6366F1?logo=neo4j)](https://neo4j.com/labs/)\n[![Status: Experimental](https://img.shields.io/badge/Status-Experimental-F59E0B)](https://neo4j.com/labs/)\n[![Community Supported](https://img.shields.io/badge/Support-Community-6B7280)](https://community.neo4j.com)\n[![CI](https://github.com/neo4j-labs/agent-memory/actions/workflows/ci.yml/badge.svg)](https://github.com/neo4j-labs/agent-memory/actions/workflows/ci.yml)\n[![PyPI version](https://badge.fury.io/py/neo4j-agent-memory.svg)](https://badge.fury.io/py/neo4j-agent-memory)\n[![Python versions](https://img.shields.io/pypi/pyversions/neo4j-agent-memory.svg)](https://pypi.org/project/neo4j-agent-memory/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## What It Does\n\n![The Neo4j Agent Memory data model](img/memory-graph-model.png)\n\n| Short-Term Memory | Long-Term Memory | Reasoning Memory |\n|---|---|---|\n| Conversations \u0026 messages | Entities, preferences, facts | Reasoning traces \u0026 tool usage |\n| Per-session history | Knowledge graph ([POLE+O model](https://neo4j.com/labs/agent-memory/explanation/poleo-model.html)) | Learn from past decisions |\n| Vector + text search | Entity resolution \u0026 dedup | Similar task retrieval |\n\n![The Neo4j Agent Memory entity extraction pipeline](img/extraction-pipeline.png)\n\n**Plus:** multi-stage entity extraction (spaCy / GLiNER / LLM), relationship extraction (GLiREL), background enrichment (Wikipedia / Diffbot), geospatial queries, [MCP server](#mcp-server) with 16 tools, and integrations with [LangChain, Pydantic AI, Google ADK, Strands, CrewAI, and more](#framework-integrations).\n\n## Quick Start\n\n**Prerequisites:** A running Neo4j instance ([Neo4j Desktop](https://neo4j.com/download/), [Docker](https://hub.docker.com/_/neo4j), or [Neo4j Aura](https://neo4j.com/cloud/) for a free cloud database).\n\n### Option A: MCP Server (zero code)\n\nGive any MCP-compatible AI assistant (Claude Desktop, Claude Code, Cursor, VS Code Copilot) persistent memory backed by a knowledge graph:\n\n```bash\n# Run directly with uvx (no install needed)\nuvx \"neo4j-agent-memory[mcp]\" mcp serve --password \u003cneo4j-password\u003e\n```\n\n![Neo4j Agent Memory MCP server](img/memory-architecture.png)\n\n**Claude Code:**\n\n```bash\nclaude mcp add neo4j-agent-memory -- \\\n  uvx \"neo4j-agent-memory[mcp]\" mcp serve --password \u003cneo4j-password\u003e\n```\n\n**Claude Desktop** (`claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"neo4j-agent-memory\": {\n      \"command\": \"uvx\",\n      \"args\": [\"neo4j-agent-memory[mcp]\", \"mcp\", \"serve\", \"--password\", \"your-password\"],\n      \"env\": {\n        \"OPENAI_API_KEY\": \"sk-...\"\n      }\n    }\n  }\n}\n```\n\n### Option B: Python API\n\n![The memory abstractions exposed by the Neo4j Agent Memory package](img/memory-types.png)\n\n```python\nimport asyncio\nfrom neo4j_agent_memory import MemoryClient, MemorySettings\n\nasync def main():\n    settings = MemorySettings(\n        neo4j={\"uri\": \"bolt://localhost:7687\", \"password\": \"your-password\"}\n    )\n\n    async with MemoryClient(settings) as memory:\n        # Store a conversation message\n        await memory.short_term.add_message(\n            session_id=\"user-123\", role=\"user\",\n            content=\"Hi, I'm John and I love Italian food!\"\n        )\n\n        # Build the knowledge graph\n        await memory.long_term.add_entity(\"John\", \"PERSON\")\n        await memory.long_term.add_preference(\n            category=\"food\", preference=\"Loves Italian cuisine\"\n        )\n\n        # Get combined context for an LLM prompt\n        context = await memory.get_context(\n            \"What restaurant should I recommend?\",\n            session_id=\"user-123\"\n        )\n        print(context)\n\nasyncio.run(main())\n```\n\n### Option C: Full-Stack App with create-context-graph\n\nScaffold a complete full-stack AI application with built-in context graph memory:\n\n```bash\nuvx create-context-graph\n```\n\n![Create Context Graph full stack context graph application powered by Neo4j Agent Memory](img/app-three-panel.png)\n\nThis generates a ready-to-run project with a FastAPI backend, Next.js frontend, Neo4j knowledge graph, and neo4j-agent-memory pre-configured. See [create-context-graph.dev](https://create-context-graph.dev) for details.\n\n## Installation\n\n```bash\npip install neo4j-agent-memory                  # Core\npip install neo4j-agent-memory[openai]          # + OpenAI embeddings\npip install neo4j-agent-memory[mcp]             # + MCP server\npip install neo4j-agent-memory[langchain]       # + LangChain\npip install neo4j-agent-memory[all]             # Everything\n```\n\nSee the [getting started guide](https://neo4j.com/labs/agent-memory/getting-started.html) for all extras (Vertex AI, Bedrock, spaCy, GLiNER, Google ADK, Strands, etc.).\n\n## Framework Integrations\n\n| Framework | Extra | Import |\n|---|---|---|\n| [LangChain](https://neo4j.com/labs/agent-memory/how-to/integrations/langchain.html) | `[langchain]` | `from neo4j_agent_memory.integrations.langchain import Neo4jAgentMemory` |\n| [Pydantic AI](https://neo4j.com/labs/agent-memory/how-to/integrations/pydantic-ai.html) | `[pydantic-ai]` | `from neo4j_agent_memory.integrations.pydantic_ai import MemoryDependency` |\n| [Google ADK](https://neo4j.com/labs/agent-memory/how-to/integrations/google-cloud.html) | `[google-adk]` | `from neo4j_agent_memory.integrations.google_adk import Neo4jMemoryService` |\n| [Strands (AWS)](https://neo4j.com/labs/agent-memory/how-to/integrations/aws-strands.html) | `[strands]` | `from neo4j_agent_memory.integrations.strands import context_graph_tools` |\n| [CrewAI](https://neo4j.com/labs/agent-memory/how-to/integrations/crewai.html) | `[crewai]` | `from neo4j_agent_memory.integrations.crewai import Neo4jCrewMemory` |\n| [LlamaIndex](https://neo4j.com/labs/agent-memory/how-to/integrations/llamaindex.html) | `[llamaindex]` | `from neo4j_agent_memory.integrations.llamaindex import Neo4jLlamaIndexMemory` |\n| [OpenAI Agents](https://neo4j.com/labs/agent-memory/how-to/integrations/openai-agents.html) | `[openai-agents]` | `from neo4j_agent_memory.integrations.openai_agents import ...` |\n| [Microsoft Agent](https://neo4j.com/labs/agent-memory/how-to/integrations/microsoft-agent.html) | `[microsoft-agent]` | `from neo4j_agent_memory.integrations.microsoft_agent import Neo4jMicrosoftMemory` |\n\n## MCP Server\n\nThe MCP server exposes memory capabilities as tools for AI assistants.\n\n```bash\n# stdio transport (Claude Desktop, Claude Code)\nneo4j-agent-memory mcp serve --password \u003cpw\u003e\n\n# SSE transport (network deployment)\nneo4j-agent-memory mcp serve --transport sse --port 8080 --password \u003cpw\u003e\n\n# Core profile (fewer tools, less context overhead)\nneo4j-agent-memory mcp serve --profile core --password \u003cpw\u003e\n\n# Session continuity across conversations\nneo4j-agent-memory mcp serve --session-strategy per_day --user-id alice --password \u003cpw\u003e\n```\n\n**Tool Profiles:**\n\n| Profile | Tools | Description |\n|---------|-------|-------------|\n| **core** | 6 | Essential read/write: `memory_search`, `memory_get_context`, `memory_store_message`, `memory_add_entity`, `memory_add_preference`, `memory_add_fact` |\n| **extended** (default) | 16 | Full surface adding: conversation history, entity details, graph export, relationship creation, reasoning traces, observations, read-only Cypher |\n\nSee the [MCP tools reference](https://neo4j.com/labs/agent-memory/reference/mcp-tools.html) for full details.\n\n## Examples\n\n| Example | Framework | Description |\n|---------|-----------|-------------|\n| [Lenny's Podcast Memory Explorer](examples/lennys-memory/) | PydanticAI | Flagship demo: 299 podcast episodes, knowledge graph, geospatial maps, Wikipedia enrichment |\n| [Full-Stack Chat Agent](examples/full-stack-chat-agent/) | PydanticAI | News research assistant with NVL graph visualization and auto-preference detection |\n| [AWS Financial Advisor](examples/financial-services-advisor/aws-financial-services-advisor/) | Strands (AWS) | Multi-agent KYC/AML compliance with Bedrock and reasoning trace audit trails |\n| [Google Cloud Financial Advisor](examples/financial-services-advisor/google-cloud-financial-advisor/) | Google ADK | Multi-agent compliance with Vertex AI embeddings and real-time SSE streaming |\n| [Microsoft Retail Assistant](examples/microsoft_agent_retail_assistant/) | Microsoft Agent | Shopping recommendations with GDS algorithms, entity deduplication, and context providers |\n| [Domain Schema Examples](examples/domain-schemas/) | Standalone | 8 GLiNER2 extraction scripts with factory pattern, batch extraction, streaming, and GLiREL relations |\n| [Google Cloud Integration](examples/google_cloud_integration/) | Google ADK | Progressive tutorial: Vertex AI, ADK, MCP server, and MemoryIntegration with session strategies |\n| [Google ADK Demo](examples/google_adk_demo/) | Google ADK | Standalone demo of Neo4jMemoryService with session storage, search, and preferences |\n\nAll examples use `neo4j-agent-memory\u003e=0.1.0` and demonstrate the latest features including `ExtractionConfig`, `DeduplicationConfig`, `MemoryIntegration`, and `SessionStrategy`.\n\n## Documentation\n\nFull documentation at **[neo4j.com/labs/agent-memory](https://neo4j.com/labs/agent-memory/)**\n\n- [Tutorials](https://neo4j.com/labs/agent-memory/tutorials/) -- Build your first memory-enabled agent\n- [How-To Guides](https://neo4j.com/labs/agent-memory/how-to/) -- Entity extraction, deduplication, enrichment, integrations\n- [API Reference](https://neo4j.com/labs/agent-memory/reference/) -- Configuration, CLI, MCP tools\n- [Concepts](https://neo4j.com/labs/agent-memory/explanation/) -- POLE+O model, memory types, extraction pipeline\n\n## Development\n\n```bash\ngit clone https://github.com/neo4j-labs/agent-memory.git\ncd agent-memory/neo4j-agent-memory\nuv sync --group dev\nmake test-unit    # Run unit tests\nmake check        # Lint + format + typecheck\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the full development guide, CI pipeline, and documentation guidelines.\n\n## Requirements\n\n- Python 3.10+\n- Neo4j 5.20+ (for vector indexes)\n\n## License\n\nApache License 2.0\n\n---\n\nThis is a [Neo4j Labs](https://neo4j.com/labs/) project -- community supported, not officially backed by Neo4j. [Community Forum](https://community.neo4j.com) | [GitHub Issues](https://github.com/neo4j-labs/agent-memory/issues) | [Documentation](https://neo4j.com/labs/agent-memory/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fagent-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-labs%2Fagent-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fagent-memory/lists"}