soumit17

Pydantic AI Invoice — Data skill for Claude Code

Data community

Invoice intelligence API built with Pydantic AI V2 and Claude.

How to install Pydantic AI Invoice

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

What Pydantic AI Invoice does

Invoice intelligence API built with Pydantic AI V2 and Claude. Extracts typed data from Indian GST invoices (PDF, scans, email), audits them against a ledger for duplicates, price drift and GST errors, and routes postings through human approval. Covers capabilities, deferred tools, pydantic-graph, DBOS durability, MCP and evals.

Alternatives in Data

  • AgriQuant AI — AI-powered weather intelligence for agricultural commodity futures 707 ★
  • Trading Signal — Monitor on-chain Smart Money buy/sell signals with price, max gain, and exit rate data on Solana and BSC 483 ★
  • Deepdive — Deepdive skill for Claude Code — 12-phase research pipeline: plan-review gate, parallel sub-agent search, clai 297 ★

README

InvoiceIQ

Accounts-payable automation for Indian GST invoices, built on **Pydantic AI V2**:

  1. read a PDF, scan or email,
  2. extract a structured invoice,
  3. check it against GST rules and the ledger,
  4. let an auditor agent investigate,
  5. decide in plain Python,
  6. post to the ledger only after an approval (a person's, the policy's, or a reviewer model's).

Project 1 of 7 in a framework-comparison series. The spec is [p1-pydantic-ai-invoice-intelligence.md](p1-pydantic-ai-invoice-intelligence.md), and every design trade-off is recorded in [docs/decisions.md](docs/decisions.md) (D0–D24).

Quick start

uv sync
cp .env.example .env                       # put your ANTHROPIC_API_KEY in it
uv run python scripts/gen_mockdata.py      # 40 invoices + ledger + ground truth (deterministic; also committed)
uv run pytest                              # ~200 tests, $0: no real model is ever called
uv run invoiceiq serve                     # API on http://127.0.0.1:8000

Without a key, `pytest`, `invoiceiq mcp`, `postings`, `costs` and `reset` still work. Anything that builds an agent says what's missing and exits.

Architecture

flowchart LR
    subgraph In["Ingest"]
        CLI["invoiceiq CLI"]
        API["FastAPI · SSE"]
        Batch["DBOS durable batch
(queue, kill -9 safe)"] end subgraph Graph["pydantic_graph pipeline (one invoice)"] direction LR Ex["Extractor agent
union output · validators · retries"] Checks["4 deterministic checks
(broadcast → join)"] Au["Auditor agent
ledger tools · FX deferred · Thinking on escalation"] Dec["Policy.decide
pure Python"] Po["Poster agent
post_to_ledger requires approval"] Ex --> Checks --> Au --> Dec --> Po end subgraph Guards["Harness guards on the poster"] Rev["ApprovalReviewer
may approve the clean high-value tier"] Judge["ToolCallJudge
blocks overposting"] end subgraph