Introduction
You will enhance your agent by adding a custom document retrieval tool that combines semantic search and vectors with graph traversal.
The agent decides automatically which tool is best for each question:
Schema Tool:
-
Understanding database structure
-
"What entities exist in the graph?"
-
"How are companies related to risk factors?"
Document Retrieval Tool:
-
Finding content with company context
-
"What are Microsoft’s main risk factors?"
-
"Tell me about cybersecurity threats mentioned by tech companies"
Open the notebook: 02_02_vector_graph_agent.ipynb
Add the Vector + Cypher Retriever as a second tool:
-
Keep existing schema tool (from previous lesson)
-
Add new document retrieval tool (vector search with graph context)
-
Let agent choose between tools based on question
Now your agent can handle both simple semantic search AND contextual relationship queries.
Try These Questions
Try these questions to see tool selection:
Semantic Search (Vector Tool):
Contextual Search (Vector + Cypher Tool):
Notice: The agent chooses the right tool automatically based on whether relationships are needed!
Summary
In this lesson, you enhanced your agent by adding the Vector + Cypher Retriever as a second tool:
Key Concepts:
-
Tool selection: Agent chooses between semantic and contextual search
-
Multi-tool agent: Two retrievers wrapped as conversational tools
-
Intelligent routing: Questions automatically matched to appropriate tool
What You Built:
-
Agent with two retriever tools
-
Automatic tool selection based on question type
-
Enhanced capability for both simple and contextual queries
Progress:
-
✅ Vector Retriever tool (semantic search)
-
✅ Vector + Cypher Retriever tool (contextual search)
-
⏳ Text2Cypher Retriever tool (coming next!)
In the next lesson, you will add the final tool: Text2Cypher Retriever for precise database queries.