Inspiration

The motivation behind AgentProcure AI stemmed from observing the immense administrative friction, compliance bottlenecks, and approval delays inherent in traditional corporate procurement workflows. In most enterprises, purchasing everyday items—such as IT hardware, software licenses, or office supplies—requires wading through dense multi-page corporate policy handbooks, checking internal warehouse inventory to prevent duplicate spending, and manually routing approvals through multi-tiered management chains.

I wanted to build an intelligent, autonomous procurement agent that could seamlessly bridge natural language user requests with strict enterprise governance. By combining a Retrieval-Augmented Generation (RAG) policy engine with Model Context Protocol (MCP) inventory tools and cryptographic Role-Based Access Control (RBAC), AgentProcure AI transforms cumbersome purchasing cycles into a streamlined, secure, and fully auditable experience.

What it does

AgentProcure AI is an enterprise-grade, autonomous procurement platform designed to streamline corporate purchasing, eliminate administrative friction, and enforce strict compliance rules. It bridges natural language user prompts with automated corporate governance by combining:

Role-Based Access Control (RBAC): Cryptographically signed JWT sessions that segregate duties between regular employees (who can query inventory and research vendors) and finance managers (who hold exclusive checkout and approval privileges).

Autonomous RAG Policy Enforcement: An automated parser that evaluates purchasing requests against company handbook guidelines.

MCP Inventory & Payment Integration: Real-time warehouse stock checks and secure PayPal sandbox checkout execution.

How we built it

The application is structured as a decoupled, production-ready full-stack architecture:Frontend: Developed using Next.js (App Router) and Tailwind CSS for a responsive, modern UI, deployed globally on Vercel (https://agentprocure-ai.vercel.app).
Backend & API: Built with FastAPI in Python for asynchronous high-performance routing, deployed containerized on Render (https://agentprocure-ai-backend.onrender.com). Database & State: Managed via SQLModel with asynchronous database connectivity handling session states and audit logs. LLM & RAG Engine: Powered by Groq API inference (llama-3.3-70b-versatile) coupled with a memory-efficient BM25 sparse vector retrieval engine to scan corporate policy PDF documents (company_policy.pdf). Observability: Integrated with LangSmith and LangGraph to track end-to-end execution threads, tool latencies, and token expenditures.

Challenges we ran into

Production Deployment & CORS Configuration: Managing cross-origin communication between Vercel and Render while accounting for cold-start latency on Render's free tier required configuring precise FastAPI middleware and environment-driven origin variables.

Memory Constraints for RAG: Traditional dense vector embeddings introduced heavy RAM overhead that exceeded free-tier container limits. We solved this by implementing a lightweight BM25 statistical term-frequency retrieval pipeline, achieving instant keyword-based policy matching with zero memory bloat.

Segregation of Duties: Enforcing strict access boundaries so that employees could prompt the AI for research while preventing unauthorized users from triggering financial checkouts required robust JWT validation across both frontend route guards and backend API dependency injectors

Accomplishments that we're proud of

Successfully deploying a fully functional, production-grade full-stack AI application linking Next.js and FastAPI across independent cloud platforms.

Implementing a memory-efficient BM25 RAG engine that instantly validates purchase orders against complex corporate policy rules.

Integrating deep observability via LangSmith, enabling granular thread tracing, latency profiling, and token optimization across multi-step agent graphs.

What we learned

Production Observability: Gained deep insights into debugging multi-step agent workflows and optimizing token costs using LangSmith tracing.

Resilient Infrastructure Design: Mastered secure environment variable injection, CORS management, and seamless cross-origin communication across decoupled cloud deployments.

Enterprise Security Standards: Practical experience implementing stateless JWT authentication and role-based access control to satisfy rigorous compliance requirements.

What's next for AgentProcure AI

Advanced Multi-Vendor Comparison: Expanding the AI agent capabilities to automatically scrape and compare live pricing from external enterprise suppliers.

ERP System Integrations: Adding native connectors for popular enterprise resource planning systems like SAP and Oracle NetSuite.

Enhanced Evaluation Benchmarks: Leveraging LangSmith evaluation datasets to continuously test and refine agent accuracy under complex multi-item procurement scenarios.

Built With

  • agentprocure-ai
  • bm25-rag
  • enterprise
  • fastapi
  • groq
  • jwt-authentication
  • langchain
  • langgraph
  • langsmith
  • llama-3
  • model-context-protocol
  • next.js
  • paypal
  • policy-retriever
  • postgresql
  • pyjwt
  • python
  • rbac
  • react
  • render
  • sqlite
  • sqlmodel
  • tailwind-css
  • vercel
Share this project:

Updates

Submission history