Legal RAG Verification

HalluGraph: Knowledge Graph Verification

Detect hallucinations in legal AI outputs using Entity Grounding and Relation Preservation. Audit every claim back to source documents with full traceability.

Loading NER & Embedding Models
Initializing Transformers.js...

Legal Documents

Knowledge Graph Alignment

Source Entity
Response Entity
Ungrounded

Fidelity Metrics

--
CFI Score
Awaiting Input
Entity Grounding
--%
Relation Preservation
--%
Entities Found
-- / --
Relations Verified
-- / --
Why? (White-Box Explanations)
Verify documents to see detailed explanations
Entity Extraction
-- ms
Graph Alignment
-- ms
Total
-- ms
🌱
-
CO₂ eq.
Cost vs. GPT-4 Judge
HalluGraph $0.00
GPT-4 ~$0.02

Hyperparameters

Adjust detection sensitivity

0.75

Scores below this value are flagged as hallucinations

0.8

Balance between Entity Grounding (High) and Relations (Low)

Legal Test Cases

Test HalluGraph on different legal scenarios

Batch Performance Demo

Process multiple pairs to measure throughput

Pairs Processed
0 / 0
Throughput
-- pairs/sec
Avg. Latency
-- ms
Accuracy
--%

How HalluGraph Works

1

Entity Extraction

Extract named entities (parties, dates, amounts, provisions) from source and response using NER.

2

Graph Construction

Build knowledge graphs G_c (context) and G_a (answer) with entities as nodes and relations as edges.

3

Entity Grounding

Compute EG: fraction of response entities that match entities in the source document.

4

Relation Preservation

Compute RP: fraction of response edges that are supported by source graph edges.

5

Composite Fidelity

CFI = α·EG + (1-α)·RP provides a unified score with full audit trail for each flagged issue.