Knowledge Graph Integration
Learn how FoundationaLLM builds and uses knowledge graphs, and how to configure them in the Management Portal.
Overview
A FoundationaLLM knowledge graph is built by a data pipeline from your documents. Pipeline stages use a completion model to extract entities and relationships from text, consolidate and summarize them, embed them, and store them alongside the knowledge unit. Agents and the Knowledge Explorer can then query the graph together with the regular vector index.
FoundationaLLM does not connect to external graph databases (such as Neo4j or Gremlin endpoints). There is no "knowledge graph" data source type; the graph is produced from content read through a regular data source, such as Azure Data Lake or SharePoint Online.
How the Pieces Fit Together
| Resource | Role in the knowledge graph |
|---|---|
| Data source | Where the source documents come from. |
| Data pipeline | Extracts text, partitions it, and runs the knowledge graph stages. |
| Knowledge unit | Has Has Knowledge Graph enabled and a Knowledge Graph Vector Database that stores the graph embeddings. |
| Knowledge source | Groups knowledge units so they can be queried together. |
Step 1: Configure the Knowledge Unit
- In the sidebar, select Data > Knowledge Units, then create or edit a knowledge unit.
- Select the Vector Database for the text chunks.
- Turn on Has Knowledge Graph.
- Select the Knowledge Graph Vector Database used to store knowledge graph embeddings.
- Save the knowledge unit.
Step 2: Add Knowledge Graph Stages to a Pipeline
The standard FoundationaLLM data pipeline plugin package (.NET) provides these stage plugins. Select them in the Plugin dropdown of a stage on the pipeline canvas.
| Stage plugin | Parameters |
|---|---|
| Knowledge Extraction Data Pipeline Stage (FoundationaLLM) | PromptObjectId (a prompt in the DataPipeline category), CompletionModel, EntityTypes (comma-separated, for example PERSON, ORGANIZATION, LOCATION), ModelTemperature, MaxOutputTokenCount |
| Knowledge Graph Consolidation Data Pipeline Stage (FoundationaLLM) | None |
| Knowledge Graph Summarization Data Pipeline Stage (FoundationaLLM) | PromptObjectId, CompletionModel, CompletionModelTemperature, CompletionMaxOutputTokenCount |
| Knowledge Graph Embedding Data Pipeline Stage (FoundationaLLM) | KnowledgeUnitObjectId |
| Knowledge Graph Indexing Data Pipeline Stage (FoundationaLLM) | KnowledgeUnitObjectId |
| Knowledge Graph Publishing Data Pipeline Stage (FoundationaLLM) | KnowledgeUnitObjectId |
The knowledge extraction stage works on the text partitions produced by a Text Partitioning Data Pipeline Stage, so place it after partitioning on the canvas. Use the same knowledge unit for the embedding, indexing, and publishing stages.
For the full plugin reference, see Data Pipeline Plugins.
Step 3: Explore the Graph
- In the sidebar, select Data > Knowledge Explorer.
- Select a knowledge source and then a knowledge unit that has a knowledge graph.
- Select the Render knowledge graph button to draw the full graph, or run a query with Knowledge graph query enabled and select Render query result to draw only the entities and relationships in the result.
See Knowledge Explorer.
Troubleshooting
- The knowledge graph options are disabled in Knowledge Explorer: The selected knowledge unit doesn't have Has Knowledge Graph enabled.
- Knowledge extraction fails: Check that the prompt, completion model, and entity types parameters are set on the stage or trigger, and that the stage runs after text partitioning.
- No graph results: Open Data > Data Pipeline Runs and use Analyze run to check each knowledge graph stage for failures.