Use Graph-Aware Queries
Query knowledge graphs through the Agent for connection-based answers.
Use Graph-Aware Queries
If you have knowledge graphs, the Agent can query them to answer questions about entities, relationships, and connections.
Prerequisites
- One or more knowledge graphs created from your documents
- Graphs should be in Completed status
Steps
- Navigate to Agent in the sidebar
- Ask a question that involves entities or connections
- The Agent automatically uses graph tools when appropriate
- Review entity and relationship information in the response
When to use graph queries
Graph-aware queries work well for:
| Question type | Example |
|---|---|
| Entity lookup | "Who is John Smith mentioned in my documents?" |
| Connections | "How are Acme Corp and Beta Inc connected?" |
| Relationships | "What organizations is Jane Doe associated with?" |
| Network analysis | "Who are the most connected people in these documents?" |
| Path finding | "What's the relationship path between Entity A and Entity B?" |
Directing graph use
Tell the Agent explicitly to use graph tools:
- "Use the knowledge graph to show how X and Y are connected"
- "Search the graph for all organizations mentioned"
- "What entities are related to Project Alpha?"
- "Query the graph for paths between Company A and Person B"
Graph tools the Agent uses
| Tool | Purpose |
|---|---|
| list_graphs | Discover available knowledge graphs |
| graph_overview | Get graph structure — entity types, top entities, stats |
| entity_search | Search entities by name, type, or properties |
| get_entity_sources | Get source documents for specific entities |
| knowledge_graph_query | Query for paths and subgraphs between entities |
Example queries
Find entity details:
"What do my documents say about John Smith? Use the knowledge graph."
Explore connections:
"Show me how the Federal Reserve and Treasury Department are connected in my documents."
List entities by type:
"What organizations appear in my knowledge graph?"
Find relationship paths:
"What's the connection path between Project Alpha and Acme Corporation?"
Combining graph and document search
The Agent can combine graph queries with document retrieval:
"Who is the CEO of Acme Corp, and what documents mention their role?"
This uses:
entity_searchto find the CEO entityget_entity_sourcesorretrieve_chunksto find supporting documents
Tips
- Reference specific entity names from your graph for precise results
- Ask about connections and relationships, not just facts
- Use graph_overview first if you're unsure what's in your graph