AI applications

AI applications

Memgraph is the graph engine that powers AI context. Use it to build GraphRAG, AI memory and agentic applications that retrieve their context from a knowledge graph.

Vector search finds what’s similar, and graph traversal finds what’s connected: multi-hop relationships, entity hierarchies and the reasoning path behind an answer. Memgraph keeps the graph in memory and runs vector search, traversals and graph algorithms in the same database.

In a typical application, structured and unstructured data become a knowledge graph with vector embeddings. An agent retrieves context from it with Text2Cypher, vector search, text search or graph algorithms:

Data from structured and unstructured sources flows into a Memgraph knowledge graph, which agents query through retrieval methods such as Text2Cypher and vector search

This section covers:

  • Knowledge graph creation: Choose how to create the graph from your data: SQL2Graph for MySQL and PostgreSQL, Unstructured2Graph for documents, and the data migration tools for files, streams and Neo4j.
  • GraphRAG: Retrieve context by traversing the knowledge graph, not only by similarity. Atomic GraphRAG runs search, expansion, ranking and prompt assembly as one Cypher query, and Agentic GraphRAG lets an agent choose the retrieval pipeline for each question.
  • AI memory: Give coding agents a long-term memory with Context Graph, which records their sessions in Memgraph and serves them back to every connected agent in later sessions.
  • Agentic AI: Store an agent’s states and actions as a reasoning graph, so the agent plans by traversing scored paths instead of by prompting, and every decision leaves a trace you can inspect.
  • Graph machine learning: Use node embeddings and graph neural networks from MAGE for recommendations, link prediction and node classification.
  • Tools and integrations: Connect agents to Memgraph through the Model Context Protocol (MCP) with the Memgraph MCP server, and use Memgraph with LangChain, LlamaIndex, LightRAG, Cognee and Mem0.

Run an example

Each command sets up one use case with Memgraph in Docker. None of them needs an API key.

  • Agentic GraphRAG: Loads a knowledge graph, runs Text2Cypher, local graph search and query-focused summarization on it, and starts the Memgraph MCP server. You need Docker and git.

    curl -sSL https://install.memgraph.com/agentic-graphrag | bash
  • AI memory: Sets up Context Graph, which records your coding agents’ sessions in Memgraph and serves them back as memory. It asks before it changes anything. You need Docker.

    curl -sSL https://install.memgraph.com/ai-memory | bash
  • Agentic AI: Loads a reasoning graph and sample customer records in PostgreSQL, then plans by traversing the graph. Agents query both through one endpoint, provided by MemGQL. You need Docker.

    curl -sSL https://install.memgraph.com/agentic-ai | bash

Build your own application

You need:

  • A running Memgraph instance with MAGE, the graph algorithms library. To start one, see Getting started.
  • Data for your knowledge graph. To design the graph, see Data modeling.
  • An API key for the LLM your application uses.

Memgraph keeps the graph in memory, so size RAM for your dataset, including vector embeddings. See How much RAM do I need.

SQL2Graph, Unstructured2Graph, Context Graph, the Memgraph MCP server and the LangChain and LightRAG integrations are open source in the Memgraph AI Toolkit. To help an AI coding assistant write Memgraph code, see Use an AI coding assistant.