Code
cookbook/tools/neo4j_tools.py
Usage
1
Create a virtual environment
Open the
Terminal and create a python virtual environment.2
Set your credentials
3
Install libraries
4
Run Agent
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Neo4jTools enables agents to interact with Neo4j graph databases for querying and managing graph data.
from agno.agent import Agent
from agno.tools.neo4j import Neo4jTools
agent = Agent(
instructions=[
"You are a graph database assistant that helps with Neo4j operations",
"Execute Cypher queries to analyze graph data and relationships",
"Provide insights about graph structure and patterns",
],
tools=[Neo4jTools()],
markdown=True,
)
agent.print_response("Show me the schema of the graph database and list all node labels")
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
python3 -m venv .venv
.venv/scripts/activate
Set your credentials
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USERNAME=neo4j
export NEO4J_PASSWORD=your-password
export OPENAI_API_KEY=xxx
Install libraries
pip install -U neo4j openai agno
Run Agent
python cookbook/tools/neo4j_tools.py
python cookbook/tools/neo4j_tools.py