> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwedai.com/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"
)
```

## 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.
