Logo van Ai Toolkit

Ai Toolkit

Organisatie
memgraph

Toolkit for building AI-driven graph apps on Memgraph, with LangChain, MCP, and agent implementations.

Uitgevermemgraph
Repositoryai-toolkit
TaalPython
Forks
14
Sterren
112
Beschikbare tools
0
Transporttypestdio
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    Ai Toolkit biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    112 sterren en 14 forks in de gekoppelde repository.

Memgraph AI Toolkit

PyPI - memgraph-toolbox PyPI - langchain-memgraph PyPI - mcp-memgraph PyPI - unstructured2graph Discord

Build powerful AI applications with graph-powered RAG using Memgraph. This toolkit provides everything you need to integrate knowledge graphs into your GenAI workflows.

🚀 Quick Setup

Start Memgraph

bash
docker run -p 7687:7687 \
  --name memgraph \
  memgraph/memgraph-mage:latest \
  --schema-info-enabled=true

Install Packages

bash
# Core toolbox
pip install memgraph-toolbox

# LangChain integration
pip install langchain-memgraph

# MCP server
pip install mcp-memgraph

# Unstructured to Graph
pip install unstructured2graph

📚 Usage Examples

Context Graph - Capture Your Agent Sessions

Turn your Claude Code and Codex sessions into a queryable knowledge graph. Install the plugin and every session records the tools it called, the skills it used, and the memories it wrote — all joined on a shared (:Session) node in Memgraph.

Inside Claude Code:

text
/plugin marketplace add memgraph/ai-toolkit
/plugin install context-graph@context-graph-plugins

Then bootstrap, set your identity, and verify:

bash
agent-context-graph bootstrap --runtime claude-code \
  --connector skills-graph --connector actions-graph --connector sessions-graph
agent-context-graph config set identity.user_id "your-name"
agent-context-graph doctor --runtime claude-code \
  --connector skills-graph --connector actions-graph --connector sessions-graph

Query across every session — e.g. which skills a user has used:

cypher
MATCH (:User {user_id: "your-name"})-[:HAD_SESSION]->(:Session)-[:USED_SKILL]->(s:Skill)
RETURN s.name, count(*) AS uses ORDER BY uses DESC;

👉 Context Graph guide — components, Codex setup, SDK usage, and reconciling sessions into an entity graph.


unstructured2graph - Build Knowledge Graphs from Documents

Transform PDFs, URLs, and documents into queryable knowledge graphs:

python
import asyncio
from memgraph_toolbox.api.memgraph import Memgraph
from lightrag_memgraph import MemgraphLightRAGWrapper
from unstructured2graph import LightRAGBackend, from_unstructured


async def main():
    memgraph = Memgraph()

    lightrag = MemgraphLightRAGWrapper()
    await lightrag.initialize(working_dir="./lightrag_storage")

    # Ingest documents from URLs or local files
    await from_unstructured(
        sources=["https://example.com/doc.pdf", "./local_file.md"],
        memgraph=memgraph,
        extraction_backend=LightRAGBackend(lightrag),
        link_chunks=True,
        enforce_ontology=True,  # promote entity_type to real labels (:Person, :Organization, ...)
    )
    await lightrag.afinalize()


asyncio.run(main())

extraction_backend is pluggable — LightRAGBackend (LLM-based, shown above) or GLiNER2Backend (local, LLM-free) — see unstructured2graph § choosing an extraction backend.

👉 Full Documentation | Examples


langchain-memgraph - LangChain Integration

Natural Language Queries with MemgraphQAChain

python
from langchain_memgraph.graphs.memgraph import MemgraphLangChain
from langchain_memgraph.chains.graph_qa import MemgraphQAChain
from langchain_openai import ChatOpenAI

graph = MemgraphLangChain(url="bolt://localhost:7687")

chain = MemgraphQAChain.from_llm(
    ChatOpenAI(temperature=0),
    graph=graph,
    model_name="gpt-4-turbo",
    allow_dangerous_requests=True,
)

response = chain.invoke("Who are the main characters in the dataset?")
print(response["result"])

Build Agents with MemgraphToolkit

python
from langchain.chat_models import init_chat_model
from langchain_memgraph import MemgraphToolkit
from langchain_memgraph.graphs.memgraph import MemgraphLangChain
from langgraph.prebuilt import create_react_agent

llm = init_chat_model("gpt-4o-mini", model_provider="openai")
db = MemgraphLangChain(url="bolt://localhost:7687")
toolkit = MemgraphToolkit(db=db, llm=llm)

