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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memgraph_toolbox-0.2.0.tar.gz (204.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memgraph_toolbox-0.2.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file memgraph_toolbox-0.2.0.tar.gz.

File metadata

  • Download URL: memgraph_toolbox-0.2.0.tar.gz
  • Upload date:
  • Size: 204.1 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for memgraph_toolbox-0.2.0.tar.gz
Algorithm Hash digest
SHA256 71fa3225594a8ea6d1071df0526c87675762e0b48a866fda39f5b38137ca85bc
MD5 0288e1a03e4a061c219cf6cac25167e4
BLAKE2b-256 7c157eb62f30e1a94cd1eb7d490d08bfd8e46a0d1ec5181a8b4ee5435eca5cae

See more details on using hashes here.

File details

Details for the file memgraph_toolbox-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: memgraph_toolbox-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for memgraph_toolbox-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eeedccde45452a1513fb19ce1d5e22e3a97e94b42843063697a1be1ab8fcaadb
MD5 d3427ed9601599a2de5b04138248b9d5
BLAKE2b-256 65bf3db159c4b772d5923bb7032a72221d53087b1effa174e75ecd50caf4d54a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page