Code

cookbook/tools/neo4j_tools.py
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")

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your credentials

export NEO4J_URI=bolt://localhost:7687
export NEO4J_USERNAME=neo4j
export NEO4J_PASSWORD=your-password
export OPENAI_API_KEY=xxx
3

Install libraries

pip install -U neo4j openai agno
4

Run Agent

python cookbook/tools/neo4j_tools.py