Skip to main content
Enable Agno agents to use natural language queries to perform “Multi-hop Reasoning” by interacting with Neo4j database. Agents can find connections that are three or four levels deep, such as finding the supplier of a component used in a product bought by a customer who also complained about a specific shipping delay.

Prerequisites

(Click to view details)
Choose one of the options to set up Neo4j locally:
  1. Install required packages:
  2. Set environment variables (create a .env file in your project root:

Usage

  1. Ensure Neo4j is running (check http://localhost:7474)
  2. Run this script to create an agent that can interact with your Neo4j database
  3. Test with queries like “What are the node labels in my graph?” or “Show me the database schema”

Troubleshooting

  • Connection refused: Make sure Neo4j is running on the correct port (7687)
  • Authentication failed: Verify your username/password in the Neo4j browser first
  • Import errors: Install the neo4j driver with uv pip install neo4j
For details, see Neo4j cookbook.