Skip to content

Econowiz/agentic-document-workbench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Document-to-Action Workbench

A reviewer-ready portfolio project for turning messy procurement and legal documents into validated, auditable, human-approved workflow outputs.

What To Look At First

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.

Screenshots

Procurement tender queue

Legal case search

Run The Demo

cp .env.example .env
docker compose up --build -d
docker compose exec backend alembic upgrade head

Then open:

  • UI: http://localhost:5173
  • API health: http://localhost:8000/health

Reviewer path:

  1. Start on Tender Queue, open TED 143002, inspect supplier matches, then prepare/approve/send the mock ERP handoff.
  2. Switch to Legal, open BGer 4A_123/2025, inspect Regeste/citations/precedents, then prepare the research packet.
  3. Open Evals to see procurement extraction, supplier top-match, legal retrieval, and provider-comparison gates.
  4. Open Trace and Audit panels to verify local workflow state and execution history.

Status

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.

What this project proves

  • 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.

Implemented vs Deferred

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

Portfolio Walkthrough

Repository

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

Local Checks

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 test

References

Full brief: docs/PROJECT_BRIEF.md (copied into the repo to stay self-contained).

About

Two-domain agentic document-to-action workbench for procurement and legal workflows

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors