Inspiration: Construction procurement is notoriously complex. Procurement managers spend countless hours manually parsing through dense, unstructured vendor quotation PDFs, comparing prices, delivery terms, and warranty conditions. Even worse, subtle penalty clauses or non-refundable terms often slip through the cracks, and invoice discrepancies (like inflated pricing or quantity mismatches) cost companies significantly. We were inspired to build a "Copilot" that acts as a digital procurement assistant—automating the heavy lifting, surfacing risks, and explaining why a certain vendor is the best choice, rather than just picking the cheapest option.
What it does: The platform is an end-to-end procurement MVP that handles the entire lifecycle:
Quotation Analysis: Users upload vendor quotation PDFs. The system extracts structured fields (price, quantity, warranty, delivery, payment terms, tax) and automatically flags risky clauses (e.g., penalty clauses, high advance payments). Vendor Comparison: A weighted scoring engine evaluates vendors based on price (30%), delivery (20%), quality (20%), warranty (10%), risk (10%), and historical performance (10%). Explainable Recommendations: It provides a clear, explainable AI recommendation detailing exactly why a vendor won the bid. Automated Purchasing & Verification: With one click, it generates a real Purchase Order (PDF). Later, when an invoice is uploaded, the system verifies it against the PO to catch quantity/price mismatches, duplicate invoices, and fraud risks. How we built it: We designed the system with a modern, decoupled architecture:
Backend: Built with Python and FastAPI, backed by a SQLite database (using SQLAlchemy). We utilized PDFPlumber and PDFMiner for robust document extraction, and ReportLab to generate the final Purchase Order PDFs. Frontend: A responsive, interactive dashboard built with React and styled beautifully with Tailwind CSS, bundled using Vite. AI Architecture: To ensure the prototype runs blazing fast completely offline (and requires no API keys), we built a rule-based/heuristic AI pipeline (regex + weighted scoring). The backend is uniquely architected into specialized "Agent" services (Document Agent, Recommendation Agent, Purchase Order Agent, Fraud Agent). This modularity means we can seamlessly swap the heuristic engine with real LLM calls in the future without rewriting the core application. Challenges we faced
Unstructured Data: Vendor quotations come in wildly different formats. Designing an extraction engine that could reliably pull out specific pricing, quantities, and hidden risk clauses across different PDF layouts without relying on slow LLMs required writing highly robust parsing logic. Scoring Complexity: Creating a weighted scoring algorithm that accurately mimics a human procurement manager's decision-making process was challenging. We had to balance objective metrics (price) with subjective risks (penalty clauses) to ensure the recommendations were genuinely trustworthy. PDF Generation: Dynamically generating a well-formatted, professional Purchase Order PDF complete with approval stamps and line items required precise layout calculations using ReportLab. What we learned We learned a tremendous amount about structuring multi-agent systems and building scalable pipelines. By deliberately choosing to build a heuristic "offline" MVP first, we learned how to deeply modularize our code. We now have a rock-solid foundation where any specific "agent" (like clause summarization) can be independently upgraded to use vector databases (RAG) and Large Language Models without breaking the rest of the application.
Built With
- fastapi
- html5
- javascript
- pdfplumber
- python
- react
- reportlab
- sqlalchemy
- sqlite
- tailwindcss
- vite