|
@@ -1,9 +1,17 @@
|
|
|
# ChatAgent / EventAgent Production Events Design
|
|
# ChatAgent / EventAgent Production Events Design
|
|
|
|
|
|
|
|
-**Status:** approved design
|
|
|
|
|
|
|
+**Status:** implemented in Agent Lab by Todos 45-50; Todo 51 closeout in progress
|
|
|
|
|
|
|
|
**Date:** 2026-07-12
|
|
**Date:** 2026-07-12
|
|
|
|
|
|
|
|
|
|
+**Implementation links:** [Todo 45 generic event kernel](todo-45-generic-event-kernel.md),
|
|
|
|
|
+[Todo 46 invocation modes](todo-46-configurable-tool-invocation-mode.md),
|
|
|
|
|
+[Todo 47 built-in plugins](todo-47-built-in-event-plugins.md),
|
|
|
|
|
+[Todo 48 parallel batches](todo-48-parallel-event-batches.md),
|
|
|
|
|
+[Todo 49 UI/session restore](todo-49-tool-mode-ui-session-restore.md),
|
|
|
|
|
+[Todo 50 comparable metrics](todo-50-comparable-model-tool-metrics.md), and
|
|
|
|
|
+[Todo 51 comparison closeout](todo-51-comparison-matrix-closeout.md).
|
|
|
|
|
+
|
|
|
## 1. Goal
|
|
## 1. Goal
|
|
|
|
|
|
|
|
Evaluate two configurable capability-invocation architectures for the service voice-reply path, primarily targeting a low-latency conversational toy:
|
|
Evaluate two configurable capability-invocation architectures for the service voice-reply path, primarily targeting a low-latency conversational toy:
|
|
@@ -49,10 +57,10 @@ Initial mapping:
|
|
|
|
|
|
|
|
| Event | Result policy |
|
|
| Event | Result policy |
|
|
|
| --- | --- |
|
|
| --- | --- |
|
|
|
-| `terminate_session` | `terminate` |
|
|
|
|
|
-| `adjust_device_volume` | `silent_success` |
|
|
|
|
|
-| `add_schedule` | `template_follow_up` |
|
|
|
|
|
-| `web_search` | `llm_follow_up` |
|
|
|
|
|
|
|
+| `session.terminate` | `terminate` |
|
|
|
|
|
+| `device.volume.adjust` | `silent_success` |
|
|
|
|
|
+| `calendar.schedule.create` | `template_follow_up` |
|
|
|
|
|
+| `knowledge.web.search` | `llm_follow_up` |
|
|
|
|
|
|
|
|
### 2.1 Experimental consistency contract
|
|
### 2.1 Experimental consistency contract
|
|
|
|
|
|
|
@@ -62,7 +70,7 @@ The comparison must not become two separate implementations. Both modes use:
|
|
|
- the same ChatAgent model, persona prompt, user-visible conversational history, sampling parameters, and output budget, except for the minimum mode-specific event/tool instruction;
|
|
- the same ChatAgent model, persona prompt, user-visible conversational history, sampling parameters, and output budget, except for the minimum mode-specific event/tool instruction;
|
|
|
- the same normalized internal `EventBatch` and event IDs;
|
|
- the same normalized internal `EventBatch` and event IDs;
|
|
|
- the same deterministic resolvers, validators, optional low-cost LLM fallback, handlers, timeouts, retries, idempotency keys, concurrency rules, and terminal barriers;
|
|
- the same deterministic resolvers, validators, optional low-cost LLM fallback, handlers, timeouts, retries, idempotency keys, concurrency rules, and terminal barriers;
|
|
|
-- the same result policies and user-visible behavior, including the two-answer `web_search` flow;
|
|
|
|
|
|
|
+- the same result policies and user-visible behavior, including the two-answer `knowledge.web.search` flow;
|
|
|
- the same audit event names and metric definitions.
|
|
- the same audit event names and metric definitions.
|
|
|
|
|
|
|
|
Only these variables change:
|
|
Only these variables change:
|
|
@@ -149,7 +157,7 @@ The flat plugin registry should evolve only when real additions reveal repeated
|
|
|
|
|
|
|
|
1. The user expresses a clear intention to leave or end the voice conversation.
|
|
1. The user expresses a clear intention to leave or end the voice conversation.
|
|
|
2. ChatAgent immediately streams a short, natural farewell.
|
|
2. ChatAgent immediately streams a short, natural farewell.
|
|
|
-3. ChatAgent requests `terminate_session` through the configured text-event or native tool-call protocol.
|
|
|
|
|
|
|
+3. ChatAgent requests `session.terminate` through the configured text-event or native tool-call protocol.
|
|
|
4. EventAgent executes a dialogue-session termination command.
|
|
4. EventAgent executes a dialogue-session termination command.
|
|
|
5. On success, the runtime marks the session terminal and suppresses another ChatAgent round.
|
|
5. On success, the runtime marks the session terminal and suppresses another ChatAgent round.
|
|
|
6. On failure, the runtime records the failure and may emit one concise corrective message instead of pretending that the session ended.
|
|
6. On failure, the runtime records the failure and may emit one concise corrective message instead of pretending that the session ended.
|
|
@@ -160,7 +168,7 @@ This event should terminate the dialogue through the dialogue/session boundary.
|
|
|
|
|
|
|
|
1. The user asks for an absolute volume, relative change, mute, or unmute.
|
|
1. The user asks for an absolute volume, relative change, mute, or unmute.
|
|
|
2. ChatAgent immediately acknowledges the requested action naturally.
|
|
2. ChatAgent immediately acknowledges the requested action naturally.
|
|
|
-3. ChatAgent requests `adjust_device_volume` through the configured protocol.
|
|
|
|
|
|
|
+3. ChatAgent requests `device.volume.adjust` through the configured protocol.
|
|
|
4. EventAgent resolves normalized arguments such as:
|
|
4. EventAgent resolves normalized arguments such as:
|
|
|
- `mode`: `absolute`, `relative`, `mute`, or `unmute`;
|
|
- `mode`: `absolute`, `relative`, `mute`, or `unmute`;
|
|
|
- `value`: an absolute target when present;
|
|
- `value`: an absolute target when present;
|
|
@@ -173,7 +181,7 @@ Validation must clamp or reject values outside the supported range and must dist
|
|
|
### 3.3 Add schedule
|
|
### 3.3 Add schedule
|
|
|
|
|
|
|
|
1. The user asks the toy to remember a future activity, reminder, or calendar item.
|
|
1. The user asks the toy to remember a future activity, reminder, or calendar item.
|
|
|
-2. ChatAgent immediately acknowledges the request naturally and requests `add_schedule` through the configured protocol.
|
|
|
|
|
|
|
+2. ChatAgent immediately acknowledges the request naturally and requests `calendar.schedule.create` through the configured protocol.
|
|
|
3. EventAgent first attempts deterministic extraction and normalization of:
|
|
3. EventAgent first attempts deterministic extraction and normalization of:
|
|
|
- title or activity;
|
|
- title or activity;
|
|
|
- local date and time;
|
|
- local date and time;
|
|
@@ -189,7 +197,7 @@ Schedule execution must use an idempotency key so retransmission or duplicate ev
|
|
|
### 3.4 Web search with two answers
|
|
### 3.4 Web search with two answers
|
|
|
|
|
|
|
|
1. ChatAgent immediately gives a useful preliminary response in a natural tone.
|
|
1. ChatAgent immediately gives a useful preliminary response in a natural tone.
|
|
|
-2. When freshness or external facts matter, ChatAgent mentions that it will check and requests `web_search` through the configured protocol after the visible reply where the provider supports content plus tool calls.
|
|
|
|
|
|
|
+2. When freshness or external facts matter, ChatAgent mentions that it will check and requests `knowledge.web.search` through the configured protocol after the visible reply where the provider supports content plus tool calls.
|
|
|
3. EventAgent derives a focused search query from the current user request and relevant conversation history.
|
|
3. EventAgent derives a focused search query from the current user request and relevant conversation history.
|
|
|
4. The search adapter returns structured results, including query, answer evidence, source title, source location, and retrieval time where available.
|
|
4. The search adapter returns structured results, including query, answer evidence, source title, source location, and retrieval time where available.
|
|
|
5. The runtime sends a compact search-result summary back to ChatAgent.
|
|
5. The runtime sends a compact search-result summary back to ChatAgent.
|
|
@@ -215,8 +223,8 @@ Examples that may run concurrently:
|
|
|
Conflict policy:
|
|
Conflict policy:
|
|
|
|
|
|
|
|
- duplicate event names are deduplicated only when their normalized arguments are equivalent;
|
|
- duplicate event names are deduplicated only when their normalized arguments are equivalent;
|
|
|
-- read-only events such as `web_search` may run alongside side-effecting events;
|
|
|
|
|
-- `terminate_session` is dispatched after other accepted events have reached a terminal result, with a short overall deadline, so ending the dialogue does not cancel an already acknowledged schedule or device action;
|
|
|
|
|
|
|
+- read-only events such as `knowledge.web.search` may run alongside side-effecting events;
|
|
|
|
|
+- `session.terminate` is dispatched after other accepted events have reached a terminal result, with a short overall deadline, so ending the dialogue does not cancel an already acknowledged schedule or device action;
|
|
|
- an event failure does not cancel unrelated events;
|
|
- an event failure does not cancel unrelated events;
|
|
|
- follow-up outputs are aggregated by policy: deterministic confirmations first, then at most one ChatAgent LLM follow-up for all results that require natural synthesis.
|
|
- follow-up outputs are aggregated by policy: deterministic confirmations first, then at most one ChatAgent LLM follow-up for all results that require natural synthesis.
|
|
|
|
|
|
|
@@ -274,7 +282,7 @@ EventAgent should receive:
|
|
|
- the smallest relevant slice of user/assistant conversation history;
|
|
- the smallest relevant slice of user/assistant conversation history;
|
|
|
- EventAgent-specific instructions and runtime metadata needed for execution.
|
|
- EventAgent-specific instructions and runtime metadata needed for execution.
|
|
|
|
|
|
|
|
-For `web_search`, only the compact result summary enters the second ChatAgent call. Raw provider payloads stay in audit/debug data.
|
|
|
|
|
|
|
+For `knowledge.web.search`, only the compact result summary enters the second ChatAgent call. Raw provider payloads stay in audit/debug data.
|
|
|
|
|
|
|
|
For deterministic resolution, no EventAgent LLM request is made. When fallback is needed, EventAgent should use a lower-cost model and a small token limit because its output is structured arguments rather than conversational text.
|
|
For deterministic resolution, no EventAgent LLM request is made. When fallback is needed, EventAgent should use a lower-cost model and a small token limit because its output is structured arguments rather than conversational text.
|
|
|
|
|
|
|
@@ -319,10 +327,10 @@ Each repository plan must load that repository's `AGENTS.md` and maintain its ow
|
|
|
- Both modes are prompted to emit the natural first response before event execution; if a native tool provider suppresses visible content until after tool execution, that is recorded as a direct-mode behavior/consistency failure rather than hidden by the harness.
|
|
- Both modes are prompted to emit the natural first response before event execution; if a native tool provider suppresses visible content until after tool execution, that is recorded as a direct-mode behavior/consistency failure rather than hidden by the harness.
|
|
|
- Hidden event blocks never appear in user-visible deltas.
|
|
- Hidden event blocks never appear in user-visible deltas.
|
|
|
- Deterministic argument resolution bypasses the EventAgent LLM, while incomplete or ambiguous cases use the configured fallback.
|
|
- Deterministic argument resolution bypasses the EventAgent LLM, while incomplete or ambiguous cases use the configured fallback.
|
|
|
-- `terminate_session` yields farewell -> accepted sibling events finish or time out -> successful termination -> no second ChatAgent call.
|
|
|
|
|
-- `adjust_device_volume` yields acknowledgement -> action result, with no second answer on success and a corrective answer on failure.
|
|
|
|
|
-- `add_schedule` yields acknowledgement -> normalized execution -> deterministic confirmation, without a second LLM call.
|
|
|
|
|
-- `web_search` yields first answer -> search execution -> distinct second answer grounded in the returned result.
|
|
|
|
|
|
|
+- `session.terminate` yields farewell -> accepted sibling events finish or time out -> successful termination -> no second ChatAgent call.
|
|
|
|
|
+- `device.volume.adjust` yields acknowledgement -> action result, with no second answer on success and a corrective answer on failure.
|
|
|
|
|
+- `calendar.schedule.create` yields acknowledgement -> normalized execution -> deterministic confirmation, without a second LLM call.
|
|
|
|
|
+- `knowledge.web.search` yields first answer -> search execution -> distinct second answer grounded in the returned result.
|
|
|
- Multiple independent events execute concurrently, preserve input order in reported results, and isolate failures.
|
|
- Multiple independent events execute concurrently, preserve input order in reported results, and isolate failures.
|
|
|
- A mixed batch produces at most one extra ChatAgent LLM call even when several events require natural follow-up.
|
|
- A mixed batch produces at most one extra ChatAgent LLM call even when several events require natural follow-up.
|
|
|
- Search failure still yields a natural, non-blocking second message.
|
|
- Search failure still yields a natural, non-blocking second message.
|