docs-ragDocsRAGv0.1.0
Issue №01 · production ragv0.1.0 live

RAG with cited answers.

Upload a PDF or paste a URL. Ask a question. Every claim in the answer has to cite a chunk we actually retrieved. If the model cites something we didn’t send, we get one repair pass; if that fails, the response is a refusal instead of a guess.

§02. Try it

Pick a document.
Ask anything.

Each answer comes back with chunk-id citations that exist in the retrieval context, a faithfulness score, and a full latency trace.

Sample documents

Ask
What was Apple's iPhone revenue in fiscal year 2024?

Press Enter to ask · samples shown above are pre-loaded

§03. How it's built

Six pieces of plumbing that keep this honest in CI.

01

Citation check.

Every claim has to cite a chunk_id we sent. If the model cites something we didn't, one repair pass, then refuse.

02

PR-level eval gate.

GitHub Actions runs the 50-question golden set on each PR. If faithfulness or citation accuracy drops more than 3 points, the merge gets blocked.

03

Hybrid retrieval.

BM25 over the full corpus, dense (Jina v3 with late chunking), RRF fusion, then Cohere Rerank 3.5. Not the version that just re-sorts dense by sparse.

04

Cost + traces.

Per-call dollar cost from API usage, structlog JSON. Langfuse traces. Retry with repair on schema errors. Daily Anthropic spend cap with a circuit breaker.

05

URL ingestion isn't an SSRF.

RFC1918, link-local, loopback, and cloud-metadata IPs are rejected at the URL handler. Per-IP rate limits via slowapi. PDF size capped before buffering.

06

Strict typing all the way through.

Pydantic v2 strict on every endpoint, mypy --strict, ruff. Coverage gate at 75%. Fresh clone runs make ci clean.