How namburivivek/ofoods-ai works
OFOODS AI combines a customer-facing food-commerce assistant with a human-reviewed revenue-recovery workflow. The shopping path runs from customer requests through the assistant and AI service to product discovery or cart actions; the existing commerce server handles the broader account, order, checkout, and payment lifecycle. Recovery analyzes drop-off context, predicts recovery likelihood, proposes a strategy, and exposes cases for admin review. Several connections below are documented in the README; source excerpts confirm the internal recovery calls and database operations. Other server and frontend details are only represented at the subsystem level.
Main entry points: llmService.js AI conversation service · agent.js Recovery agent · ai-assistant.js Shopping assistant · server.js Commerce API
Components 23
AI shopping
- Shopping assistant
frontend/ai-assistant.js
AI services
- AI conversation service
backend/ai/llmService.js - Intent detection
backend/ai/intentDetector.js - User context
backend/ai/userContextService.js - Product catalog
backend/ai/catalog.js - Product engine
backend/ai/productEngine.js - Knowledge retrieval
backend/ai/knowledge/knowledgeRetriever.js
Commerce platform
- AI request API
backend/server.js - Commerce API
backend/server.js - Frontend server
frontend/server.js - Cart and checkout
frontend/Checkout.html - Razorpay payments
backend/server.js - Commerce database
Revenue recovery
- Recovery agent
backend/ai/agent.js - Customer analysis
backend/ai/customerAnalyzer.js - Recovery prediction
backend/ai/recoveryPredictor.js - Recovery strategy
backend/ai/llmService.js - Recovery cases
- Recovery case API
backend/aiRecoveryRoutes.js
Admin review
- Recovery dashboard
frontend/ai-dashboard.js
Other components
- Customer
- Payment or cart drop-off
- Admin reviewer
Connections 24
- Customer → Shopping assistant: asks
README.md - Shopping assistant → AI request API: sends requests
README.md - AI request API → AI conversation service: invokes
backend/server.js - AI conversation service → Intent detection: detects intent
- AI conversation service → User context: uses context
backend/ai/llmService.js - AI conversation service → Product catalog: queries
backend/ai/llmService.js - AI conversation service → Product engine: uses recommendations
backend/ai/llmService.js - Product engine → Product catalog: searches
backend/ai/productEngine.js - AI conversation service → Knowledge retrieval: retrieves knowledge
- Shopping assistant → Cart and checkout: updates cart
README.md - Customer → Cart and checkout: checks out
README.md - Cart and checkout → Commerce API: submits order
- Commerce API → Commerce database: reads and writes
backend/server.js - Commerce API → Razorpay payments: handles payment
README.md - Payment or cart drop-off → Recovery agent: triggers
README.md - Recovery agent → Customer analysis: analyzes customer
backend/ai/agent.js - Customer analysis → Commerce database: queries history
backend/ai/customerAnalyzer.js - Recovery agent → Recovery prediction: calculates probability
backend/ai/agent.js - Recovery agent → Recovery strategy: requests strategy
backend/ai/agent.js - Recovery agent → Recovery cases: creates case
backend/ai/agent.js - Recovery case API → Recovery cases: reads and updates
backend/aiRecoveryRoutes.js - Recovery dashboard → Recovery case API: loads cases
- Admin reviewer → Recovery dashboard: reviews cases
README.md - Recovery dashboard → Recovery case API: submits decision