Skip to content

Feature request: Add validated citations cookbook for RAG answers #237

Description

@rajpatilrobotics

Proposal

Add Validated Citations for RAG Answers to the HydraDB v2 cookbook collection.

Problem

A grounding prompt can ask a model to cite retrieved context, but it cannot prove that a generated evidence ID came from the response that supplied the model context. Rendering invented IDs, model-controlled titles, or model-controlled URLs creates false provenance.

Proposed content

A focused, runnable cookbook that:

  • binds every rendered claim to one or more chunk_uuid values from the same HydraDB query response;
  • resolves source labels through chunks[].id -> sources[].id only after validation;
  • fails closed for uncited or unknown evidence, malformed model output, duplicate identities, unsafe URLs, and unrelated additional_context;
  • keeps citations text-only by default, allowing links only through an application-owned destination policy;
  • includes an optional bounded Evidence Inspector for reviewing cited text.

Validation

The cookbook includes 61 deterministic offline checks for the v2 request/response contract, retrieval-to-validator flow, and adversarial cases. It requires no HydraDB key, model key, external network call, or added runtime dependency.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions