Skip to content
Tim Borja
Apps

Groundwork

An AI agent that answers questions from documentation and checks its own citations

Timothy Maersk M. Borja

Source ↗Source only
golden test questions
50
golden test questions
doc pages indexed
~190
doc pages indexed
self-correction loops
2
self-correction loops
Platforms
Web
Since
2026
Developer tools

Preview

groundwork · localhost:3000
Cited answers with a live agent trace
groundwork · agent graph
Groundwork agent graphA question is triaged, then the agent retrieves documents and grades them. If they are not good enough it expands the search and retrieves again. Then it writes an answer and verifies every claim, rewriting if a claim is unsupported, before finishing.questiontriageretrievegradewriteverifyexpandnot enough? search again (max 2)unsupported claim? rewrite (max 1)answer
Both loops are capped, so the agent can't retry forever or run up an API bill.
The agent graph and its two loops

Drawn screens use made-up sample data. The client's and clinics' real data never appears on this site.

A retrieval-augmented (RAG) agent built with LangGraph and Claude. It searches the docs, judges whether what it found is good enough, searches again if not, and checks every claim in its answer against the source before replying.

The problem

Most “chat with your docs” demos search once and answer with whatever comes back. They look good in a demo and fall apart on real questions: they cite the wrong page, or confidently answer from something that doesn’t actually say that.

The question Groundwork is built to answer is the one interviewers ask: how do you know your search is any good?

What I built

An agent that answers questions about the LangGraph documentation, so anyone can check its answers against the real source. It is built as a graph with two loops:

  • Search again when needed. A grader reads what was found. If it doesn’t answer the question, the agent writes new searches aimed at what is missing and tries again, up to a limit.
  • Check before answering. After drafting, a fact-checker compares every claim with the passage it cites. Unsupported claims send the draft back to be rewritten. If it still fails, the answer is clearly marked as unverified.

How it works

  • Search: two kinds of search run side by side. One matches meaning (embeddings in pgvector); the other matches exact words like class names (Postgres full-text). The results are merged and re-ranked by a cross-encoder.
  • Agent: LangGraph, with Claude handling triage, query rewriting, grading, writing and fact-checking.
  • API and UI: FastAPI streams every step to a Next.js chat UI, which lights up each step of the graph as it runs and links each citation to the exact section of the docs.
  • Evaluation: a golden set of labelled questions, plus an ablation script that turns each part on one at a time to measure what it adds.

Try it

The source, with a one-command local setup, is on GitHub.