> ## Documentation Index
> Fetch the complete documentation index at: https://qwed-ai-mintlify-6a1e3354.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Graph fact engine

> QWED's Graph Fact Engine verifies claims against knowledge graphs by decomposing them into Subject-Predicate-Object triples and performing pathfinding queries.

The **Graph Fact Engine** verifies claims by checking them against detailed **knowledge graph (KG)** structures, rather than just unstructured text. This provides structured fact-checking for complex relationships.

## How it works

It decomposes claims into Subject-Predicate-Object (SPO) triples and queries a connected knowledge graph (like Neo4j or NetworkX) to verify the relationship exists.

1. **Triple extraction:** Extract `(Paris, is_capital_of, France)` from "Paris is the capital of France".
2. **Pathfinding:** Search the KG for a path between `Paris` and `France` with edge `is_capital_of`.
3. **Transitive verification:** Verify implicit relationships (e.g., if A is in B, and B is in C, is A in C?).

## Usage

```python theme={null}
response = client.verify_graph(
    claim="Elon Musk is the CEO of Tesla",
    graph_id="tech_leaders_kg"
)
```

## Result contract

The Graph Fact Engine returns a [`DiagnosticResult`](/advanced/diagnostics). A claim only resolves to `VERIFIED` when **every** material triple has full graph support — partial matches do not verify:

| Path                            | `DiagnosticResult.status` | Notes                                                        |
| ------------------------------- | ------------------------- | ------------------------------------------------------------ |
| All triples fully supported     | `VERIFIED`                | Emits a `proof_ref` bound to the matching graph paths.       |
| One or more triples unsupported | `UNVERIFIABLE`            | NLI fallback results are recorded in `advisory_checks` only. |

The NLI fallback is [advisory only](/engines/overview#tier-3-advisory-engines) — it can never promote an unsupported claim to `VERIFIED`.

## When to use

* **Complex relationships:** Family trees, corporate hierarchies, supply chains.
* **Multi-hop reasoning:** "Is the CEO of the acquisition target verified?"
* **Structured data:** When your source of truth is a database or graph, not a document.
