Project | AI & LLM
Testing RAG and AI Agents
61 eval cases in four versioned suites (RAG, robustness, security, agent) for a support assistant and an agent that can move money. There is no language model on purpose: BM25 retrieval and rules, so every number repeats exactly. A planner that misbehaves on purpose tests the guardrails: forbidden tools, bad arguments, endless loops.
On 28 Nov 2026 the quality gate passed: 135 tests passed and the 7 known misses failed as expected, 99 % coverage; RAG 1.000 on every measure, reworded questions 0.533 correct (limit 0.5), security and agent 1.000.
Evidence checked 28 Nov 2026 | Scheduled CI run on main
On this page
Problem and purpose
There is no language model here, on purpose. Answers come from BM25 retrieval and sentence extraction and the agent's plans from rules, so every number is measured from code that really ran and repeats exactly. The graders and guardrails do not depend on how an answer was made, so a model could be swapped in behind the same interfaces.
The honest number is the robustness suite: keyword search cannot connect "fast option" with "express delivery", so 7 of 15 reworded questions fail, 5 by saying nothing and 2 by confidently citing the wrong section.
Architecture
question -> decline rule -> retrieve (access rule first) -> enough evidence? -> sentence + citation
task -> planner -> guardrails -> tool -> back to the planner, up to 6 stepsTechnology and tools
| Area | Tools |
|---|---|
| System under test | Python 3.13, no runtime dependencies: BM25 retrieval, extractive answers with citations, a rule planner and a tool agent |
| Evals | 61 cases in four versioned suites: RAG 25, robustness 15, security 11, agent 10 |
| Tests | pytest: 142 tests, 99 % coverage, 7 known misses as strict expected failures |
| Gate | Limits per suite and metric in configs/quality_gate.toml; a shrunken case file or a renamed metric fails too |
| CI | GitHub Actions on every push and weekly; redacted traces kept as an artifact |
Engineering decisions and approach
- No model, so every number repeats exactly and the graders are tested on their own
- Limits just below today's values: the gate stops things getting worse; it does not say this is good enough to ship
- Known misses are strict expected failures, so a miss that starts passing fails the run until it is reviewed
- A planner that misbehaves on purpose: forbidden tools, bad arguments, endless loops
- One redacted trace line per case, kept with every CI run
Test scope and execution approach
Project-specific checks and execution details documented in the repository:
- Retrieval measures: Recall at 3, mean reciprocal rank, correct answers, saying "not found" when it should, grounding in the citation
- Access rules: a staff-only section, a section replaced by a newer notice, and a forum post containing a prompt injection
- Security cases: injection, data leaks and redaction
- Agent tasks checked by tools used, final status and final state
- Every grader shown failing on a planted bad answer
Results with dated evidence
Historical repository or workflow evidence
Scheduled CI run on main
On 28 Nov 2026 the quality gate passed: 135 tests passed and the 7 known misses failed as expected, 99 % coverage; RAG 1.000 on every measure, reworded questions 0.533 correct (limit 0.5), security and agent 1.000.
Evidence checked: | Open dated evidence
Evidence explorer
Static screenshots are labelled as images; dated workflow links identify the execution evidence and its check date.
28 Nov 2026: 135 tests passed and the 7 known misses failed as expected, 99 % coverage. RAG 1.000 on every measure; reworded questions 0.533 correct (limit 0.5) and 0.867 without a wrong answer (limit 0.85); security and agent 1.000.
Static material from the public repository. The linked verification record was checked 2026-11-28; that date is not a screenshot capture date.
Dated workflow record
Evidence checked 2026-11-28. Open Scheduled CI run on main
Local setup and execution
pip install -e ".[dev]"
pytest # all tests
python -m evals.run_evals # the four suites and the gateWorkflow and reports
Known limitations
- The RAG cases were written from the same documents the retriever was tuned on: 100 % says it works on what it was built for, not that it generalises
- Keyword retrieval cannot match synonyms; the robustness suite shows it
- A fictional company and knowledge base, small by design
- There is no language model, and the RAG cases were written from the documents the retriever was tuned on, so 100 % says it works on what it was built for, not that it generalises.