Two Modes of Entity Extraction
When you enable Knowledge Graph Extraction on a data source, you choose between two modes. Each uses a different pipeline architecture, entity discovery approach, and cost profile.When to Use Graph RAG
Graph RAG is most valuable when your knowledge base contains documents where entity relationships matter for answering questions:
When NOT to use Graph RAG:
- Simple Q&A over a single document
- Keyword-driven search (e.g., “find the latest sales report”)
Getting Started
Step 1: Create a Data Source and Enable Knowledge Graph Extraction
- Navigate to Data Sources in your project
- Click Create Data Source
- Configure your connector (SharePoint, OneDrive, Google Drive, etc.)
- In the Ingestion Settings section, toggle “Enable Knowledge Graph Extraction” to ON
- You’ll see two options:
- Generic Entity Extraction — the LLM freely discovers entities from your content
- Industry-Specific Entity Extraction — you define which entity types to extract via an industry preset or custom ontology
Step 2a: Generic Entity Extraction (simple path)
If you choose Generic Entity Extraction:- No additional configuration needed — just proceed with data source creation
- During ingestion, the system will run an LLM on each chunk to extract entities of any type (people, organizations, locations, concepts, etc.)
- Extracted entities are stored as graph nodes with relationships automatically
- Files will show status
Processedwhen complete (same as standard RAG)
- Zero configuration — just toggle on and ingest
- Broad entity coverage — catches entities you might not have anticipated
- Simpler pipeline — everything runs in one service
- Less precise — may extract irrelevant entities that add noise to the graph
- No control over entity types — you can’t tell it “only extract regulations and products”
- No descriptions to guide extraction quality
Step 2b: Industry-Specific Entity Extraction (production path)
If you choose Industry-Specific Entity Extraction:- Select an industry preset or create a custom one
- Customize entity types (add, remove, add descriptions)
- Complete data source setup and start ingestion
You can also create a custom industry by clicking “Add Custom” and describing your domain. The system will suggest relevant entity types based on your description.
How it works under the hood:
- Ingestion Service parses and chunks the document, then stops — file status changes to
Parsed - Indexing Service picks up the parsed file, runs entity extraction using your configured entity types, creates embeddings, and stores everything — file status changes to
Indexing, thenIndexed
Step 3: Customize Entity Types (Industry-Specific only)
After selecting a preset, you can customize the entity types:- Add entities: Type an entity name and press Enter (up to 15 entities per ontology)
- Remove entities: Click the X on any entity tag
- Add descriptions: Click the pencil icon on an entity to add a description that guides the extraction LLM
- Edit after creation: Use the Edit Data Source flow to modify entities on an existing graph
- Use specific, domain-relevant entity types (e.g., “drug_interaction” is better than “relationship”)
- Add descriptions to guide the LLM — e.g., for “obligation”: “A contractual duty or requirement that one party must fulfill”
- Entity names are automatically normalized: lowercased, spaces replaced with underscores
File Status Lifecycle
File statuses differ depending on which extraction mode you use.Generic Entity Extraction — Status Flow
Processed.
Industry-Specific Entity Extraction — Status Flow
How to Monitor File Status
- Open your data source
- Navigate to the Files tab
- Each file shows its current status with a color indicator
- Counters at the top show aggregate counts: total files, indexing files, indexed files
- Files in
Parsedstatus are waiting for the indexing service — this is expected, not an error - Files in
IndexingFailedshould be investigated — common causes are LLM quota exhaustion or misconfigured entity types
Data Source-Level Status (Industry-Specific only)
AI Cost and Token Consumption
Both extraction modes introduce additional AI cost compared to standard RAG. The cost profile differs between modes.Cost Comparison
Entity extraction is the primary cost driver in both modes. For each chunk, the LLM is called once to extract entities. Cost scales linearly with chunk count.
Cost Estimation
- 200 chunks x ~500 input tokens = ~100,000 tokens
- At GPT-4 pricing: approximately 1.00 per file
How to Track Costs
Token Consumption Feed
All AI costs from entity extraction are tracked in Settings > Token Consumption:- Embedding calls — from ingestion (generic) or indexing service (industry-specific)
- Entity extraction calls — the new cost, labeled with the LLM model used
- Reranker calls — at retrieval time, if reranking is enabled
Ingestion Time vs. Indexing Time
- Generic extraction: Total processing time = ingestion time (includes entity extraction). Visible in file details as a single duration.
- Industry-specific extraction: Total time = ingestion time + indexing time. Ingestion time covers parse/chunk. Indexing time covers entity extraction + embedding. Indexing is typically 2–5x longer than standard embedding due to LLM calls.
Retrieval Cost
Graph traversal at query time does not incur additional AI cost — it’s a database query against Apache AGE. The only retrieval-time AI costs are the same as standard RAG: embedding the query + reranking results (if enabled).Cost Optimization Tips
During Retrieval
Regardless of which extraction mode you use, retrieval works the same way:- Vector search finds semantically similar chunks (standard RAG)
- Entity-based retrieval identifies entities in the query and traverses the knowledge graph to find related entities and their source chunks
- Results from both paths are combined and reranked for the final response
- The LLM receives both vector-matched chunks and graph-traversed context
Managing Your Knowledge Graph
Viewing the Graph
After processing completes (files reachProcessed or Indexed status), you can inspect the knowledge graph:
- Go to your Data Sources list
- Find your graph-enabled data source and click the three-dot menu (…)
- Select View Graph
- You’ll see:
- Node count by entity type
- Relationship count by relationship type
- Graph query capability using Cypher syntax
⚠️ Warning: The ability to view the graph is not supported for data sources with Original Source Permissions enabled. This ensures that entities and chunks of data are not accessed by users without the necessary permissions. For more details, see Original Source Permissions.
Querying the Graph (Advanced)
The graph supports Cypher queries for advanced exploration: Common queries:MATCH (n) RETURN n LIMIT 50— Browse all nodesMATCH (n:person) RETURN n— Find all entities of a specific typeMATCH ()-[r]->() RETURN r LIMIT 50— Browse all relationshipsMATCH (n {name: 'GDPR'})-[r]->(m) RETURN m— Find everything connected to a specific entity
Editing Entity Configuration (Industry-Specific only)
To modify which entities are extracted for an existing data source:- Open the data source in edit mode
- Navigate to the Graph RAG settings
- Add, remove, or modify entity types
- Changed entities will trigger re-indexing on the next sync (files go back to
Parsed→Indexing→Indexed)
Note: Re-indexing re-runs entity extraction, which incurs additional AI cost.
Choosing Between Generic and Industry-Specific
Best Practices
Entity Type Design (Industry-Specific)
Data Source Configuration
- Enable Graph RAG at creation time — adding it later requires re-ingestion of all files
- One graph per data source — each data source gets its own knowledge graph
- Graph RAG works best with document collections (100+ files) where entity relationships span documents
- Image scanning can be combined with Graph RAG — enable both for scanned documents containing entity-rich content
