Knowledge Graphs
Understanding when and why to build knowledge graphs from your documents.
Knowledge Graphs
This page explains what knowledge graphs do and when they're useful—not how to create or manage them.
What a knowledge graph contains
A knowledge graph extracts two types of information from your documents:
Entities are the "things" mentioned in text:
- People (John Smith, Dr. Martinez)
- Organizations (Acme Corp, Department of Defense)
- Locations (Washington DC, Building 7)
- Dates and events
- Concepts and topics
Relationships describe how entities connect:
- John Smith works at Acme Corp
- Acme Corp located in Washington DC
- Project Alpha started on January 2024
Together, entities and relationships form a network where you can trace paths, find clusters, and see connections.
When to build a graph
Graphs are useful when you need to understand how things relate across documents.
Good use cases:
- Investigating networks of people and organizations
- Tracing connections between events
- Understanding relationships in complex domains
- Finding non-obvious links between entities mentioned in different places
Graphs are less useful when:
- You just need to find specific text or keywords (use Search)
- You have a single document you want to summarize (use Agent)
- Documents don't contain named entities or relationships
What graphs enable that search doesn't
Search finds documents or text chunks that match a query. You get a list of relevant passages.
Graphs show how things connect. You can:
- Ask "How is Person A connected to Organization B?" and see the path
- Find which entities appear together frequently
- Discover connections you didn't know to search for
- Visualize the network structure of your documents
The Agent can query graphs to answer relationship questions that would be difficult with search alone.
Entity resolution
The same entity often appears in different forms:
- "John Smith"
- "J. Smith"
- "Dr. John R. Smith"
- "the CEO of Acme"
Entity resolution identifies when different mentions refer to the same real-world thing and merges them. This gives you a unified view instead of fragmented duplicates.
Resolution works well when:
- Names have clear overlap (J. Smith → John Smith)
- Entities appear in similar contexts
- Document quality is good
Resolution may miss connections when:
- Names are completely different (nicknames, aliases)
- Multiple people share the same name
- OCR errors distort the text
You can manually merge entities the system doesn't catch.
Properties and source attribution
Entities and relationships can have properties—key-value attributes extracted from text. A Person might have a title and nationality; a relationship might have a date and amount.
Every entity and relationship links back to its source: which documents mention it, which chunks contain the evidence, and on which pages. This provenance lets you verify extracted information and cite sources.
Graph schemas
When Moongraph extracts entities and relationships, it follows a schema that defines:
- Which entity types to look for
- What properties each type can have
- Which relationship types are valid
You can view the schema for any graph in the Schema tab. This helps you understand what the extraction is looking for.
User-defined schemas are on the roadmap. Currently, graphs use a default schema.
GraphRAG
When you ask the Agent a question with a graph available, retrieval can traverse the graph structure:
- Find entities related to your query
- Pull in connected entities and relationships
- Use graph context alongside document chunks
This helps with questions about relationships and connections that might span multiple documents.
Related
- Create a Knowledge Graph
- Merge Duplicate Entities
- Graphs Reference
- Cosmograph — Visualizing graphs