MoongraphMoongraph

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

  1. Navigate to Agent in the sidebar
  2. Ask a question that involves entities or connections
  3. The Agent automatically uses graph tools when appropriate
  4. Review entity and relationship information in the response

When to use graph queries

Graph-aware queries work well for:

Question typeExample
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

ToolPurpose
list_graphsDiscover available knowledge graphs
graph_overviewGet graph structure — entity types, top entities, stats
entity_searchSearch entities by name, type, or properties
get_entity_sourcesGet source documents for specific entities
knowledge_graph_queryQuery 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?"

The Agent can combine graph queries with document retrieval:

"Who is the CEO of Acme Corp, and what documents mention their role?"

This uses:

  1. entity_search to find the CEO entity
  2. get_entity_sources or retrieve_chunks to 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

On this page