- which supplier provides a particular pump-station component;
- which policy applies to a product, region, or project;
- how a failure, device, procedure, and corrective action are connected;
- which organizations, contracts, and deliverables appear together across project documents.
The knowledge graph does not replace source retrieval. Entities and
relationships help locate relevant evidence; final answers should still use
the original chunks and citations.
Capabilities at a glance
How the graph is built
The graph contains four main forms of information:- Entity: a named object such as a company, device, policy, project, place, product, or procedure. It can include a type, aliases, description, confidence, and mention count.
- Relationship: a typed and directed connection between two entities, such as
SUPPLIES,APPLIES_TO,PART_OF, orREQUIRES. - Evidence mention: a source reference containing
documentId,chunkId, an optional quote, and confidence. Evidence makes a graph result traceable to the document that produced it. - Entity vector: a semantic representation of the entity name, type, aliases, and description or summary. It is used to find seed entities from natural-language questions.
Origin and visibility
Every entity and relationship has an origin and visibility:
Hiding an entity also hides its incident relationships. A relationship cannot be reactivated while either endpoint entity remains hidden.
Requirements
Before enabling GraphRAG, make sure that:- The knowledge base uses locally managed documents rather than an external provider that does not expose graph capabilities.
- Documents have completed parsing and contain non-empty text chunks.
- The knowledge base has a valid embedding model; graph entities use a separate entity-vector collection based on that model.
- A knowledge-base Chat Model is configured for structured graph extraction, or a Primary Copilot with an available chat model can be used as the fallback.
- Background workers can process knowledge-graph index jobs.
Enable and build GraphRAG
- Open the knowledge base and go to Configuration > Retrieval Settings.
- Turn on GraphRAG.
- Choose the default retrieval mode and configure Entity Top K, Neighbor Hops, and Graph Weight.
- Select a suitable Chat Model for extraction, then save the knowledge-base configuration.
- After GraphRAG is enabled for the first time, the status becomes Rebuild required. Click Rebuild Graph.
- Wait until every graph job completes and the status becomes Ready.
- Open Graph to inspect entities, relationships, and evidence before using the graph in production retrieval.
Retrieval settings
Increasing Entity Top K and Neighbor Hops expands the candidate graph. Tune them together with final TopK to keep latency and context size predictable.
Graph status and jobs
The status response includes the graph revision, entity/relation/mention counts, queued/running/failed job counts, and recent jobs. Document management also shows graph-index progress for individual documents.
Incremental updates and rebuilds
- Newly processed documents enqueue document-level graph jobs when GraphRAG is enabled.
- Reprocessing or removing a document clears its old mentions, refreshes relation evidence counts, and prunes automatically extracted orphan entities.
- A full rebuild increments the graph revision, clears extracted active graph data, and re-extracts all non-folder documents.
- Manually created and user-curated items are preserved across rebuilds. Their old extracted evidence is cleared and recalculated from current documents.
- Entity vectors are refreshed after graph changes. Rebuilding the graph does not regenerate document chunk embeddings.
Use the graph workspace
Open the Graph tab of a graph-enabled knowledge base. The workspace supports:- search by entity name or type;
- filters for entity type, relationship type, origin, and visibility;
- a focus entity, zero-to-two-hop depth, and result limit;
- zoom, fit-to-screen, reset layout, and center-selection controls;
- entity and relation counts, type legend, entity list, and relation list;
- an inspector showing descriptions, aliases, endpoints, related relationships, and source evidence;
- creation and editing of entities and relationships;
- hiding incorrect or retired graph items without physically deleting their governance record.
Curate entities and relationships
Use manual curation to correct critical business semantics that should not depend entirely on model extraction:- add a missing entity with its name, type, aliases, and description;
- rename or reclassify an extracted entity;
- add or change a directed relationship and its weight;
- hide an incorrect entity or relationship;
- inspect the evidence before deciding whether an extracted connection is valid.
curated, so later rebuilds do not silently discard the human decision.
Retrieval modes
Vector
Vector mode searches document-chunk embeddings directly. It is the recommended mode for broad semantic Q&A, structured Knowledge Filters, and precise file or metadata boundaries. GraphRAG may still be enabled for visualization and Agent graph exploration while final retrieval remains Vector.Graph
Graph mode performs these steps:- Semantically search the entity-vector index for seed entities.
- Keep active entities and expand their active relationships by the configured Neighbor Hops.
- Resolve entity and relationship mentions back to document chunks.
- Calculate graph relevance using entity similarity and evidence confidence.
- Return the highest-ranked source chunks with matched entity and relationship metadata.
Hybrid
Hybrid mode runs Vector and Graph retrieval, deduplicates results by chunk, and combines the two scores using Graph Weight. If a rerank model is configured, it reranks the merged candidates before final TopK selection. Use Hybrid when both semantic wording and entity relationships matter. Start with the default Graph Weight of0.35, then compare representative questions in Recall Test.
Let an Agent explore the graph
When a knowledge-base node is connected to an Agent and GraphRAG is enabled, XpertAI registers a read-only graph explorer alongside the Retriever. It uses a compact action-based interface:
The intended loop is:
- use filter options to discover current folders, file types, years, statuses, and metadata values;
- use graph exploration to discover entities, aliases, relationships, and evidence from document content;
- combine the discoveries in the final Vector Retriever query and dynamic filter.
Boundary enforcement
Agent graph exploration applies tenant, organization, knowledge-base, enabled-content, and administrator fixed-filter boundaries before returning evidence. An entity or relationship is returned only when it has eligible chunk evidence inside that scope. When a fixed filter is active, global entity descriptions, summaries, aliases, and aggregate counts are not exposed because they may have been aggregated from documents outside the binding. Missing fixed variables fail closed before graph exploration starts. Graph quotes are exploration clues; the Agent is instructed to use the Retriever for final chunks and citations.Test GraphRAG
Use Recall Test to switch between Vector, Graph, and Hybrid for the same question. A useful test set includes:- direct entity questions, such as “What is GOODSPRINGS?”;
- relationship questions, such as “Which supplier provides the pump-station equipment?”;
- multi-hop questions that require two related concepts;
- negative cases whose entities are absent from the source documents;
- documents with similar keywords but different relationships;
- questions that compare Vector, Graph, and Hybrid ranking.
Security and governance
- Knowledge-base permissions and tenant/organization boundaries continue to apply.
- Only active entities and relationships participate in normal GraphRAG retrieval.
- Evidence keeps the connection from graph claims to source documents and chunks.
- Hiding retains a curated governance record and prevents the item from being silently reintroduced as an active extracted item during rebuild.
- Agent graph exploration never exposes the administrator’s fixed-filter expression.
- Normal end-user answers show source citations, not internal graph decisions, by default.
Limitations and best practices
- Graph extraction is probabilistic. Review high-impact entities and relationships before using them in pricing, compliance, safety, or contractual decisions.
- Improve parsing quality before tuning graph parameters. Empty or malformed chunks cannot produce reliable entities or evidence.
- Use stable, specific entity types and relationship names. Merge spelling variants through aliases instead of creating duplicate nodes.
- Keep Neighbor Hops at one unless a representative test set shows that two-hop exploration adds useful evidence.
- Use manual or curated graph items for durable business semantics, but keep document evidence as the final answer source.
- Rebuild after enabling GraphRAG, after major extraction-model changes, or when source coverage is inconsistent.
- Monitor failed jobs, zero-result graph queries, entity duplication, weak evidence quotes, and Hybrid latency.
- Use Vector mode when structured Knowledge Filters are required; use the Agent graph explorer as a boundary-aware planning step.