How mr-zelong/e-commerce-smart-agent works
E-commerce Smart Agent is a full-stack customer-service product: a customer asks about orders, policies, products, or carts; the backend recognizes intent, routes work to specialized agents and tools, and returns a response, with high-risk cases eligible for human review. The repository also documents configurable agent routing, memory, knowledge retrieval, safety and privacy controls, evaluation, and operational monitoring. The graph emphasizes relationships visible in excerpts or the README; some documented capabilities have no verified runtime connections in the sampled source.
Main entry points: main.py Application Startup · service.py Intent Recognition · vector_manager.py Vector Memory · workflow.py Agent Workflow
Components 27
Customer Experience
- Customer UI
frontend/src/apps/customer/App.tsx - Chat API
app/api/v1/chat.py
Conversation Orchestration
- Intent Recognition
app/intent/service.py - Intent Router
app/agents/router.py - Agent Workflow
app/graph/workflow.py - Agent Supervisor
app/agents/supervisor.py - Application Startup
app/main.py
Commerce Operations
- Domain Agents
app/agents - Commerce Tools
app/tools - Order and Refund Services
app/services/order_service.py
Memory and Knowledge
- Structured Memory
app/memory/structured_manager.py - Vector Memory
app/memory/vector_manager.py - Knowledge Retrieval
app/retrieval/retriever.py
Safety and Operations
- Output Safety
app/safety - PII Filtering
app/context/pii_filter.py - Review Queue API
app/api/v1/admin/review_queue.py - Review Queue Service
app/services/review_queue.py - Review Records
app/models/review.py - Admin Console
frontend/src/apps/admin/App.tsx - Evaluation
app/evaluation/pipeline.py - Observability
app/observability/metrics.py - Alert Service
app/services/alert_service.py - Alert Tasks
app/tasks/alert_tasks.py - Alert Records
app/models/alert.py
Other components
- Customer
- Qdrant
- LLM Provider
Connections 28
- Customer → Customer UI: uses
README.md - Application Startup → Chat API: mounts routes
app/main.py - Application Startup → Intent Recognition: initializes
app/main.py - Application Startup → Intent Router: initializes
app/main.py - Application Startup → LLM Provider: creates client
app/main.py - Intent Router → Intent Recognition: recognizes intent
app/agents/router.py - Intent Recognition → LLM Provider: classifies with
app/intent/service.py - Intent Recognition → Structured Memory: caches results
app/intent/service.py - Application Startup → Knowledge Retrieval: initializes
app/main.py - Application Startup → Commerce Tools: registers tools
app/main.py - Vector Memory → PII Filtering: filters content
app/memory/vector_manager.py - Vector Memory → Qdrant: queries and writes
app/memory/vector_manager.py - Vector Memory → Knowledge Retrieval: embeds with
app/memory/vector_manager.py - Review Queue API → Review Queue Service: calls
app/api/v1/admin/review_queue.py - Review Queue Service → Review Records: uses records
app/services/review_queue.py - Alert Tasks → Alert Service: calls
app/tasks/alert_tasks.py - Alert Tasks → Alert Records: uses records
app/tasks/alert_tasks.py - Alert Service → Alert Records: manages alerts
app/services/alert_service.py - Evaluation → Intent Recognition: evaluates
app/evaluation/pipeline.py - Evaluation → Agent Workflow: runs graph
app/evaluation/pipeline.py - Customer UI → Chat API: sends chat
- Agent Workflow → Agent Supervisor: dispatches agents
- Agent Supervisor → Domain Agents: dispatches work
- Domain Agents → Commerce Tools: uses tools
- Domain Agents → Order and Refund Services: handles commerce requests
- Agent Workflow → Output Safety: checks responses
- Admin Console → Review Queue API: manages reviews
- Observability → Alert Service: drives alerting