> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Memgraph

> Use Memgraph as a graph store through a community-maintained adapter

Memgraph is an in-memory graph database that uses the Bolt protocol. It provides fast graph operations and is suitable for knowledge graph storage and relationship reasoning.

<Note>
  Cognee can use Memgraph as a [graph store](/setup-configuration/graph-stores) backend through this [community-maintained](/setup-configuration/community-maintained/overview) [adapter](https://github.com/topoteretes/cognee-community/tree/main/packages/graph/memgraph).
</Note>

## Installation

This adapter is a separate package from core Cognee. Before installing, complete the [Cognee installation](/getting-started/installation) and ensure your environment is configured with [LLM and embedding providers](/setup-configuration/overview). After that, install the adapter package:

```bash theme={null}
uv pip install cognee-community-graph-adapter-memgraph
```

## Requirements

* Python 3.10 to 3.13
* Memgraph database instance
* neo4j driver (for Bolt protocol support)

## Configuration

Run a local Memgraph instance:

```bash theme={null}
docker run -d --name memgraph -p 7687:7687 memgraph/memgraph-platform
```

Configure in Python:

```python theme={null}
from cognee_community_graph_adapter_memgraph import register
from cognee import config

register()
config.set_graph_database_provider("memgraph")
config.set_graph_db_config({
    "graph_database_url": "bolt://localhost:7687",
    "graph_database_username": "memgraph",
    "graph_database_password": "memgraph",
})
```

Or via environment variables:

```dotenv theme={null}
GRAPH_DATABASE_PROVIDER="memgraph"
GRAPH_DATABASE_URL="bolt://localhost:7687"
GRAPH_DATABASE_USERNAME="memgraph"
GRAPH_DATABASE_PASSWORD="memgraph"
```

## Important Notes

<Accordion title="Adapter Registration">
  Import and call `register()` from the adapter package before using Memgraph with Cognee. This registers the adapter with Cognee's graph provider system.
</Accordion>

<Accordion title="Troubleshooting">
  1. **Connection Errors**: Ensure Memgraph is running and accessible at the specified Bolt URL (default port 7687)
  2. **Driver**: The adapter uses the neo4j driver for Bolt protocol support; ensure it is installed with Cognee or the community package
  3. **Authentication**: Use the same credentials you configured for your Memgraph instance
</Accordion>

## Features

* Full support for Memgraph's property graph model
* Optimized queries for graph operations
* Async/await support and transaction support
* Graph completion search and Chain of Thought (COT) reasoning
* Direct graph data access via `get_graph_engine()` and HTML visualization with `cognee.visualize_graph()`

## Resources

<CardGroup cols={3}>
  <Card title="Adapter Source" icon="github" href="https://github.com/topoteretes/cognee-community/tree/main/packages/graph/memgraph">
    GitHub repository
  </Card>

  <Card title="README & Example" icon="book" href="https://github.com/topoteretes/cognee-community/blob/main/packages/graph/memgraph/README.md">
    Full usage example and configuration
  </Card>

  <Card title="Memgraph Docs" icon="external-link" href="https://memgraph.com/docs">
    Memgraph database documentation
  </Card>
</CardGroup>

<Columns cols={3}>
  <Card title="Graph Stores" icon="network" href="/setup-configuration/graph-stores">
    Official graph providers
  </Card>

  <Card title="Community Overview" icon="users" href="/setup-configuration/community-maintained/overview">
    All community integrations
  </Card>

  <Card title="Setup Overview" icon="settings" href="/setup-configuration/overview">
    Configuration guide
  </Card>
</Columns>
