Inspiration
Procurement decisions in most organizations still come down to a person manually cross-checking a vendor quote, an invoice, a purchase order, and a delivery photo — often under time pressure, often without a consistent standard for what "good enough evidence" actually means. We kept seeing the same failure pattern: either a rubber-stamp approval because nobody had time to check everything, or a bottleneck because everything needed checking.
We didn't want to build another AI tool that quietly "summarizes documents" and hopes for the best. We wanted a system that treats a purchase approval the way an auditor would — nothing gets approved without evidence, and every recommendation can be traced back to exactly where it came from. That's the idea ProcureMind AI is built around: Evidence before Decision.
What it does
ProcureMind AI is an evidence-driven autonomous procurement decision platform. It doesn't just extract data from documents — it tells a Procurement Manager whether a purchase should be approved, and shows its work.
Core loop:
Upload → Classify → Extract → Quality Gate → Parallel AI Agents
→ Evidence Aggregator → PCI Engine → Decision Dossier → Human Approval
A user uploads the four documents that define almost any procurement transaction — a vendor quote, an invoice, a purchase order, and a delivery photo. Four independent AI agents (Vendor, Contract, Invoice, Delivery) analyze them in parallel, an Evidence Aggregator standardizes their findings, a Procurement Confidence Index (PCI) Engine weighs that evidence, and a Risk Decision Agent produces an explainable Approve / Manual Review / Reject recommendation — complete with a reason list, a confidence score, and a fully replayable audit trail.
Design principles we held ourselves to:
- Evidence First — no decision without supporting evidence
- Human Always in Control — AI recommends, humans approve
- Trust over Automation — missing evidence routes to Manual Review, never a guess
- Enterprise Ready by Default — every decision logged, replayable, auditable
- Modular by Design — one agent failing can never cascade into a wrong approval
How we built it
Deployment stack:
Browser (React / Next.js)
↓
FastAPI (Python backend)
↓
Supabase (PostgreSQL — row-level security)
↓
OpenAI GPT-4o (Vision + Reasoning + JSON)
↓
Government APIs (GST Portal, MCA Portal, Udyam)
↓
Firecrawl (approved-domain scraping — company profiles, IndiaMART, GeM)
↓
Langfuse (observability — every prompt, response, cost, latency)
We were deliberate about where AI belongs and where it doesn't:
| Task | Tool | Why |
|---|---|---|
| Document OCR | GPT-4o Vision | Handles scanned PDFs and mobile photos accurately |
| Vendor web search | Firecrawl | Restricted to approved domains — no random internet sources |
| GST / MCA verification | Government APIs (deterministic) | Binary truth — AI inference isn't acceptable for compliance |
| Market pricing | IndiaMART + GeM | Live benchmarks, not AI-estimated prices |
| Audit logging | Langfuse | Full prompt, response, cost, token, and latency trail |
| Storage | Supabase | Row-level security, signed URLs, PostgreSQL |
Reliability layer: every GPT-4o call uses response_format: json_object and is validated against a Pydantic schema. A failed validation triggers up to two retries; if it still fails, the field returns null rather than a guess — which drops Evidence Coverage and pushes the case toward Manual Review instead of letting bad data flow downstream.
Decision math: the Decision Confidence score is a composite of four measured factors — Evidence Coverage, Source Reliability, Extraction Quality, and Agent Agreement — not a statistical probability. A vendor's PCI weighting (Compliance, Maturity, Commercial, Documentation, Historical Performance) even adjusts for new vendors, redistributing the Historical Performance weight so newer suppliers aren't structurally penalized for lacking a track record.
Every decision — every prompt version, every raw agent output, every cache hit, every human override — is stored in Langfuse and Supabase so it can be fully reconstructed later via Decision Replay.
Challenges we ran into
➤Inconsistent document formats. Vendor quotes, invoices, and delivery proofs arrived as scans, mobile photos, and native PDFs with no shared structure, and field placement varied vendor to vendor. We built a Quality Gate that rejects low-resolution or low-density documents before any AI call runs, so bad input never reaches an agent — but we learned no AI layer can fully compensate for messy source data; onboarding still needs a basic data-hygiene bar. ➤Hallucination under time pressure. Early prompt versions occasionally returned confident-sounding values for fields that weren't actually in the source document. We addressed this with strict JSON schemas, Pydantic validation, "evidence-only, no inference" system prompts, and null-on-missing instead of estimate-on-missing. This catches malformed output — it doesn't catch subtly wrong but well-formed output, which is exactly why we route binary-truth checks like GST/MCA to deterministic government APIs instead of AI. ➤Agent independence vs. shared context. Keeping the four agents fully independent avoided cascading failures, but it also meant they couldn't cross-reference each other mid-run — the Invoice Agent can't ask the Delivery Agent to confirm quantity before finishing its own pass. We resolved this downstream in the Evidence Aggregator instead of upstream between agents, so conflicts are surfaced rather than silently reconciled. The trade-off: some cross-domain conflicts only surface after all four agents finish. ➤Explainability vs. model capability. GPT-4o's reasoning isn't natively inspectable. We forced structured reason lists, per-item source attribution, and a full Decision Replay (prompt version, exact response, timestamp) so every decision is reconstructable after the fact — even though the model's internal weighting stays a black box. ➤Bias in vendor evaluation. A naive scoring model would structurally favor vendors with long transaction histories, disadvantaging new or small suppliers. Our New Vendor PCI weighting redistributes the Historical Performance weight into Compliance and Documentation instead of defaulting to a lower score. Real fairness auditing at scale is still open work. ➤Cost and latency under parallel load. Four GPT-4o agents running in parallel per transaction is fast per decision (~2.8s, ~$0.028) but scales linearly with document volume. We added aggressive caching (24h for GST/MCA, 6h for company profiles, 1h for market pricing), but we don't yet have cost-ceiling or throttling logic for large simultaneous batch uploads. ➤India-first regulatory scope. GST, MCA, and Udyam verification are all India-specific government systems, so the architecture currently assumes an Indian regulatory context. We kept the verification logic modular via a Source Priority Hierarchy so another country's deterministic APIs can be swapped in without asking the AI layer to infer compliance — but no EU AI Act or GDPR-equivalent review has been done yet for markets outside India.
Accomplishments that we're proud of
➤A system that fails safely, every time. By design, one agent crashing, an API going down, or a validation failure can never produce an incorrect Approve — every failure mode routes to "Verification Pending" or Manual Review, never a silent or false approval. ➤A confidence score that means something. The 94%-style figure shown in the Decision Dossier isn't a vibe or a black-box probability — it's a derived composite of Evidence Coverage, Source Reliability, Extraction Quality, and Agent Agreement, each independently visible. ➤True auditability. Every prompt version, agent output, cache hit, and human override is permanently logged in Langfuse and can be replayed months later with the exact model, cost, and reasoning that produced it. ➤Deterministic truth where it matters. We resisted the temptation to let AI "infer" compliance status — GST and MCA verification go through government APIs, full stop, because binary truths shouldn't be estimated. ➤A fairness-aware scoring model. Redesigning the PCI weighting so new vendors aren't automatically penalized for lacking transaction history was a deliberate, non-trivial design decision, not an afterthought. ➤Keeping humans genuinely in control. The AgentMail-drafted clarification emails never send without explicit human approval, and every AI recommendation ends at a human decision point — not an autonomous action.
What we learned
1.Deterministic beats probabilistic wherever a binary truth exists. The moment we stopped asking GPT-4o to reason about things like GST registration status and instead called the actual government API, both reliability and trust went up — AI's job is reasoning over evidence, not manufacturing it. 2.Schema validation is necessary but not sufficient. Pydantic catches malformed JSON; it does not catch confidently wrong-but-valid values. Real hallucination control needed evidence-only prompting and mandatory source/confidence fields on top of schema enforcement. 3.Independence has a cost. Fully decoupled agents are more fault-tolerant, but they can't negotiate or cross-check each other mid-run. Surfacing conflicts downstream in an Evidence Aggregator, rather than trying to force agents to coordinate live, turned out to be the more honest trade-off for an MVP timeline. 4.A confidence score is only useful if it's explainable. Early on we considered a single opaque "AI confidence" number. Breaking it into four legible factors made the number something a Procurement Manager could actually reason about and challenge — not just trust or ignore. 5."Auditable" has to be designed in from day one. Bolting on logging after the fact would have missed prompt-version-to-decision linkage, which turned out to be one of the most valuable things for answering "why did the AI say this three months ago?" 6.Fairness has to be an explicit design decision. Scoring models default toward whatever data is most abundant (long-history vendors) unless you deliberately correct for it — bias doesn't announce itself, you have to go looking for where your weighting structurally disadvantages someone.
What's next for ProcureMind AI
Multi-tenant, multi-project platform
Isolated organization workspaces, each with its own vendors, POs, and decision history Multi-project procurement within a single org (separate sites, business units, or cost centers), each with its own budget and approval chain Cross-project vendor reuse — a vendor verified once (GST/MCA cached) doesn't need re-verification elsewhere in the same org, respecting cache TTL Project-level PCI thresholds, so a high-value infrastructure project can require stricter confidence than routine office supply purchases Row-level isolation extended from org-level to project-level in Supabase
Role-based portals
Admin Portal — PCI weight configuration, user/role management, prompt version management and rollback, org-wide audit dashboard, per-project spend caps Vendor Portal — self-service document upload, visibility into their own evidence status, a clarification-request inbox, and a dispute/appeal flow Procurement Manager Portal (formalizing what exists today) — Decision Dossier review, project-level dashboards, Evidence drill-down Finance / Compliance Portal — read-only cross-project audit access, regulatory reporting exports, and a data-retention/privacy control panel
Regulatory and governance expansion
Formal DPDP Act 2023 data protection review for supplier/contract PII EU AI Act–style risk classification if the platform expands to organizations with EU exposure A documented AI governance process for prompt-version approval before production rollout A scheduled fairness/bias audit cadence once enough real decision volume accumulates
ERP integration (Phase 2/3)
REST-based PO sync and approval triggers for SAP Ariba, Oracle Procurement Cloud, and Microsoft Dynamics 365 Two-way sync so approved decisions write back to the ERP and ERP status changes reflect back into the Decision Dossier
Adoption and scale
In-app onboarding explaining what Decision Confidence and PCI actually measure, so staff don't over-trust or under-trust the score Notification system for pending Manual Reviews and vendor clarification responses An analytics dashboard for approval rates, confidence trends, and cost over time Predictive forecasting (spend forecasting, supplier risk trends) — deliberately deferred to Phase 3, kept out of the MVP on purpose
What we're not rushing to add: blockchain audit trails, a vector database/RAG layer, agent frameworks like LangGraph or CrewAI, fine-tuning, or autonomous purchasing. Each would add complexity without strengthening the core story — a system that shows its work and keeps a human in control of every final decision.
Built With
- api
- framework