RAG vs AIEP

Retrieval-Augmented Generation (RAG) retrieves documents to ground AI responses. AIEP validates those responses against hashed, schema-conformant evidence. These are different things.


What RAG does

RAG improves AI accuracy by retrieving relevant documents before generating a response. The model uses those documents as context. This reduces hallucination rate significantly compared to pure generation.

RAG does not:

  • Hash the retrieved documents
  • Record retrieval timestamps
  • Validate the response against a schema
  • Expose a machine-readable evidence trail
  • Enable independent replay of the reasoning

When the session ends, the evidence is gone.


What AIEP adds

AIEP is not a replacement for RAG. It is a verification layer that can sit on top of RAG or any retrieval pipeline.

CapabilityRAGAIEP
Retrieves evidence before generating
Hashes retrieved artefacts
Records retrieval timestamp
Validates response against schema
Exposes machine-readable evidence rail
Supports independent replay
Detects source changes after retrieval

A concrete difference

RAG response:

Answer: The statutory limitation period for contract claims in England
        is 6 years.

Source: legislation.gov.uk (retrieved this session)

No hash. No timestamp. No validation. The source reference cannot be verified.

AIEP response:

{
  "answer": "The statutory limitation period for contract claims...",
  "evidence_rail": [
    {
      "source_url": "https://legislation.gov.uk/ukpga/1980/58",
      "content_hash": "f3a2c4e0b6a7d991...",
      "retrieved_at": "2026-04-25T00:00:00Z",
      "validation_status": "passed"
    }
  ],
  "validation": { "status": "passed" }
}

The hash means: if the source changes after retrieval, any replay will detect the discrepancy.


When does this matter?

RAG is sufficient for many use cases where approximate accuracy is acceptable.

AIEP matters when:

  • Incorrect outputs have real consequences (legal, medical, financial, regulatory)
  • You need to audit what an AI said and why
  • A third party needs to verify an AI-generated claim
  • Compliance requires a documented evidence trail

Try it

Verification Playground → — see a full AIEP evidence rail

View the evidence rail JSON →

View on GitHub →

Machine endpoint →


See also: What is AIEP? · Verify AI Output · Deterministic AI · How AIEP Works · Build with AIEP