Skip to main content

Memgraph Toolbox

The Memgraph Toolbox is a collection of tools designed to interact with a Memgraph database. These tools provide functionality for querying, analyzing, and managing data within Memgraph, making it easier to work with graph data. They are made to be easily called from other frameworks such as MCP, LangChain or LlamaIndex.

Available Tools

Below is a list of tools included in the toolbox, along with their descriptions:

  1. CypherTool - Executes arbitrary Cypher queries on a Memgraph database.
  2. SearchSchemaTool - Searches the entire graph schema (nodes, relationships and enums) by a regex pattern.
  3. NodeSchemaTool - Returns the full schema definition of a node by its labels, including properties, indexes, constraints, and connected relationships.
  4. RelationshipSchemaTool - Returns the full schema definition of a relationship by its type and connected node labels, including properties and indexes.
  5. EnumSchemaTool - Returns the schema definition of an enum by its name, including its values.

Usage

Each tool is implemented as a Python class inheriting from BaseTool. To use a tool:

  1. Instantiate the tool with a Memgraph database connection.
  2. Call the call method with the required arguments.

Example:

from memgraph_toolbox.api.memgraph import Memgraph
from memgraph_toolbox.memgraph_toolbox import MemgraphToolbox

# Connect to Memgraph
db = Memgraph(url="bolt://localhost:7687", username="", password="")

# Show available tools
toolbox = MemgraphToolbox(db)
for tool in toolbox.get_all_tools():
    print(f"Tool Name: {tool.name}, Description: {tool.description}")

# Run a Cypher query
cypher_tool = toolbox.get_tool("run_cypher_query")
result = cypher_tool.call({"query": "MATCH (n) RETURN n LIMIT 5"})
print(result)

# Get the schema definition of a node
node_schema_tool = toolbox.get_tool("get_node_schema")
result = node_schema_tool.call({"node_labels": ["Person"]})
print(result)

Installation

Install the base package:

pip install memgraph-toolbox

Optional dependencies

For the MCP prompt client (litellm + mcp):

pip install 'memgraph-toolbox[client]'

For evaluation metrics (deepeval, sentence-transformers, torch):

pip install 'memgraph-toolbox[evaluations]'

For running tests:

pip install 'memgraph-toolbox[test]'

For all optional dependencies (e.g., CI):

pip install 'memgraph-toolbox[client,evaluations,test]'

Requirements

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the toolbox.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Release files for memgraph-toolbox 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memgraph-toolbox 0.2.0
File Size Uploaded
memgraph_toolbox-0.2.0.tar.gz 204.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memgraph-toolbox 0.2.0
File Interpreter ABI Platform
memgraph_toolbox-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 232.4 kB

Release files / memgraph_toolbox-0.2.0.tar.gz

Download URL memgraph_toolbox-0.2.0.tar.gz
Size 204.1 kB
Tags Source
SHA-256 checksum
How to use checksums
71fa3225594a8ea6d1071df0526c87675762e0b48a866fda39f5b38137ca85bc
BLAKE2b-256 checksum
How to use checksums
7c157eb62f30e1a94cd1eb7d490d08bfd8e46a0d1ec5181a8b4ee5435eca5cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / memgraph_toolbox-0.2.0-py3-none-any.whl

Download URL memgraph_toolbox-0.2.0-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eeedccde45452a1513fb19ce1d5e22e3a97e94b42843063697a1be1ab8fcaadb
BLAKE2b-256 checksum
How to use checksums
65bf3db159c4b772d5923bb7032a72221d53087b1effa174e75ecd50caf4d54a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page