Adam BlansettSenior Full-Stack & AI Engineer
AI Engineering
10 min read
Adam Blansett

Self-Hosted AI Procurement & Vendor Management: MSA Playbook Diffing, SaaS Pricing Percentiles, and Separation-of-Duties POs

How ai-procurement-manager automates .pdf/.docx MSA playbook diffing, 384-dim semantic precedent search, SKU/SaaS P25/median/P75 benchmarks, separation-of-duties PO approvals, and 0/7/30/60/90-day renewal alerts.

ProcurementContract DiffingPricing BenchmarkspgvectorRBACFastAPIAudit Chains

Unmonitored SaaS renewals, opaque per-seat price uplifts, and off-playbook liability clauses quietly erode engineering and finance budgets. When contract redlines, historical rate sheets, cost-center budgets, and PO approvals live in separate email threads, teams miss notice windows and approve over-benchmark quotes.

AI Procurement & Vendor Manager Platform (GitHub repository) consolidates contract playbook diffing, SKU/SaaS pricing percentiles, budget-checked PO validation, and deadline-driven renewal alerts into a self-hosted FastAPI, PostgreSQL (`pgvector`), and React 18 TypeScript platform.

Under `contracts/`, teams upload `.pdf`, `.docx`, `.txt`, and `.md` agreements for automated diffing across an 8-family commercial playbook (auto-renewal windows, uplift caps, liability, SLA credits, and termination terms) plus side-by-side vendor comparisons. Clause embeddings (`384`-dim) power cross-vendor precedent retrieval via `POST /api/v1/contracts/search`, escalating risky deviations to legal and procurement HITL queues.

P25/Median/P75 Pricing Benchmarks & Separation-of-Duties PO Control#

Instead of negotiating blind, `benchmarks/` stores normalized historical SKU and SaaS seat pricing (supporting bulk CSV imports at `/api/v1/benchmarks/import-csv`) to calculate P25, median, and P75 rates alongside quote variance and annual savings targets. In `purchasing/`, automated quote-to-PO reconciliation checks line-item arithmetic, cost-center budget headroom (`/budgets/import-csv`), and benchmark outliers before routing tiered approvals:

po_separation_of_duties.py
def validate_approver(requester_id: str, approver_id: str, approver_role: str, required_roles: set[str]):
    if requester_id == approver_id:
        raise HTTPException(status_code=403, detail="Separation of duties violation: self-approval blocked")
    if approver_role not in required_roles:
        raise HTTPException(status_code=403, detail="Insufficient RBAC tier for PO threshold")
  • Notice-Deadline Renewal Briefs (`renewals/`): Combines contract risk flags and benchmark percentiles into Markdown renegotiation briefs, runs deduplicated `0/7/30/60/90`-day alert webhooks, and gates outbound vendor notices behind HITL review.
  • Production Hardening (`core/`): Enforces fail-fast `AUTH_REQUIRED=true` in production, 6-role RBAC (`admin`, `vp_finance`, `finance_director`, `legal_counsel`, `procurement_manager`, `analyst`), sliding-window rate limiting (`429 Retry-After`), local-first `mock`/`ollama`/`gemini` LLM routing with `LLM_REDACT_PII_FOR_CLOUD=true`, SHA-256 `audit_logs` CSV/signed-JSON export, Prometheus `/api/v1/health/metrics`, and optional OpenTelemetry.
Local Evaluation: In non-production mode (`AUTO_SEED_DEMO_DATA=true`), startup idempotently seeds 6 RBAC demo personas, 5 vendors, 8 playbook rules, 12 pricing benchmarks, 4 cost-center budgets, 3 quotes/POs, and 4 tracked renewals.

Building financial control planes, contract intelligence pipelines, or multi-approver procurement tools? Explore my AI Engineering and Software Architecture services or book a call.

Applied Architecture

Production Case Studies & Capabilities

Explore how these engineering patterns are deployed in production systems and available through client engagements.

Case Study

AI Procurement & Vendor Manager Platform

An open-source Python 3.12 (FastAPI), async SQLAlchemy 2.0 + PostgreSQL/pgvector, and React 18 procurement platform featuring .pdf/.docx contract playbook diffing, semantic clause precedent search, SKU/SaaS P25/median/P75 pricing benchmarks, separation-of-duties PO approvals, and deadline-tracked renewal alerts.

Read Case Study
Related Engineering Service

AI Engineering & LLM Integration

Many AI initiatives fail in production due to prompt fragility, high token latency, hallucination risks, and lack of structured evaluation. I bridge the gap between experimental LLM prompts and deterministic software engineering.

Related Engineering Service

Software Architecture & System Design

Fast-moving teams frequently accrue hidden architectural liabilities: tangled domain logic, unmaintainable monoliths, or over-engineered microservices that paralyze development.

Frequently Asked Questions

How does ai-procurement-manager benchmark vendor pricing quotes objectively?
The benchmarks module normalizes historical SKU and SaaS seat rates (including bulk CSV imports via POST /api/v1/benchmarks/import-csv) and computes P25, median, and P75 percentiles, quote variance, price uplift percentages, and estimated annual savings.
How are separation-of-duties violations prevented during purchase order approvals?
The core security layer enforces HS256 JWT + PBKDF2-HMAC-SHA256 RBAC across six roles (admin, vp_finance, finance_director, legal_counsel, procurement_manager, analyst) and explicitly blocks requesters from approving their own POs or outbound vendor notices.
What renewal notice windows trigger automated renegotiation alerts?
The renewals module tracks notice deadlines across 0, 7, 30, 60, and 90-day thresholds with deduplicated alert sweeps, webhook dispatch, Markdown renegotiation brief exports, and HITL-gated vendor notices.
Share this technical guide

Need Help Solving This in Your Application?

I partner with founders, executives, and engineering leaders to design architectures, resolve production bottlenecks, and deliver resilient software.

Related Technical Articles