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.2

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.2
File Size Uploaded Provenance Actions
memgraph_toolbox-0.2.2.tar.gz 207.4 kB Without provenance Details for memgraph_toolbox-0.2.2.tar.gz

Built distribution (wheel)

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

Total release size: 239.6 kB

Release files / memgraph_toolbox-0.2.2.tar.gz

Download URL memgraph_toolbox-0.2.2.tar.gz
Size 207.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b821ec00ab0b84a0f75f18aabe33e9bf873a89ef3b82bc64d6d740eee472dd6a
BLAKE2b-256 checksum
How to use checksums
6f4e0e38edf94461ed0aef7e1559cbb7e5a8d894aa7203ca37fe008c70891258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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.2-py3-none-any.whl

Download URL memgraph_toolbox-0.2.2-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7354508d0b9413f0f744877c87fdf76f8062ed3e3cc97695922e559b27b6b27
BLAKE2b-256 checksum
How to use checksums
f1642c8675ea1cc456c4c60cda495398e5ed1d37e5aeaa8a6ffdf089020e4849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}

Security for memgraph-toolbox 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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