examples
title: Examples (Bird's-Eye View) sidebar_position: 3 hide_table_of_contents: true
Examples (Bird's-Eye View + DML + Audit)
This page is the practical E2E companion to the V2 architecture. Each example shows:
- conversation UX
- runtime flow graph (interactive)
- DML seed rows
- expected audit stages
Canonical V2 Runtime Step Set
Step loop behavior
Step loop invokes each execute(session). If a step returns Stop, response returns immediately; otherwise loop continues.
1LoadOrCreateConversationStep
2CacheInspectAuditStep
3ResetConversationStep
4PersistConversationBootstrapStep
5AuditUserInputStep
6PolicyEnforcementStep
7DialogueActStep
8InteractionPolicyStep
9CorrectionStep
10ActionLifecycleStep
11DisambiguationStep
12GuardrailStep
13IntentResolutionStep
14ResetResolvedIntentStep
15FallbackIntentStateStep
16AddContainerDataStep
17PendingActionStep
18ToolOrchestrationStep
19McpToolStep
20SchemaExtractionStep
21AutoAdvanceStep
22RulesStep
23StateGraphStep
24ResponseResolutionStep
25MemoryStep
26PersistConversationStep
27PipelineEndGuardStep
FAQ
- Conversation + Flow
- DML Entries
- Audit Trail
FAQ
FAQ runtime flow
Basic Intent + Memory retention
FAQ seed SQL
SQL
INSERT INTO ce_intent (intent_code, description, priority, enabled)
VALUES ('FAQ', 'Answer informational questions from FAQ knowledge base', 10, true);
INSERT INTO ce_intent_classifier (intent_code, rule_type, pattern, priority, enabled)
VALUES ('FAQ', 'REGEX', '(?i)\b(what|how|help|faq|information|details|explain)\b', 10, true);
INSERT INTO ce_prompt_template (intent_code, state_code, response_type, system_prompt, user_prompt, temperature, enabled)
VALUES ('FAQ', 'IDLE', 'TEXT',
'You are a concise FAQ assistant. Answer directly and clearly.',
'User question: {{user_input}}
FAQ context: {{container_data}}
Return short helpful answer.',
0.10, true);
INSERT INTO ce_response (intent_code, state_code, output_format, response_type, derivation_hint, priority, enabled)
VALUES ('FAQ', 'IDLE', 'TEXT', 'DERIVED',
'Answer FAQ using available context and user question.', 10, true);
Expected audit stages (ordered)
| Order | Stage | Must contain |
|---|---|---|
| 1 | USER_INPUT | original user message |
| 2 | DIALOGUE_ACT_CLASSIFIED | dialogueAct=QUESTION |
| 3 | INTERACTION_POLICY_DECIDED | policyDecision=RECLASSIFY_INTENT |
| 4 | INTENT_RESOLVED | intent=FAQ |
| 5 | RESOLVE_RESPONSE_SELECTED | responseType=DERIVED |
| 6 | ASSISTANT_OUTPUT | output text or json payload |
| 7 | MEMORY_UPDATED | summaryChars/recalled flags |
CONNECTION_TRANSFER
- Conversation + Flow
- DML Entries
- Audit Trail
Connection transfer conversation
Connection Transfer Flow
Slot fill auto advance
Schema & Rules SQL
SQL
INSERT INTO ce_intent (intent_code, enabled) VALUES ('CONNECTION_TRANSFER', true);
INSERT INTO ce_output_schema (intent_code, format_type, schema_json, enabled)
VALUES ('CONNECTION_TRANSFER', 'JSON', '{"properties":{"customerId":{},"phone":{},"email":{},"sourceCity":{},"targetCity":{}}, "required":["customerId","phone","email","sourceCity","targetCity"]}', true);
INSERT INTO ce_rule (phase, intent_code, state_code, rule_type, match_pattern, "action", action_value, priority, enabled)
VALUES
('PRE_RESPONSE_RESOLUTION', 'CONNECTION_TRANSFER', 'IDLE', 'REGEX', '.*', 'SET_STATE', 'COLLECT_INPUTS', 10, true),
('PRE_RESPONSE_RESOLUTION', 'CONNECTION_TRANSFER', 'COLLECT_INPUTS', 'JSON_PATH',
'$[?(@.state == ''COLLECT_INPUTS'' && @.customerId && @.phone && @.email && @.sourceCity && @.targetCity)]',
'SET_STATE', 'AWAITING_CONFIRMATION', 100, true);
INSERT INTO ce_response (intent_code, state_code, response_type, output_format, enabled)
VALUES ('CONNECTION_TRANSFER', 'COLLECT_INPUTS', 'DERIVED', 'TEXT', true);
INSERT INTO ce_response (intent_code, state_code, response_type, output_format, enabled)
VALUES ('CONNECTION_TRANSFER', 'AWAITING_CONFIRMATION', 'DERIVED', 'TEXT', true);
Collection Turn Expected Trace
| Stage | Meaning |
|---|---|
| INTENT_RESOLVED | Intent locked to CONNECTION_TRANSFER |
| SCHEMA_INCOMPLETE | Signals partial JSON payload extraction |
| RULE_MATCH | Initial IDLE -> COLLECT_INPUTS switch |
| ASSISTANT_OUTPUT | Prompts for slot filling |
ORDER_CANCELLATION
- Conversation + Flow
- DML Entries
- Audit Trail
Protected Order Cancellation
Action Execution Flow (Turn 3)
Interaction Policy executing Pending Action
Pending Action Assignment SQL
SQL
INSERT INTO ce_intent (intent_code, enabled) VALUES ('CANCEL_ORDER', true);
INSERT INTO ce_pending_action (intent_code, state_code, action_key, bean_name, method_names, priority, enabled, description)
VALUES ('CANCEL_ORDER', 'CONFIRM_CANCEL', 'stripe_cancel', 'stripeCancelTask', 'execute', 10, true, 'Cancel the order in the provider system');
INSERT INTO ce_rule (intent_code, state_code, rule_type, rule_value, action, action_value, phase, priority, enabled)
VALUES ('CANCEL_ORDER', 'CONFIRM_CANCEL', 'EXACT', 'ANY', 'SET_STATE', 'CANCELLED', 'PRE_RESPONSE_RESOLUTION', 10, true);
INSERT INTO ce_prompt_template (intent_code, response_type, system_prompt, user_prompt, template_id, enabled)
VALUES ('CANCEL_ORDER', 'DERIVED', 'Format cleanly.', 'Order {{context.orderNumber}} has been completely cancelled.', 'tmpl_cancelled', true);
Action Commit Expected Trace
| Stage | Required Contents |
|---|---|
| DIALOGUE_ACT_CLASSIFIED | dialogueAct=AFFIRM |
| INTERACTION_POLICY_DECIDED | policyDecision=EXECUTE_PENDING_ACTION |
| PENDING_ACTION_EXECUTED | status=EXECUTED, pendingActionRef=stripeCancelTask |
| RULE_APPLIED | state -> CANCELLED |
INVENTORY_LOOKUP
- Conversation + Flow
- DML Entries
- Audit Trail
DB Orchestration Flow
Tool Request Flow
Tool orchestration injects payload
Virtual DB Binding SQL
SQL
INSERT INTO ce_mcp_tool (intent_code, tool_group, required_params_json, execution_timeout_ms, enabled)
VALUES ('DATABASE_QUERY', 'INVENTORY_DB', '["itemType", "warehouseId"]', 5000, true);
INSERT INTO ce_prompt_template (intent_code, response_type, system_prompt, user_prompt, template_id, enabled)
VALUES ('DATABASE_QUERY', 'DERIVED', 'You are an inventory assistant.', 'Answer from these database results: {{tool_result.dbList}}', 'tmpl_inventory_gen', true);
INSERT INTO ce_response (intent_code, state_code, response_type, template_id, priority, enabled)
VALUES ('DATABASE_QUERY', 'IDLE', 'DERIVED', 'tmpl_inventory_gen', 10, true);
Data Request Trace
| Stage | Context Checkpoint |
|---|---|
| TOOL_ORCHESTRATION_DISPATCH | toolGroup=INVENTORY_DB |
| TOOL_ORCHESTRATION_RESULT | toolResult={'count': 421} |
| ASSISTANT_OUTPUT | Final text uses 421 units output |
SUPPORT_DIAGNOSTIC
- Conversation + Flow
- DML Entries
- Audit Trail
Long Context Support Thread
Memory Summary Flow
Long-context retrieval during turn evaluation
Memory Auto-Summarization Config
YAML
convengine:
flow:
memory:
enabled: true
# Max token size for the compressed summary string
summary-max-chars: 1200
# Number of turns to trigger a new summary compression cycle
recent-turns-for-summary: 3
Memory Trace
| Stage | Context Action |
|---|---|
| MEMORY_INJECTED | old sequence of facts available to tool_result/intent logic |
| INTENT_RESOLVED | Supports historical context |
| MEMORY_UPDATED | newSummary generated and injected |
Fast validation
For each example run, inspect both /api/v2/conversation/audit/{conversationId} and /api/v2/conversation/audit/{conversationId}/trace.