RutujaBorawake

Doc Agent — AI skill for Claude Code

AI community

AI-assisted Vendor Service Agreement generator: LangGraph workflow with Claude & OCR reading invoices, a human approval step, and a Word document built from the Common Paper template.

How to install Doc Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open RutujaBorawake/doc-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Doc Agent does

AI-assisted Vendor Service Agreement generator: LangGraph workflow with Claude & OCR reading invoices, a human approval step, and a Word document built from the Common Paper template. FastAPI, Streamlit, PostgreSQL, Docker.

Alternatives in AI

  • Claude Cookbook — Official notebooks and recipes for common patterns (RAG, tool use, Skills, MCP) 35.3k ★
  • LLM Aided OCR — Enhances Tesseract OCR output using LLMs (local or API) for error correction, smart chunking, and markdown for 3k ★
  • Azure Vision Java — Image captioning, OCR, and object detection 1.8k ★

README

Document Agent API (FastAPI + LangGraph + Claude Sonnet)

Setup

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env      # then add ANTHROPIC_API_KEY and TAVILY_API_KEY

Run

uvicorn app.main:app --reload
# interactive docs: http://127.0.0.1:8000/docs

Try it

curl -X POST localhost:8000/documents -H 'content-type: application/json' \
     -d '{"topic":"How solar panels work","length":"short"}'
curl localhost:8000/documents/          # wait for "awaiting_approval"
curl -X POST localhost:8000/documents//review \
     -H 'content-type: application/json' -d '{"approved":true}'
curl -OJ localhost:8000/documents//download

Where to look when debugging

Symptom File
Wrong flow / wrong next step app/graph.py
Bad LLM output / wording app/prompts.py
Search / page-fetch problems app/tools/
One step misbehaving app/nodes/.py
API status / endpoints app/main.py
Model name, limits, section sizes app/config.py
Every node logs [node_name] ... to the terminal.

Vendor service agreement (form + invoice extraction)

Endpoint Purpose
GET /forms/vendor-service-agreement The fixed question set (48 questions, 9 sections)
POST /forms/vendor-service-agreement/validate Body {"answers": {...}} -> errors, ignored fields, masked answers
POST /invoices/extract Upload up to 5 invoices (PDF/PNG/JPEG, multipart field files) -> extracted data, checks, suggested answers

Nothing is stored by these endpoints.

Tests

.venv/bin/python -m pytest tests -q                       # offline, fake model, no keys needed
.venv/bin/python scripts/eval_invoice_extraction.py       # REAL model vs data/invoices/*.truth.json (needs key)

More "where to look" rows

Symptom File
A question is missing / wrong type / wrong rule data/fo