agent = create_react_agent(llm, toolkit.get_tools())
events = agent.stream({"messages": [("user", "Find all Person nodes")]})

👉 Full Documentation


mcp-memgraph - Model Context Protocol Server

Expose Memgraph to LLMs via MCP. Run with Docker:

bash
# HTTP mode (recommended)
docker run --rm -p 8000:8000 memgraph/mcp-memgraph:latest

# Stdio mode for MCP clients
docker run --rm -i -e MCP_TRANSPORT=stdio memgraph/mcp-memgraph:latest

Available Tools:

ToolDescription
run_queryExecute Cypher queries
search_schemaSearch the graph schema by regex pattern
get_node_schemaGet full schema definition of a node by its labels
get_relationship_schemaGet full schema definition of a relationship
get_enum_schemaGet schema definition of an enum by its name

👉 Full Documentation


sql2graph Agent - Automated Database Migration

Migrate from MySQL/PostgreSQL to Memgraph with AI assistance:

bash
cd agents/sql2graph
uv run main.py

👉 Full Documentation


🛠️ Packages Overview

PackageDescriptionInstall
memgraph-toolboxCore utilities for Memgraphpip install memgraph-toolbox
langchain-memgraphLangChain tools and chainspip install langchain-memgraph
mcp-memgraphMCP server for LLMspip install mcp-memgraph
unstructured2graphDocument to graph conversionpip install unstructured2graph
lightrag-memgraphLightRAG storage on Memgraphpip install lightrag-memgraph
sql2graphDatabase migration agentSee docs

Context Graph — capture agent sessions

A family of components that persist your Claude Code / Codex sessions into one Memgraph graph. See the Context Graph guide.

PackageDescriptionInstall
agent-context-graphEvent hub: routes runtime hooks to connectorspip install agent-context-graph
actions-graphTool calls, results, messages as action nodespip install actions-graph
skills-graphSkill definitions and per-session skill usagepip install skills-graph
sessions-graphUser/session provenance, memories, reconciliationpip install sessions-graph

❓ FAQ

Which databases are supported? Memgraph is the primary target. The sql2graph agent supports MySQL and PostgreSQL as source databases.

Do I need an LLM API key? Yes, for features like entity extraction (unstructured2graph) and natural language queries (langchain-memgraph).

Can I use local LLMs? Yes! LangChain integration supports any LangChain-compatible model, including Ollama.


🤝 Community

⭐ If you find this toolkit helpful, please star the repository!


🧪 Developing Locally

You can build and test each package directly from your repo.

Core tests

bash
uv pip install -e memgraph-toolbox[test]
pytest -s memgraph-toolbox/src/memgraph_toolbox/tests

LangChain integration tests

Create a .env file with your OPENAI_API_KEY, as the tests depend on LLM calls:

bash
uv pip install -e integrations/langchain-memgraph[test]
pytest -s integrations/langchain-memgraph/tests

MCP integration tests

bash
uv pip install -e integrations/mcp-memgraph[test]
pytest -s integrations/mcp-memgraph/tests

Context Graph tests

The Context Graph components (and unstructured2graph) test against a live Memgraph. scripts/dev-memgraph.sh owns that lifecycle — it starts an isolated instance, runs each component's suite against it, and tears down:

bash
./scripts/dev-memgraph.sh up
./scripts/dev-memgraph.sh test          # all components; or e.g. `test sessions-graph`
./scripts/dev-memgraph.sh down

sql2graph agent

To run a complete database migration workflow with the agent:

bash
cd agents/sql2graph
uv run main.py

Note: The agent requires both MySQL and Memgraph connections. Set up your environment variables in .env based on .env.example.

If you are running any test on macOS in zsh, add "" to the command:

bash
uv pip install -e memgraph-toolbox"[test]"

Gebruik Ai Toolkit MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Ai Toolkit is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Ai Toolkit toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Ai Toolkit.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "ai-toolkit": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Ai Toolkit in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Ai Toolkit in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Ai Toolkit gebruiken om me hiermee te helpen?
Ai Toolkit
Zeker. Ik heb het gelezen.
Dit vond ik met Ai Toolkit.

Veelgestelde vragen

Waarvoor wordt de MCP-server Ai Toolkit gebruikt?

Ai Toolkit is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Ai Toolkit MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Ai Toolkit gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Ai Toolkit MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Ai Toolkit verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Ai Toolkit MCP met TypingMind?

Ai Toolkit werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Ai Toolkit MCP in TypingMind?

Ai Toolkit biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Ai Toolkit MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Ai Toolkit authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