Metadata-Version: 2.4
Name: memgraph-toolbox
Version: 0.1.10
Summary: Memgraph toolbox library for Memgraph AI tools and utilities
Project-URL: Homepage, https://github.com/memgraph/ai-toolkit
Project-URL: Source, https://github.com/memgraph/ai-toolkit
Project-URL: Issues, https://github.com/memgraph/ai-toolkit/issues
Author-email: antejavor <ante.javor@memgraph.io>
License: MIT
License-File: LICENSE
Keywords: ai,graph,memgraph,toolkit
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: neo4j>=5.28.1
Requires-Dist: numpy>=2.2.6
Provides-Extra: client
Requires-Dist: litellm>=1.77.1; extra == 'client'
Requires-Dist: mcp>=1.14.1; extra == 'client'
Provides-Extra: evaluations
Requires-Dist: deepeval>=3.5.2; extra == 'evaluations'
Requires-Dist: sentence-transformers>=5.1.0; extra == 'evaluations'
Requires-Dist: torch>=2.8.0; extra == 'evaluations'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.26.0; extra == 'test'
Requires-Dist: pytest>=8.3.5; extra == 'test'
Description-Content-Type: text/markdown

# 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](https://memgraph.com/docs/fundamentals/triggers) information from a Memgraph database.
2. `ShowStorageInfoTool` - Shows storage information from a Memgraph database.
3. `ShowSchemaInfoTool` - Shows [schema](https://memgraph.com/docs/querying/schema) information from a Memgraph database.
4. `PageRankTool` - Calculates [PageRank](https://memgraph.com/docs/advanced-algorithms/available-algorithms/pagerank) on a graph in Memgraph.
5. `BetweennessCentralityTool` - Calculates [betweenness centrality](https://memgraph.com/docs/advanced-algorithms/available-algorithms/betweenness_centrality) for nodes in a graph.
6. `ShowIndexInfoTool` - Shows [index](https://memgraph.com/docs/fundamentals/indexes) information from a Memgraph database.
7. `CypherTool` - Executes arbitrary [Cypher queries](https://memgraph.com/docs/querying) on a Memgraph database.
8. `ShowConstraintInfoTool` - Shows [constraint](https://memgraph.com/docs/fundamentals/constraints) information from a Memgraph database.
9. `ShowConfigTool` - Shows [configuration](https://memgraph.com/docs/database-management/configuration) information from a Memgraph database.
10. `NodeVectorSearchTool` - Searches the most similar nodes using the Memgraph's [vector search](https://memgraph.com/docs/querying/vector-search).
11. `NodeNeighborhoodTool` - Searches for the data attached to a given node using Memgraph's [deep-path traversals](https://memgraph.com/docs/advanced-algorithms/deep-path-traversal).

## 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:

```python
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:

```bash
pip install memgraph-toolbox
```

### Optional dependencies

For the MCP prompt client (litellm + mcp):

```bash
pip install 'memgraph-toolbox[client]'
```

For evaluation metrics (deepeval, sentence-transformers, torch):

```bash
pip install 'memgraph-toolbox[evaluations]'
```

For running tests:

```bash
pip install 'memgraph-toolbox[test]'
```

For all optional dependencies (e.g., CI):

```bash
pip install 'memgraph-toolbox[client,evaluations,test]'
```

## Requirements

- Python 3.10+
- Running [Memgraph instance](https://memgraph.com/docs/getting-started)
- Memgraph [MAGE library](https://memgraph.com/docs/advanced-algorithms/install-mage) (for certain tools like `pagerank` and `run_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.
