The system architecture
An interactive component map of the current working implementation: the advisor interface, shared agent service, configured model, local guidance and persistent records.
Explore architecture1. Understand the current request
The model classifies live advisor intent into one of six scenarios. Fixed-case evaluations specify the scenario separately. A new request must not be answered as an older birthday conversation merely because that text appears in history.
2. Assemble the right context
Business retrieval reads client and product data independently of test cases. Live requests do not implicitly load seeded messages, old summaries or database memories. Relevant history can be supplied explicitly. Persistent marketing opt-outs remain boundaries, even when other historical tasks are no longer current.
3. Load guidance and generate
The application loads the selected scenario skill and any configured modifier, then combines it with brand rules and structured facts. A real API adapter calls the configured model. There is no production template fallback, autonomous filesystem access or multi-agent tool loop.
4. Check, repair or stop
Deterministic rules check the three-candidate structure, Chinese text, price claims, stock language, marketing boundaries and care restrictions. A failed output can receive one repair call. A narrow off-task greeting check catches one known failure pattern; it is not a general semantic judge.
5. Store the actual attempt
Each request gets a run_id before model calls. Inputs, model metadata, versions, timing, attempt traces and final status are retained. Candidate and evaluation rows commit atomically. Draft candidates are not stored as messages already sent to the client.
6. Keep deployment simple
Docker Compose runs nginx in front of a Python backend, with a persistent SQLite volume. The database service initialises or migrates and exits. The current application is a single-instance demonstration; public model access still needs deployment controls and call limits.
The working pipeline
- CURRENT REQUEST → INTENT
- INTENT → SCENARIO SKILL
- FACTS + GUIDANCE → REAL MODEL
- THREE DRAFTS → CHECKS
- ONE REPAIR OR A CLEAR FAILURE
- RUN RECORD → ADVISOR CHOICE