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.

Metadata

Release files for memgraph-toolbox 0.2.1

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.1
File Size Uploaded
memgraph_toolbox-0.2.1.tar.gz 206.2 kB Details

Built distribution (wheel)

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

Total release size: 236.7 kB

Release files / memgraph_toolbox-0.2.1.tar.gz

Download URL memgraph_toolbox-0.2.1.tar.gz
Size 206.2 kB
Tags Source
SHA-256 checksum
How to use checksums
911686568cd5b027fcd23bf4a563fe31a699e586cc49af9e9bdc1b13c33b301e
BLAKE2b-256 checksum
How to use checksums
b1e7ab470c42de87c53f8a4fa418a1b26eb775cd608260c3ba3a2c5fa9320e68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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.1-py3-none-any.whl

Download URL memgraph_toolbox-0.2.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f412aa14d6163e25ab52d7e0cbf357a65ff3e94b4e317df78e14bd66fab67817
BLAKE2b-256 checksum
How to use checksums
636b973051550c535adb4d44e3108c68de9f545569db2af5eb6271ff17cd22ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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.1 This release

2 release files

0.2.0

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