Lets AI clients query Memgraph graphs and store agent memory, knowledge graphs, and document extractions.
Also known as memgraph/ai-toolkit
- Stars
- 119
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 12, 2026
- License
- MIT
What is Memgraph AI Toolkit MCP?
Memgraph AI Toolkit lets AI clients query Memgraph graphs and store agent memory, knowledge graphs, and document extractions.
Summary generated from the project's README
About Memgraph AI Toolkit MCP server
Connecting AI agents to graph databases for long-term memory and knowledge extraction is what this toolkit enables. Developers can use these Python packages to build applications that store agent sessions, tool calls, and skill usage within Memgraph. The toolkit provides specialized tools like Context Graph for giving coding agents memory across different sessions and tools, and unstructured2graph for turning documents into structured entities and relationships.
Users can set up the environment using Docker to run Memgraph containers or connect to existing instances. The setup supports various clients including Claude Code, Cursor, and Copilot CLI. While some features like the GLiNER2 backend run locally without requiring an LLM API key, other LLM-based integrations will need credentials from your chosen model provider. The toolkit includes specific integrations for LangChain, LightRAG, and the Model Context Protocol to facilitate database queries and schema management.
What you can do with it
- 1Providing persistent agent memoryGive coding agents the ability to remember past sessions, tool usage, and learned skills.
- 2Extracting knowledge from documentsConvert unstructured text into a structured graph of entities and relationships using local models.
- 3Querying graphs with natural languageUse natural language to interact with your Memgraph database through LangChain agents.
- 4Migrating relational data to graphsTransform existing MySQL or PostgreSQL databases into a graph format.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablememgraph/ai-toolkit is public and reachablegithub.com/memgraph/ai-toolkit ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-12github.com/memgraph/ai-toolkit ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubMemgraph AI Toolkit
Python packages for building AI applications with Memgraph: agent memory, knowledge graphs, GraphRAG, and framework integrations.
Use the packages independently, or combine them to bring documents, databases, and agent activity into a graph.
Documentation · Examples · Discord · Issues
Choose your starting point
| I want to… | Start here |
|---|---|
| Give coding agents memory across sessions and tools | Context Graph |
| Extract entities and relationships from documents | unstructured2graph |
| Query Memgraph in natural language or build a LangChain agent | langchain-memgraph |
| Connect an MCP client to Memgraph | mcp-memgraph |
| Use Memgraph as LightRAG storage | lightrag-memgraph |
| Migrate a MySQL or PostgreSQL database into a graph | sql2graph |
| Work directly with Memgraph from Python | memgraph-toolbox |
| Define and validate a graph's entity and relation types | hygm |
Agent memory with Context Graph
Keep what your agents learn in a database you control. Context Graph captures sessions, tool calls, and skill usage, stores explicit memory, and retrieves relevant past conversations for the next session.
It supports Claude Code, Codex, Copilot CLI, Cursor, OpenCode, Antigravity CLI, and Grok Build, plus applications built with the Claude Agent SDK or OpenAI Agents SDK.
curl -fsSL https://raw.githubusercontent.com/memgraph/ai-toolkit/main/context-graph/scripts/install.sh | bash
Setup installs the CLI and connectors, starts its own Memgraph container or connects to one you specify, and wires the agents you select. Docker is needed if setup starts Memgraph for you.
Get started with Context Graph · Components · Recall benchmarks
Knowledge graphs from documents
unstructured2graph parses documents and extracts entities and relationships. Its default backend, GLiNER2, runs locally without an LLM API key; LightRAG is available as an LLM-based alternative.
Start Memgraph:
docker run -p 7687:7687 --name memgraph \
memgraph/memgraph-mage:latest --schema-info-enabled=true
Install the package:
pip install unstructured2graph
Extract a graph from text:
import asyncio
from memgraph_toolbox.api.memgraph import Memgraph
from unstructured2graph import from_texts
from unstructured2graph.gliner2_backend import GLiNER2Backend
async def main():
await from_texts(
texts=["Alice works for Acme in London."],
memgraph=Memgraph(),
extraction_backend=GLiNER2Backend(),
enforce_ontology=True,
)
asyncio.run(main())
The extraction model downloads on first use. See unstructured2graph for files, URLs, document-format extras, and custom ontologies.
Framework integrations
Install only the integration you need:
pip install langchain-memgraph # graph store, QA chain, and agent toolkit
pip install mcp-memgraph # MCP server for database queries and schema tools
pip install lightrag-memgraph # LightRAG storage backends
Each package's README covers its connection settings and examples. LLM-based features need credentials for the model provider you choose; local extraction, capture, and recall do not require an LLM key.
Developing locally
This is a Python 3.10+ uv workspace. From the repository root:
uv sync --all-packages --all-extras
uvx ruff@0.16.0 check .
uvx ruff@0.16.0 format --check .
uvx ty@0.0.75 check .
These are the versions CI pins in the lint workflow.
Context Graph, HyGM, and unstructured2graph use an isolated test Memgraph managed by the development script:
./scripts/dev-memgraph.sh test
./scripts/dev-memgraph.sh test sessions-graph # one package
./scripts/dev-memgraph.sh test-down # remove the test container
For other packages, see their READMEs and the test workflow for dependencies and credentials. The development script also manages a separate exploration database for dogfooding.
Community
Ask questions on Discord, report bugs or request features in GitHub Issues, and explore the Memgraph AI documentation.
Memgraph AI Toolkit MCP questions
What can an MCP client do with Memgraph?
The mcp-memgraph integration functions as an MCP server that lets clients run database queries and use schema tools.
What is Context Graph used for?
It gives coding agents persistent memory by capturing sessions, tool calls, and skill usage and recalling relevant past conversations.
Which agents does Context Graph support?
It supports Claude Code, Codex, Copilot CLI, Cursor, OpenCode, Antigravity CLI, and Grok Build, plus apps built with the Claude Agent SDK or OpenAI Agents SDK.
Does document extraction need an LLM API key?
No, the default GLiNER2 backend runs locally without one; LightRAG is an alternative that uses an LLM.
Can I use Memgraph as storage for LightRAG?
Yes, the lightrag-memgraph package provides LightRAG storage backends on Memgraph.