Inspiration

Traditional procurement involves manually reviewing supplier quotations, comparing prices, checking product specifications, and making purchasing decisions across multiple documents. Supplier information often arrives in different formats, especially PDFs, making comparison time-consuming and error-prone.

We built ProcurePilot AI to explore how AI, Retrieval-Augmented Generation (RAG), and payment APIs can work together to automate this process while keeping financial decisions under human control.

How We Built It

ProcurePilot uses a full-stack architecture with a React and TypeScript frontend and a Python FastAPI backend.

1. RAG-Based Document Intelligence

We designed a document ingestion pipeline that accepts supplier documents in PDF, DOCX, CSV, TXT, and image formats.

The pipeline performs:

  • Document validation and secure file storage.
  • PDF and document text extraction.
  • OCR for scanned documents and images.
  • Text cleaning and semantic chunking.
  • Embedding generation.
  • Vector database indexing.
  • Semantic retrieval with supplier-specific metadata.

Using RAG, the AI retrieves relevant information from supplier catalogs, quotations, warranty policies, and product specifications instead of relying only on an LLM's general knowledge.

Retrieved information retains document references and page-level evidence to make AI responses more traceable.

2. AI-Powered Supplier Intelligence

We developed an AI workflow that understands natural-language procurement requirements and converts them into structured data.

The system retrieves relevant supplier information, extracts quotation details, and compares suppliers using:

  • Total purchase cost
  • Product requirement matching
  • Delivery timelines
  • Warranty conditions
  • Supplier risk indicators
  • Quote completeness

Numerical calculations and supplier scoring are handled through backend logic, while AI interprets the results and generates explainable recommendations.

3. Human-in-the-Loop Decision Architecture

The AI recommends the most suitable supplier and explains its reasoning with supporting document evidence.

However, AI cannot independently approve procurement or authorize payments.

The requester approves the recommended supplier, followed by Finance authorization. This separation keeps purchasing decisions explainable and financial actions controlled.

4. PayPal Payment Integration

We integrated the PayPal REST API and official JavaScript SDK to connect procurement decisions with payment execution.

The payment workflow uses:

  1. Server-side PayPal access-token generation.
  2. PayPal Checkout order creation.
  3. Official PayPal checkout and buyer approval.
  4. Server-side payment capture.
  5. Payment response verification.
  6. Database status synchronization.

PayPal Sandbox is used for testing the actual checkout process. Credentials remain on the backend and are managed through environment variables.

5. Backend and Data Architecture

The backend uses FastAPI to manage authentication, role-based access, supplier onboarding, document processing, RAG retrieval, AI analysis, approvals, and payments.

The database maintains supplier information, procurement requests, quotations, document metadata, AI recommendations, approvals, PayPal orders, payment records, and audit logs.

Challenges We Faced

One of the main technical challenges was handling supplier documents with inconsistent structures. Different suppliers use different quotation formats, making reliable extraction and comparison difficult.

We addressed this through document parsing, OCR, semantic chunking, RAG retrieval, structured extraction, and backend validation.

Another challenge was ensuring that AI-generated recommendations did not become uncontrolled financial actions. We designed a human approval boundary and server-side PayPal payment validation to separate AI decision-making from payment authorization.

We also focused on preventing unsupported AI claims by connecting recommendations to retrieved document evidence and treating missing information as unknown rather than inventing values.

What We Learned

This project helped us understand how RAG, vector databases, embeddings, document processing, LLM orchestration, structured AI outputs, and payment APIs can be combined into one practical application.

Our key technical learning was that useful AI automation requires more than an LLM: it needs reliable data extraction, grounded retrieval, deterministic calculations, backend validation, security, and human oversight.

ProcurePilot AI demonstrates an end-to-end architecture connecting unstructured supplier documents to explainable AI procurement decisions and human-authorized PayPal payments.

Built With

Share this project:

Updates

Submission history