-
-
Cover (the Devpost thumbnail)
-
How it works: the four roles, one question each
-
Analyst: the hash-linked audit log
-
Sourcing: “Switching saves $3.4M a year, but only with proof of US fab.”
-
Analyst: the lineage graph
-
Approver: the downloaded PDF brief
-
Approver: the decision brief
-
Sourcing: the memory part, with duty before and after and cheaper quotes
-
Compliance: the Snake River evidence, unreadable and flagged
-
Compliance: the bulletin with its 25% line highlighted
Inspiration
Every product hides a network of sourcing decisions. A phone may contain components from dozens of suppliers, each selected for a reason: price, capacity, origin, qualifications or tariffs.
Those reasons can change while orders are still open.
We started Keystone with one question: when the world changes, does the original supplier decision still make sense?
A tariff announcement tells a manufacturer what changed. Deciding what to do next means connecting that announcement to purchase orders, supplier quotes, product components and supporting documents, and procurement, trade compliance and finance each hold part of the answer. We wanted to bring those pieces together so a team can revisit a decision, compare the alternatives, and see what it must verify before acting.
What it does
Keystone is a prototype sourcing decision platform for industrial importers. It connects a change in trade conditions to affected orders, supplier alternatives, evidence requirements and human review.
- Understand the change: extract tariff headings, rates and effective dates from a bulletin, with source citations.
- Calculate exposure: identify affected parts and orders, and explain the added duty.
- Revisit the supplier decision: compare the incumbent with alternatives, with and without the required evidence.
- Check the proof: show which documents are available, missing or unreadable.
- Prepare the response: draft a supplier request or decision brief for a person to review.
The public demo follows Larkspur Mobile, a fictional US phone manufacturer, through a simulated Section 232 change that raises duty on chips from 10% to 25%. Separate workspaces for sourcing, trade compliance, analysts and approvers let you inspect cost calculations, trace each figure to its source, compare suppliers and download a decision brief.
One example captures the idea. Switching memory suppliers saves a simulated $3.36 million a year, but only if the new supplier can prove its wafers were fabricated in the US. Without that proof, the switch costs $1.64 million more. The saving and the proof needed to support it belong in the same decision.
All companies, tariff events and financial outcomes in the demo are fictional.
Try it: keystone-tariff.vercel.app
How we built it
We started with shared Pydantic models, OpenAPI contracts and JSON fixtures, so the interface, the backend and the document pipeline spoke the same language from day one.
The backend uses Python, FastAPI, SQLAlchemy and PostgreSQL to connect suppliers, parts, bills of materials, purchase orders, tariff rates and the assumptions behind each supplier award. NetworkX answers where-used questions across that graph.
Five AI modules handle document classification, tariff-change extraction, evidence extraction, entity matching and action drafting. Claude's structured outputs turn document content into validated records, and citations tie each extracted field to the page it came from. PyMuPDF renders the pages, including scans.
The model never does the arithmetic. Rules calculate exposure and evaluate evidence requirements, for example:
$$ \text{Added duty} = \text{Customs value} \times (\text{New rate} - \text{Previous rate}) $$
The interface uses Next.js, React and TypeScript, with React Flow for lineage graphs and React-PDF for downloadable decision briefs. We explored five interface designs, then combined the strongest parts into one platform with a workspace for each role.
Cached model responses, offline replay and a repeatable database reset let us reproduce the document-processing demo without fresh model calls. Docker Compose runs the stack locally, and GitHub Actions runs pytest and Vitest on every pull request.
The public Vercel deployment runs on built-in scenario data and saves demo decisions in each viewer's browser. The repository also contains the document-processing backend, demonstrated with a fictional industrial-parts case called MeridianFlow.
Challenges we ran into
Unreadable evidence. A scanned supplier certificate exposed a hard problem: a model could read some fields correctly while reporting inconsistent confidence. We added explicit readability states, multiple renderings of each scan and conservative checks that leave unclear fields unresolved instead of guessing.
Traceable financial claims. A cheaper quote does not guarantee a cheaper qualified supplier. We kept extraction and drafting separate from rule-based calculations, and compared alternatives both with and without the required proof.
Making complexity usable. Early screens exposed internal identifiers and technical statuses. We replaced them with supplier names, plain-language explanations, visible calculation steps and clear next actions.
Coordinating a fast build. Shared contracts, separate branches, reviewed pull requests, automated checks and end-to-end walkthroughs kept the interface, rules and AI pipeline consistent as the project changed.
What we learned
A useful recommendation needs more than a number. People need to know what changed, why it matters, where the calculation came from and what is still uncertain.
Confirming which supplier a document came from does not validate every field inside it. And different roles need different views of the same decision.
What's next
Keystone is a hackathon prototype. Next, we want to run the workflow on an authorized industrial case, compare its calculations with expert review, and test whether it helps teams reach defensible sourcing decisions faster.
Built With
- anthropic-api
- bootstrap
- claude
- codex
- docker
- docker-compose
- fastapi
- github
- github-actions
- networkx
- next.js
- openapi
- postgresql
- pydantic
- pymupdf
- pytest
- python
- react
- react-flow
- react-pdf
- sqlalchemy
- typescript
- vercel
- vitest