Skip to content
Learn · Design pattern

Audit-grade citations — making AI decisions reviewable.

Citations are how Vihaya makes LLM output reviewable. Not 'trust the model' — 'here is the policy text the model read, and here is the conclusion it drew'. The pattern is simple to describe and rare to implement correctly. Here's what audit-grade means in practice.

Where citations land in the data model

In Vihaya, a decision row stores citationChunkIds: string[]. Each ID is a key into kb_chunks — the same table the retrieval pipeline wrote during ingest. Reviewers, regulators, and the customer's audit tooling can join the decision back to the verbatim source text whenever they need to.

This is the architectural answer to the regulator's question: 'show me why this decision was made'. The audit chain isn't a separate system you fall back on — it's the system you operate.

Citations FAQ

What's an audit-grade citation?

A pointer from a decision back to the exact source chunk the agent grounded on. In Vihaya, each decision row stores citationChunkIds — IDs that dereference to rows in kb_chunks, which carry the verbatim text the agent read.

Isn't this just RAG?

RAG retrieves; citations record what was retrieved and acted on. They're related but not the same. A poorly-designed RAG system retrieves chunks but never records which ones the model actually grounded on — so the audit chain is implicit at best.

How do you enforce that the agent actually used the cited chunks?

Two ways: prompt the model to return citationChunkIds as part of its structured output, and score citation grounding in the eval gate. If the model returns 'approve' with no citations, the eval gate penalises the score.

What about hallucinated citations?

Real risk. The defence is that every citation ID must exist in the retrieved set — IDs that didn't come back from retrieval are filtered out before the decision row is written. The model can hallucinate text; it can't hallucinate IDs that came from the database.

Want to see this in your environment?

30-minute discovery call. Draft SOW within 5 business days.

Talk to us about a pilot