memgraph-toolbox0.1.3
memgraph-toolbox0.1.3
Published
Memgraph toolbox library for Memgraph AI tools and utilities
pip install memgraph-toolbox
Package Downloads
Authors
Requires Python
>=3.10
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:
ShowTriggersTool
- Shows trigger information from a Memgraph database.ShowStorageInfoTool
- Shows storage information from a Memgraph database.ShowSchemaInfoTool
- Shows schema information from a Memgraph database.PageRankTool
- Calculates PageRank on a graph in Memgraph.BetweennessCentralityTool
- Calculates betweenness centrality for nodes in a graph.ShowIndexInfoTool
- Shows index information from a Memgraph database.CypherTool
- Executes arbitrary Cypher queries on a Memgraph database.ShowConstraintInfoTool
- Shows constraint information from a Memgraph database.ShowConfigTool
- Shows configuration information from a Memgraph database.
Usage
Each tool is implemented as a Python class inheriting from BaseTool
. To use a
tool:
- Instantiate the tool with a
Memgraph
database connection. - 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_toolkit import MemgraphToolkit
# Connect to Memgraph
db = Memgraph(url="bolt://localhost:7687", username="", password="")
# Show available tools
toolbox = MemgraphToolkit(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)
Requirements
- Python 3.10+
- Running Memgraph instance
- Memgraph MAGE library (for certain tools like
pagerank
andrun_betweenness_centrality
)
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.