Connected knowledge
Knowledge Graphs
A knowledge graph stores entities and the typed relationships between them, so questions about how things connect become queries instead of guesses.
Modeling the graph
- Entity modeling
- Decide which things get their own node (a product, an API, a document, a concept) and which are just attributes. Each entity needs a stable identifier.
- Relationship modeling
- Relationships are typed and directed (REQUIRES, COVERS, BELONGS_TO). The type carries meaning that a plain hyperlink does not.
- Semantic querying
- Ask structured questions such as “all prerequisites of this topic, at any depth” using a graph query language.
- Graph-based retrieval
- Use the graph to expand or filter what vector search finds, for example pulling in prerequisite topics along REQUIRES edges.
- GraphRAG
- Retrieval-augmented generation that includes graph context. Seed chunks come from search; related nodes come from traversal; both feed the prompt.
The same question in SPARQL and Cypher
# Which topics must a reader complete before "Configure SSO"?
# SPARQL (RDF): "+" follows one or more REQUIRES edges
PREFIX kl: <https://example.org/kl#>
SELECT ?prereq ?title WHERE {
kl:ConfigureSSO kl:requires+ ?prereq .
?prereq kl:title ?title .
}
// Cypher (property graph): variable-length path
MATCH (:Topic {id: 'configure-sso'})-[:REQUIRES*1..]->(p:Topic)
RETURN p.titleIdentifiers are illustrative. A flat vector index cannot answer this question at all, because the answer depends on relationships rather than similarity.
Two common graph models
Neither is universally better. The choice follows your standards needs and your query patterns.
| RDF triple store | Property graph database | |
|---|---|---|
| Data model | Subject–predicate–object triples with IRIs | Nodes and edges, each with key–value properties |
| Query language | SPARQL | Cypher or GQL |
| Strengths | W3C standards, merging data across sources, OWL inference, SHACL validation | Natural traversal queries and properties directly on relationships |
| Typical fit | Shared vocabularies, interoperability, governed models | Application-facing traversal, path queries, recommendations |
How graph-expanded retrieval works
- 01
Find seeds
Vector and keyword search return the most relevant chunks for the question.
- 02
Map to nodes
Each chunk is linked to the topic and entity nodes it came from.
- 03
Expand along edges
Traverse selected relationship types (such as REQUIRES) to a bounded depth.
- 04
Rerank and trim
Score the expanded set against the question and fit it to the token budget.
- 05
Generate with citations
The model answers from the assembled context and cites the source documents.
When it earns its cost
Reach for it when
- Questions depend on prerequisites, dependencies, or coverage
- The same concept appears across many documents and must be disambiguated
- You need to find content gaps by asking what is not covered
Hold off when
- Most questions are single-fact lookups that vector search plus metadata already answers
- You cannot keep the graph in sync with the content
- You have not measured a flat baseline to compare against