How physics0070/autonomous-procurement-assistant- works
Autonomous Procurement Assistant is a web platform for collecting supplier quotations, turning varied documents into auditable normalized data, comparing suppliers, and supporting approval-gated procurement actions. The main workflow runs from the browser through API routes and shared ingestion into staged document processing, then validation, normalization, matching, and comparison. Separate branches cover Gmail collection, agent-assisted decisions, communications and purchase orders, and analytics/ML. Edges follow README-described flows or indexed source references; several route and service implementations were not sampled, so those links are documented rather than inferred from names.
Main entry points: routes API routes · pipeline.py Processing pipeline · supervisor.py Agent orchestration · ingestion.py Document intake
Components 24
Web experience
- Web application
frontend/src/App.tsx - API client
frontend/src/lib/api.ts
API and access
- API routes
backend/app/api/routes - Tenant access
backend/app/api/deps.py - Quotation repository
backend/app/repositories/quotations.py
Quotation processing
- Document intake
backend/app/services/documents/ingestion.py - Gmail collection
backend/app/services/channels/gmail_sync.py - Processing pipeline
backend/app/services/documents/pipeline.py - File extraction
backend/app/services/documents/processor.py - AI extraction
backend/app/services/documents/ai_extraction.py - AI provider routing
backend/app/integrations/ai/factory.py - Extraction validation
backend/app/services/procurement/validation.py - Canonical normalization
backend/app/services/procurement/normalizer_service.py
Procurement decisions
- Product matching
backend/app/services/procurement/matching.py - Supplier comparison
backend/app/services/procurement/comparison.py - Agent orchestration
backend/app/services/agents/supervisor.py - Record assistant
backend/app/services/agents/assistant.py
Actions and intelligence
- Draft communications
backend/app/services/automation/communications.py - Purchase orders
backend/app/services/automation/purchase_orders.py - Spend analytics
backend/app/services/analytics/spend.py - Supplier risk ML
backend/app/services/analytics/reliability_ml.py - Forecast and anomaly models
backend/ml
Other components
- Procurement user
- MongoDB
Connections 25
- Procurement user → Web application: uses
- Web application → API client: requests data
- API client → API routes: calls API
- API routes → Tenant access: checks access
backend/app/api/deps.py - API routes → Document intake: submits uploads
- Gmail collection → Document intake: submits messages
- Document intake → Quotation repository: creates record
backend/app/services/documents/ingestion.py - Processing pipeline → File extraction: extracts content
backend/app/services/documents/pipeline.py - Processing pipeline → AI extraction: structures data
backend/app/services/documents/pipeline.py - AI extraction → AI provider routing: requests model
backend/app/services/documents/ai_extraction.py - Processing pipeline → Extraction validation: validates extraction
backend/app/services/documents/pipeline.py - Processing pipeline → Canonical normalization: normalizes data
backend/app/services/documents/pipeline.py - Processing pipeline → Product matching: matches items
backend/app/services/documents/pipeline.py - Product matching → Supplier comparison: feeds comparison
- Agent orchestration → Supplier comparison: routes specialists
- Agent orchestration → Draft communications: coordinates drafting
- Agent orchestration → Purchase orders: coordinates ordering
- Record assistant → API routes: serves questions
backend/app/api/routes/agents.py - API routes → Draft communications: requests drafts
backend/app/api/routes/automation.py - API routes → Purchase orders: manages orders
backend/app/api/routes/automation.py - API routes → Spend analytics: serves analytics
backend/app/api/routes/analytics.py - API routes → Supplier risk ML: serves risk
backend/app/api/routes/analytics.py - Spend analytics → Forecast and anomaly models: uses models
backend/app/api/routes/analytics.py - Supplier risk ML → Forecast and anomaly models: scores risk
- Quotation repository → MongoDB: reads and writes