The Role of the Graph Database in Agent Architecture

Introduction

In this lesson, you will learn how data stored in AuraDB is used to ground an agent’s responses, and how tools retrieve that data.

Grounding agent responses with AuraDB

An Aura Agent grounds its responses by querying data stored in your AuraDB instance. Instead of relying solely on what the LLM knows, the agent retrieves relevant facts from the graph and uses them as context when generating an answer.

The graph stores:

  • Structured, connected data — nodes and relationships that tools can query with Cypher or GraphRAG

  • Facts and domain state — the specific data about your business or domain that makes answers accurate and relevant

How Neo4j Supports Agent Workflows

Neo4j fits agent architectures because it handles both structured queries and semantic retrieval:

  • Cypher tools let agents run precise, relationship-aware queries. For example, "find all customers who ordered from this supplier" traverses PLACED and SUPPLIED_BY relationships directly.

  • GraphRAG summarizes communities and subgraphs, giving the LLM richer context for complex questions like "what are the main product themes for this category?"

  • Hybrid retrieval combines vector similarity (finding products semantically similar to "spicy condiments") with graph traversal (then following relationships to suppliers and orders).

Your application can store facts or context in the graph and query them via tools; Aura Agent does not persist conversation history.

Cypher Tool Query

Agents invoke Cypher tools to retrieve context. Example pattern:

// Retrieve context for an agent (adapt to your schema)
MATCH (m:Movie)<-[:ACTED_IN]-(a:Person)
RETURN m.title, collect(a.name)[0..3] AS actors
LIMIT 5

For Northwind, a "Get Customer" tool might run: MATCH (c:Customer {customerID: $id}) RETURN c.companyName, c.contactName, …​

Check Your Understanding

Graph in Agent Architecture

How does an AuraDB instance contribute to an agent’s responses?

  • ❏ It stores conversation history between sessions

  • ✓ It stores the data that tools query to ground the LLM’s response

  • ❏ It runs the LLM inference

  • ❏ It only stores vector embeddings

Hint

The agent retrieves data from AuraDB using tools like Cypher Template and Similarity Search. That data is then used as context when the LLM generates its answer.

Solution

It stores the data that tools query to ground the LLM’s response.

The agent queries your AuraDB instance using Cypher, GraphRAG, or vector search to retrieve relevant facts. Those results ground the LLM’s answer — making it specific to your data rather than relying on what the LLM was trained on.

Summary

In this lesson, you learned how data stored in AuraDB grounds an agent’s responses and how tools retrieve that data.

Chatbot

How can I help you today?