> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Graph Overview

<Badge icon="arrow-left" color="gray">[Back to NLP Topics](/ai-for-service/automation/natural-language/nlp-topics)</Badge>

A Knowledge Graph (KG) converts static FAQ text into a structured conversational experience. It supports two models: an ontology-based model using hierarchical terms, and an LLM-based Few-Shot model that requires no ontology.

***

## Knowledge Graph Types

### Ontology Knowledge Graph

Organizes FAQs using terms, synonyms, traits, and context. When a user asks a question, the engine matches utterance tokens against KG nodes (path qualification), then scores shortlisted questions using cosine similarity.

**Enable:** Go to **Automation AI > Natural Language > NLU Config > Engine Tuning > Knowledge Graph** and select **Ontology Model**.

**How it works:**

1. User utterance and KG nodes are tokenized; n-grams extracted (up to quad-gram).
2. Tokens are mapped to KG nodes to get indices.
3. Path qualification: paths are shortlisted based on term coverage and mandatory term presence.
4. Best match is selected by cosine scoring over shortlisted questions.

**Training process:**

1. All terms/nodes and their synonyms are indexed.
2. A flattened path is established for each KG intent using those indices.

### Few-Shot Knowledge Graph

Uses Kore.ai's LLM to identify FAQs by semantic similarity—no ontology needed. Add all FAQs to the root node.

**Enable:** Go to **Automation AI > Natural Language > NLU Config > Engine Tuning > Knowledge Graph** and select **Few-Shot Model**.

**Prerequisites before enabling:**

* Requires NLP V3 and Ranking & Resolver V2 (auto-updated when enabled).
* Embedding model options: BGE M3 and Pretrained MPNet.
* When switching from Ontology KG: Default terms are retained until updated, then become Organizer terms (can be set as Mandatory).
* Only Mandatory terms support path-level synonyms.

**How it works:**

The LLM computes semantic similarity between the user utterance and FAQs, returning a similarity score. The score determines match type (definite, probable, etc.) based on thresholds. Matched intents are sent to Ranking and Resolver to select the winner.

#### Embeddings Model Accuracy

Model accuracy across multiple languages using a single dataset, enabling a comparative evaluation of multilingual performance.

| Model            | Arabic | German | English | Spanish | French |  Hindi | Japanese | Korean |  Dutch | Polish | Avg. Accuracy |
| ---------------- | :----: | :----: | :-----: | :-----: | :----: | :----: | :------: | :----: | :----: | :----: | :-----------: |
| MPNet            | 34.98% | 62.56% |  82.76% |  58.62% | 64.53% | 31.53% |  49.75%  | 38.42% | 58.13% | 50.74% |     53.20%    |
| Pretrained MPNet | 36.45% | 65.02% |  83.25% |  61.08% | 66.01% | 31.53% |  50.74%  | 38.92% | 60.10% | 55.17% |     54.83%    |
| LaBSE            | 71.43% | 78.33% |  80.79% |  77.34% | 79.80% | 76.85% |  80.79%  | 79.31% | 76.85% | 76.85% |     77.83%    |
| BGE-M3           | 76.35% | 82.76% |  83.74% |  80.79% | 80.79% | 80.30% |  84.73%  | 82.76% | 82.76% | 79.80% |     81.48%    |

Model accuracy for English across different datasets from multiple domains, providing a concise summary for quick comparison.

| Model            | Avg. Accuracy |
| ---------------- | :-----------: |
| MPNet            |     79.47%    |
| Pretrained MPNet |     80.60%    |
| LaBSE            |     78.25%    |
| BGE-M3           |     83.49%    |

***

## Selecting Your KG Type

Starting with v10.1, Few-Shot is the default for new KGs under NLP V3 in English.

Go to **Automation > Knowledge AI > FAQs** to switch types.

<Note>
  Before changing KG type, back up your existing graph by creating a new app version or exporting as JSON or CSV. Changes are captured in **App Settings > Change Logs**.
</Note>

***

## Feature Comparison

| Feature                             | Few-Shot KG                                                 | Ontology KG |
| ----------------------------------- | ----------------------------------------------------------- | ----------- |
| Ontology Structure                  | Optional                                                    | Mandatory   |
| Default Terms                       | No (exception: existing terms when switching from Ontology) | Yes         |
| Mandatory Terms                     | Yes                                                         | Yes         |
| Organizer Terms                     | Yes                                                         | Yes         |
| Path Qualification                  | No                                                          | Yes         |
| Tags                                | Yes                                                         | Yes         |
| Synonyms                            | Yes (Mandatory Terms and Tags only)                         | Yes         |
| Path-Level Synonyms                 | Yes (Mandatory Terms only)                                  | Yes         |
| Knowledge Graph Synonyms            | Yes (Mandatory Terms only)                                  | Yes         |
| Traits                              | Yes                                                         | Yes         |
| Context                             | Yes                                                         | Yes         |
| Stop Words                          | Yes                                                         | Yes         |
| KG Import/Export                    | Yes                                                         | Yes         |
| Auto-Generate KG                    | Yes                                                         | Yes         |
| Bot Synonyms                        | Yes                                                         | Yes         |
| Lemmatization using Parts of Speech | No                                                          | Yes         |
| Path Coverage                       | No                                                          | Yes         |
| Search in Answer                    | No                                                          | Yes         |
| Qualify Contextual Paths            | No                                                          | Yes         |
| Auto-Correction                     | Yes                                                         | Yes         |
| Min/Definitive Level for KG Intent  | Yes                                                         | Yes         |
| KG Suggestions Count                | Yes                                                         | Yes         |
| Proximity of Suggested Matches      | Yes                                                         | Yes         |
| Manage Long Responses               | Yes                                                         | Yes         |
| Intent Preconditions                | Yes                                                         | Yes         |
| Context Output                      | Yes                                                         | Yes         |
| Supports All Platform Languages     | Yes                                                         | Yes         |

***
