Example — RAG answer from evidence (fake)

Understand answer_from_evidence inputs/outputs using fixture evidence and fake chat, not a live retriever.

Updated

Use case

Understand answer_from_evidence inputs/outputs using fixture evidence and fake chat, not a live retriever.

What it demonstrates

  • Contract-driven payloads for RAG tasks.
  • Policy expectations for citations (see RAG guide and VERIFICATION).

Source

examples/rag/answer_from_evidence_fake.py

Command

PYTHONPATH=src python3 examples/rag/answer_from_evidence_fake.py

Steps

  1. Read the task contract: answer_from_evidence.
  2. Build a minimal evidence pack and question payload matching input_schema.
  3. Use TaskRunner(chat=fake_chat) like basic task runner, returning JSON that matches output_schema.

Expected output

Ok with answer / citation fields as defined by the contract version you run.

Failure modes

  • Schema mismatch on evidence or answer shape.
  • Citation policy — verification may reject missing or invalid citations when enabled.

Next steps