










https://docs.trustgraph.ai/architecture/retrieval.html
https://zhuanlan.zhihu.com/p/2038967214095722008
https://www.cnblogs.com/JavaPub/p/22692593
https://docs.trustgraph.ai/architecture/retrieval.html
TrustGraph supports multiple retrieval strategies to provide context to LLM queries. The approach you choose has a significant impact on the quality and accuracy of responses.
A structured representation of facts about a domain - entities and the relationships between them. It captures what is known.
A knowledge graph enriched with the context surrounding that knowledge - where it came from (provenance) and how it has been interpreted and reasoned about (explainability). A context graph recognises that a fact in isolation is less valuable than a fact you can trace back to its source and whose role in previous reasoning you can examine. Crucially, because provenance and explainability are represented as graph data alongside the knowledge itself, they become subjects of further reasoning - you can ask questions not just about what you know, but about how you know it.
The distinction: a knowledge graph captures knowledge; a context graph captures knowledge in context.
This is where we started in 2023. GraphRAG is TrustGraph’s flagship retrieval mechanism. Rather than treating documents as opaque text blobs, GraphRAG extracts structured knowledge and stores it in a knowledge graph alongside vector embeddings of entities. TrustGraph engineers were working on GraphRAG before it was ‘cool’.
TrustGraph’s implementation goes well beyond basic GraphRAG. The retrieval pipeline incorporates LLM-driven concept extraction, relevance scoring, edge reasoning, document provenance tracing, and full explainability - making it a truly explainable GraphRAG system.
At a high level, document chunks are processed through knowledge extraction to produce both a knowledge graph and graph embeddings for semantic search.

The ingestion pipeline processes documents through several stages:

When a question is asked, the explainable GraphRAG retrieval pipeline works through the following stages:
Steps 7 and 8 run concurrently for efficiency.
This approach provides precise, relationship-aware context with full explainability and source attribution, rather than raw text snippets.

You have probably heard of GraphRAG before. Ontology RAG, much less likely. So, let’s cover the basics.
Ontologies are structured frameworks that formally define the concepts, relationships, and rules within a specific domain of knowledge. They provide a standardised vocabulary and logical structure for representing how entities relate to each other, enabling both humans and computers to share a consistent understanding of complex information. It’s like a database schema, but for human knowledge.
In knowledge engineering, ontologies have a bad reputation - they are complex, take years to create, and people often have massive disagreements about what ontologies are there to do. Biologists famously disagree about what constitutes a ‘cell’.
But this isn’t to say there’s ‘flaw’ - there’s nothing broken about ontology technology. The real issue is that human knowledge is a profoundly complex experience. When we try to classify human knowledge, we can’t eliminate the fundamental human experiences which come with trying to make sense of the world around us.
So, don’t give up too soon, bringing ontologies into information retrieval produces some awesome results.
Ontology RAG extends Graph RAG by incorporating domain ontologies to guide knowledge extraction. This approach is particularly valuable when working with specialised domains that have well-defined conceptual structures. For many use-cases, Ontology extraction results in much improved retrieval results.
Early attempts at using ontologies in knowledge extraction attempted to guide extraction by loading the full ontology into an LLM context window. Here be dragons: Good ontologies are big, and this can easily flood the context window. In a nutshell, the TrustGraph approach is to apply the GraphRAG algorithm itself to ontologies stored as graph - an information retrieval operation is used to work out the correct subset of ontology components to use for knowledge extraction.
The process begins by selecting relevant ontology components based on the document chunks being processed. This ontology subset then guides the knowledge extraction process, ensuring that extracted entities and relationships conform to the domain model. The result is a more consistent and semantically precise knowledge graph, with embeddings that align with the ontological structure.

Ontology RAG relies on having ontologies. For general purpose text, classifying everything in the world into ontologies would be a Herculean task, so you would stick with GraphRAG for this.
When this technique is widely adopted by all the AI frameworks, remember TrustGraph was pioneering this capability in 2025! 😀
Document RAG is the traditional approach that dominated early RAG implementations circa 2020. While conceptually simpler than GraphRAG, TrustGraph’s implementation enhances the basic approach with LLM-driven concept extraction for grounding and full explainability tracking, making it an explainable Document RAG system.
The ingestion pipeline for explainable Document RAG is straightforward: document chunks are embedded directly and stored in a vector database.

When a question is asked, the explainable Document RAG retrieval pipeline works through the following stages:
While explainable Document RAG now benefits from concept extraction and explainability, it still has inherent limitations compared to GraphRAG:
For most use cases, explainable GraphRAG or Ontology RAG will deliver substantially better results.
出处:http://www.cnblogs.com/lightsong/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。