AI Procurement Agent — Digital Employee
AI Procurement Agent automates routine supply department tasks: processing requests, comparing vendor offers, document verification, contract management, compliance monitoring. Reduces procurement cycle for standard items from several days to hours.
Processing Procurement Requests
from openai import AsyncOpenAI
from pydantic import BaseModel
from typing import Literal, Optional
client = AsyncOpenAI()
class PurchaseRequest(BaseModel):
item_name: str
quantity: float
unit: str
justification: str
requested_by: str
department: str
budget_code: str
urgency: Literal["urgent", "planned", "routine"]
estimated_budget: Optional[float]
preferred_vendor: Optional[str]
technical_requirements: Optional[str]
class ProcurementAgent:
async def process_request(self, request_text: str, requester: dict) -> dict:
"""Parses and processes procurement request"""
# Extract structured data
parsed = await client.beta.chat.completions.parse(
model="gpt-4o",
messages=[{
"role": "system",
"content": "Extract structured data from procurement request. If data missing — null."
}, {
"role": "user",
"content": f"Requester: {requester['name']}, {requester['department']}\nRequest: {request_text}",
}],
response_format=PurchaseRequest,
temperature=0,
)
pr = parsed.choices[0].message.parsed
# Check budget
budget_check = await self.check_budget_availability(
budget_code=pr.budget_code,
amount=pr.estimated_budget,
)
# Find historical data
similar_purchases = await self.find_similar_purchases(pr.item_name)
# Vendor recommendations
vendor_recommendations = await self.get_vendor_recommendations(
pr.item_name, pr.quantity, similar_purchases
)
return {
"request": pr.model_dump(),
"budget_status": budget_check,
"similar_history": similar_purchases[:3],
"vendor_recommendations": vendor_recommendations,
"auto_approve": self.can_auto_approve(pr, budget_check),
}
def can_auto_approve(self, pr: PurchaseRequest, budget_check: dict) -> bool:
"""Auto-approval for standard items within limits"""
return (
budget_check["available"]
and (pr.estimated_budget or 0) <= 50000 # Auto-approval limit 50k rubles
and pr.urgency != "urgent" # Urgent requires manual review
and pr.item_name.lower() not in self.non_standard_items
)
Analyzing Vendor Offers
async def compare_vendor_offers(
item: str,
quantity: float,
offers: list[dict],
technical_requirements: str = "",
) -> dict:
"""Analyzes and ranks vendor offers"""
comparison = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": """You are a procurement manager.
Evaluate vendor offers comprehensively: price, delivery terms, reliability, payment conditions.
Identify hidden risks (unrealistic timelines, unknown vendor, requirement mismatch)."""
}, {
"role": "user",
"content": f"""Item: {item}, quantity: {quantity}
Technical requirements: {technical_requirements}
Vendor offers:
{json.dumps(offers, ensure_ascii=False, indent=2)}
Create:
1. Comparison table by key parameters
2. Recommendation with justification
3. Risks of selected vendor"""
}],
)
return {
"analysis": comparison.choices[0].message.content,
"recommended_vendor": extract_recommendation(comparison.choices[0].message.content),
"comparison_table": extract_table(offers),
}
Practical Case Study: Manufacturing, 200 Requests/Month
Situation: 3 procurement managers, 200 requests/month, average cycle 7 days for standard items.
AI Agent Automated:
- Request intake and classification (Telegram + email)
- Budget limit verification in ERP
- Request for quotes from 3–5 vendors from registry
- Comparative analysis of offers
- Auto-approval < 50k rubles (62% of requests)
- Creating orders in ERP
Results:
- Standard procurement cycle: 7 days → 1.5 days
- Managers focus on: strategic vendors, negotiations, non-standard items
Timeline
- Request processing and classification: 1–2 weeks
- ERP and vendor database integration: 2–3 weeks
- Offer analysis: 1 week
- Approval workflow: 1 week
- Total: 5–7 weeks







