Knowledge Graph
Knowledge Graph is an advanced feature of the Gendial platform's knowledge base. Unlike traditional RAG that relies solely on text chunk semantic matching, Knowledge Graph structures document information into entity–relationship–entity triple networks, enabling AI to understand logical connections between concepts and support complex scenarios such as summarization Q&A and multi-hop reasoning.
Why Knowledge Graph
Traditional RAG works by vectorizing user queries and searching for semantically similar text chunks in vector space, then feeding these chunks as context to large language models for answer generation. This approach works well for factual Q&A but has limitations in these scenarios:
- Summary Questions: e.g. "What core technologies does this document cover?" — such questions require aggregating information across multiple text chunks, which vector retrieval struggles to cover holistically
- Multi-Hop Reasoning: e.g. "Which team first applied technology A in which project?" — requires connecting multiple scattered facts
- Relationship Understanding: e.g. "What is the relationship between A and B?" — requires pre-established connections between concepts
Knowledge Graph addresses these scenarios by pre-structuring document content into a graph network. During retrieval, it returns not only matching text chunks but also related neighboring nodes, giving the LLM a more complete context.
How Knowledge Graphs Are Built
Gendial supports two knowledge graph construction modes:
Lexicon-Based Automatic Extraction
In this mode, the LLM reads document content directly, automatically identifying entities (concepts, people, organizations, technologies, etc.) and their relationships, outputting them as triples (head entity, relationship, tail entity). This approach requires no human intervention and is suitable for quickly exploring documents in unfamiliar domains.
During extraction, the LLM considers:
- Word Frequency and Co-occurrence: Frequently co-occurring terms are more likely to form relationships
- Semantic Roles: Identifying the semantic structure of subject, predicate, and object
- Contextual Disambiguation: Using context to distinguish meanings of the same term in different contexts
Expert-Defined Domain Knowledge Graph
For specialized domains, automatic entity and relationship extraction may lack precision or miss industry-specific key concepts. The platform allows domain experts to pre-define:
- Entity Types: e.g. in the medical domain, defining entity categories such as "disease", "drug", "symptom", "test indicator"
- Relationship Types: e.g. "drug–treats–disease", "symptom–indicates–disease", "test–finds–indicator abnormality"
After defining the data model, the LLM performs triple extraction within the expert-defined framework. This is like equipping the AI with a pair of "domain glasses", allowing it to understand documents from an expert's perspective, significantly improving extraction accuracy and professionalism.
Synonym Table
The synonym table standardizes terminology. In practice, the same concept may appear in multiple forms, such as "machine learning", "ML", and "Machine Learning". By pre-setting a synonym table, the LLM is instructed to use the standard term when extracting these variants, avoiding duplicate nodes in the graph.
Stop Words Table
The stop words table filters out terms that should not appear as entities. For example, in technical documentation, generic words like "system", "function", or "module" appear frequently but have limited value as standalone nodes. Adding them to the stop words table instructs the LLM to ignore them during extraction.
Editing and Maintaining the Knowledge Graph
LLM-generated knowledge graphs typically require human review and optimization, following a "AI generation + human refinement" collaborative process.
Node Editing
- Modify Properties: Adjust entity names, types, and significance weights
- Delete Redundant Nodes: Remove meaningless or erroneous entities
- Merge Nodes: Combine essentially identical nodes into one to keep the graph concise
Relationship Editing
- Modify Relationship Labels: Correct inaccurate relationship descriptions
- Delete Erroneous Relationships: Remove misjudged associations by AI
- Add Missing Relationships: Supplement important connections based on expert knowledge
Undo and Redo
Undo and redo are supported during editing, allowing experimentation with different organizational approaches.
Visualization Views
Knowledge Graph supports multiple visualization layouts for different analytical perspectives:
- Force-Directed Graph: Nodes naturally cluster based on association strength, ideal for global overviews. Dense regions are immediately visible, helping identify core knowledge clusters.
- Mind Map: Expands rightward from a selected root node, suitable for deep exploration along a concept and viewing all direct and indirect associations.
- Dendrogram: Displays hierarchical structures from top to bottom, suitable for presenting classification systems and subordination relationships.
Additionally, significance filtering can hide secondary nodes to focus on core knowledge.
Attaching to Agents as RAG Knowledge Base
Once created, a knowledge graph can be attached to an agent as an enhanced data source for RAG retrieval. When a user asks the agent a question:
- The system performs both vector retrieval and knowledge graph retrieval simultaneously
- Graph results include not only matching nodes but also their neighboring connected nodes
- The LLM receives not isolated text chunks, but knowledge fragments with relationship networks
This mechanism is particularly suitable for questions like "summarize the key points" or "what is the relationship between [Entity A] and [Entity B]"—questions requiring cross-paragraph comprehensive judgment. In multi-hop reasoning scenarios, knowledge graphs can significantly reduce LLM "hallucinations".
Shared Knowledge Graph
Knowledge graphs can be shared externally via read-only links. Shared graphs retain the current layout state and visibility scope, allowing external users to browse without logging into the platform.
Typical use cases for shared knowledge graphs include:
- Sharing a domain's knowledge structure with teams or clients
- Serving as teaching material to visualize complex concept systems
- Embedding in external pages for interactive knowledge browsing
Notes
- Knowledge graph extraction quality is highly dependent on source document structure. Logically clear, well-organized documents typically yield better results.
- For specialized domains, expert-defined data models are strongly recommended to significantly improve extraction quality and reduce post-extraction editing.
- Graph editing directly affects knowledge base data. When merging nodes or deleting relationships, confirm that the operation does not cause information loss.