How bobbibao/ecommerce-with-agentic-ai works
This monorepo combines an e-commerce application with a Python continuous-improvement agent. The principal workflow observes shop operations, investigates anomalies using SOPs and prior cases, requests a bounded human decision, applies approved changes through the shop API, measures KPI impact, and records outcomes for reuse. The graph also preserves the storefront, administration, and CI Console capabilities. Several agent and web subsystems are represented by their existing enclosing directories because their implementation files were not sampled; their connections follow the README’s documented loop rather than inferred source calls.
Main entry points: api Shop and agent APIs · app.py Agent HTTP API · Database.Provider.ts Shop database · detect_signals.py Signal detection
Components 21
Improvement agent
- Agent HTTP API
apps/agent-service/src/ci_agent/interfaces/http/app.py - Signal detection
apps/agent-service/src/ci_agent/application/use_cases/detect_signals.py - Case investigation
apps/agent-service/src/ci_agent/application/use_cases/investigate.py - Reasoning engine
apps/agent-service/src/ci_agent/infrastructure/reasoning/llm_reasoner.py - Improvement planning
apps/agent-service/src/ci_agent/application/use_cases/plan_improvement.py - Human approval
apps/agent-service/src/ci_agent/application/use_cases/ask_human.py - Plan execution
apps/agent-service/src/ci_agent/application/use_cases/execute_plan.py - KPI measurement
apps/agent-service/src/ci_agent/application/use_cases/measure_outcome.py - Outcome learning
apps/agent-service/src/ci_agent/application/use_cases/learn.py - Agent case store
apps/agent-service/src/ci_agent/infrastructure/persistence/postgres
E-commerce shop
- E-commerce app
apps/web-ecommerce/server.ts - Shop database
apps/web-ecommerce/src/core/server/database/Database.Provider.ts - Storefront commerce
apps/web-ecommerce/src/core/client/features - Shop administration
apps/web-ecommerce/src/core/client/features
Shop integration
- Shop and agent APIs
apps/web-ecommerce/src/app/api - CI Console
apps/web-ecommerce/src/core/client/features/ci-console
Human channels
- Notification delivery
apps/agent-service/src/ci_agent/application/services/notification_service.py - Email, Telegram, Zalo, web
Other components
- Shop operator
- Shop customer
- Human decision-maker
Connections 26
- Shop operator → Agent HTTP API: starts or reviews
README.md - Agent HTTP API → Signal detection: runs loop
README.md - Signal detection → Case investigation: finds anomalies
README.md - Case investigation → Reasoning engine: reasons against SOPs
README.md - Case investigation → Improvement planning: informs plan
README.md - Improvement planning → Human approval: requests decision
README.md - Human approval → Notification delivery: delivers question
README.md - Notification delivery → Email, Telegram, Zalo, web: sends via
README.md - Email, Telegram, Zalo, web → Human decision-maker: collects decision
README.md - Human approval → Plan execution: acts when approved
README.md - Plan execution → Shop and agent APIs: applies approved change
README.md - Shop and agent APIs → Shop database: reads and writes
apps/web-ecommerce/src/app/api/ApiBase.Controller.ts - Signal detection → Shop database: observes operations
README.md - KPI measurement → Shop database: measures KPI impact
README.md - Plan execution → KPI measurement: precedes measurement
README.md - KPI measurement → Outcome learning: records outcome
README.md - Outcome learning → Agent case store: stores reusable case
README.md - Agent HTTP API → Agent case store: persists agent state
apps/agent-service/src/ci_agent/interfaces/http/app.py - Shop customer → Storefront commerce: shops
README.md - Storefront commerce → Shop and agent APIs: uses shop APIs
- Shop operator → Shop administration: manages shop
README.md - Shop operator → CI Console: reviews improvements
README.md - CI Console → Shop and agent APIs: uses CI APIs
- E-commerce app → Shop database: initializes database
apps/web-ecommerce/server.ts - E-commerce app → Shop and agent APIs: mounts API routes
- Agent HTTP API → Human decision-maker: asks for bounded decision
README.md