Skip to main content

Memgraph toolbox library for Memgraph AI tools and utilities

Project description

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. ShowTriggersTool - Shows trigger information from a Memgraph database.
  2. ShowStorageInfoTool - Shows storage information from a Memgraph database.
  3. ShowSchemaInfoTool - Shows schema information from a Memgraph database.
  4. PageRankTool - Calculates PageRank on a graph in Memgraph.
  5. BetweennessCentralityTool - Calculates betweenness centrality for nodes in a graph.
  6. ShowIndexInfoTool - Shows index information from a Memgraph database.
  7. CypherTool - Executes arbitrary Cypher queries on a Memgraph database.
  8. ShowConstraintInfoTool - Shows constraint information from a Memgraph database.
  9. ShowConfigTool - Shows configuration information from a Memgraph database.
  10. NodeVectorSearchTool - Searches the most similar nodes using the Memgraph's vector search.
  11. NodeNeighborhoodTool - Searches for the data attached to a given node using Memgraph's deep-path traversals.

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.tools.trigger import ShowTriggersTool
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}")

# Use the ShowTriggersTool
tool = ShowTriggersTool(db)
triggers = tool.call({})
print(triggers)

Installation

Install the base package:

pip install memgraph-toolbox

If you need embedding utilities or evaluation metrics that depend on PyTorch and sentence-transformers:

pip install 'memgraph-toolbox[evaluations]'

Requirements

  • Python 3.10+
  • Running Memgraph instance
  • Memgraph MAGE library (for certain tools like pagerank and run_betweenness_centrality)
  • Optional: PyTorch and sentence-transformers (install with evaluations extra) for embedding utilities and coherence evaluation

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.

Project 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.1.7.tar.gz (189.3 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.1.7-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: memgraph_toolbox-0.1.7.tar.gz
  • Upload date:
  • Size: 189.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for memgraph_toolbox-0.1.7.tar.gz
Algorithm Hash digest
SHA256 bdfa0fdbed37ad01a510e50be98ec2bd51d72f253918d3bb68cf67e54485c723
MD5 843f6e3ff3e480d7a2b27a51ec86b312
BLAKE2b-256 7c32f6e491d058c9035a2a5ff5ad20a2a77fb55f13e121aab1937f62b01237f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for memgraph_toolbox-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c61579ad66def7baa7317a56887d58b38c7356be6294b0168318e7b204f96904
MD5 3d83b2985e54b21c998c2f050e8a3f7d
BLAKE2b-256 291161753f7bf45ece8493b5154107907efd4c497faa6c59c52c314efaab1c44

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 Pingdom Monitoring Sentry Error logging StatusPage Status page