A reviewer-ready portfolio project for turning messy procurement and legal documents into validated, auditable, human-approved workflow outputs.
This is not a chatbot, a RAG tutorial, or a single extraction script. The product surface shows two verticals on one workflow foundation:
- Procurement: open a Swissgrid tender, inspect lots and supplier matches, review risky positions, prepare a bid packet, approve it, and send an idempotent mock ERP handoff.
- Legal: open a Swiss Federal Supreme Court fixture, read the Regeste, inspect grounded citations and related precedents, prepare a research packet, and copy a formatted citation.
Under the surface, both paths share typed schemas, evidence snippets, audit events, eval gates, optional Langfuse export, and no-key deterministic defaults.
cp .env.example .env
docker compose up --build -d
docker compose exec backend alembic upgrade headThen open:
- UI:
http://localhost:5173 - API health:
http://localhost:8000/health
Reviewer path:
- Start on
Tender Queue, openTED 143002, inspect supplier matches, then prepare/approve/send the mock ERP handoff. - Switch to
Legal, openBGer 4A_123/2025, inspect Regeste/citations/precedents, then prepare the research packet. - Open
Evalsto see procurement extraction, supplier top-match, legal retrieval, and provider-comparison gates. - Open
TraceandAuditpanels to verify local workflow state and execution history.
Vertical 1 is a reviewer-ready procurement MVP. The default demo is no-key and deterministic: start from a tender queue, open the three-lot Swissgrid notice, inspect supplier catalogue matches, review positions, choose Place bid or Pass, prepare a bid packet, submit it for approval, send the idempotent mock ERP handoff, inspect the audit trail, and view evals over three TED samples.
Vertical 2 is a narrower legal intelligence proof: switch the workbench to Legal, start from Case Search, open an OpenCaseLaw-style Swiss Federal Supreme Court decision, read the Regeste-led case view, inspect grounded citations and related precedents, copy a formatted citation, prepare the research packet, inspect legal audit events, and view a small real retrieval eval over a committed Swiss case-law mini-corpus.
Gemini is wired as an opt-in Vertex AI provider behind the same interface and has a local smoke path. Langfuse tracing is also optional behind environment variables. The public demo, Docker path, and CI stay on FakeProvider and local trace/audit output. Auth, tenanting, real downstream writes, async workers, full legal corpus ingestion, and public deployment are intentionally deferred.
- Stateful agentic workflow orchestration with retries, branches, and human-in-the-loop.
- Unstructured documents to typed schemas with field-level evidence.
- Reliable tool and API calls behind authorization gates and idempotency keys.
- Procurement supplier/product matching with explainable deterministic scores.
- Evals as a product feature, not an afterthought, with procurement extraction and legal retrieval gates.
- Observability and traceability per run, with optional Langfuse export.
- Security boundaries against prompt injection inside uploaded documents.
| Area | Implemented | Deferred |
|---|---|---|
| Procurement | TED sample run, lot review, supplier catalogue matching, bid packet, mock ERP handoff | Live supplier inventory, real ERP write, broad tender ingestion |
| Legal | Case search fixture, Regeste-led case view, grounded citations, related precedents, research packet | Live OpenCaseLaw ingestion, full corpus search, legal advice workflow |
| Evals | Three TED samples, supplier top-match gate, legal retrieval mini-corpus, provider comparison | Large benchmark, hybrid/vector legal retrieval, production score history |
| Observability | Local trace/audit, optional Langfuse trace URL when configured | Required hosted tracing, production dashboards |
| Infrastructure | Docker Compose, Postgres, Redis reserved as future queue boundary | Public deployment, async worker, auth, tenanting |
- Reviewer guide:
docs/REVIEWER_GUIDE.md - Case study:
docs/PROCUREMENT_CASE_STUDY.md - Legal case study:
docs/LEGAL_CASE_STUDY.md - Two-minute demo script:
docs/DEMO_SCRIPT.md - Evals and optional Gemini smoke:
docs/EVALS.md - Release notes:
docs/RELEASE_NOTES.md
agentic-document-workbench/
backend/ # FastAPI + Pydantic shell
frontend/ # Vite React + Tailwind operator-console shell
data/
samples/ # real-world documents for the parser bake-off
gold/ # curated gold labels for evals
docs/
DECISIONS.md
PREFLIGHT.md
docker-compose.yml
No real model key is required. The default path uses MODEL_PROVIDER=fake; set MODEL_PROVIDER=gemini plus Vertex AI project/location settings only when testing the opt-in Gemini adapter. Local Gemini smoke uses Google ADC; Docker remains no-key unless credentials are mounted outside git.
cd backend
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest
cd ../frontend
pnpm install
pnpm typecheck
pnpm testFull brief: docs/PROJECT_BRIEF.md (copied into the repo to stay self-contained).

