top of page

LBSocial

Neo4j Agent: Build a Free No-Code GraphRAG

If you’ve been following our data science series, you know we previously built a social media knowledge graph populated with Twitter data and generated embeddings using Google Gemini. But what if you could completely automate that data retrieval process?


Neo4j Agent: Build a Free No-Code GraphRAG

In this tutorial, we are handing the workflow over to AI. We will build a fully functional, free AI Agent on Neo4j that intelligently decides how to search, filter, and retrieve data without requiring a single line of Python code.


Why You Need a Neo4j Agent for GraphRAG


Previously, extracting insights from our graph database required manual intervention. If you wanted to run a vector search, filter by a specific location, or use Cypher to build a Generative AI dashboard, you had to manually trigger the correct, isolated tool.


Our new AI Agent solves this. By providing plain English instructions, the agent autonomously decides when to use semantic search, when to write Cypher queries, and how to navigate the graph to give you the most accurate answers.


Interface displaying text details of agent tools and actions, featuring "Text2Cypher," "Tweets by User," and JSON code.
Neo4j AI agent's thinking process demonstrating automated tool selection

Building Your Neo4j Agent Code-Free


Setting up the agent is completely free within the Neo4j instance. You simply point the agent to your database and select your embedding model (for this project, we are using gemini-embeddings-001).


Neo4j AI interface for agent creation with fields for instance, embedding provider, model, and prompt. Buttons: Cancel, Create.
Neo4j 'Create with AI' dialog box showing instance selection, embedding provider, and model settings for agent creation

Step 1: Using Chrome Gemini to Write Prompts


One of the best shortcuts for building this agent is using the Chrome Gemini side panel. Instead of writing the agent's system instructions from scratch, we can leverage AI to analyze our database structure.


By opening Gemini in Chrome alongside your database schema, you can ask it to draft the perfect prompt. For this tutorial, we instructed Gemini:


 "I need to build an AI agent on Neo4j. I want the agent to query tweets based on user text, hashtags, and locations. Help me draft a prompt."

Gemini instantly reads the page context and generates precise instructions and tool suggestions (such as Semantic Search, Topic Queries, and Geospatial Queries) that your Neo4j agent requires.


GraphRAG tutorial in a notebook with Neo4j graph schema diagram: User, Tweet, Hashtag, Place. Text on AI agent tasks for social media data.
Using Chrome Gemini side panel to generate system prompts for a Neo4j GraphRAG agent


Step 2: Testing the Agent's Capabilities


Once the agent is published, it’s time to put it to the test. Let's look at how it handles complex reasoning:


  • Semantic Search: When asked, "What are people generally saying about graph databases?", the agent automatically routes the query to the semantic search tool, retrieves relevant tweets, and uses a large language model to summarize the findings.


  • Geospatial Filtering: We asked, "What topics are trending among users located in San Francisco?" The agent seamlessly applied a location filter before retrieving the connected topics.


  • Multi-Step Reasoning: In our final test, we searched for the most popular tweets using the hashtag "ai". When the exact lowercase hashtag returned no results, the agent autonomously pivoted, performed a semantic search for "artificial intelligence", discovered the capitalized "#AI" hashtag, and successfully retrieved the associated users and their recent tweets. All in just 28 seconds!


Dashboard showing popular AI tweets highlighting Pandas, NumPy, and graph databases. Users Eve_Sec, Charlie_AI, Alice_Data featured.
Neo4j agent retrieving and summarizing tweets about artificial intelligence using multi-step reasoning

Conclusion & Neo4j Agent Pricing Plans


That is how you build a fully functional GraphRAG agent in Neo4j without writing any code. By defining these tools and instructions, the AI now intelligently handles the entire workflow.


Before you start building, it is important to understand how the pricing structure works for these new AI agents:


  • Free Tier (Internal Use): Building, testing, and querying the agent directly within the Neo4j website interface is 100% free.


  • Paid Tier (External Deployment): If you want to deploy your agent to the outside world—such as turning it into an API service or an MCP (Model Context Protocol) server for your own applications—you will need to pay for that specific usage.

Comments


bottom of page