Chat Console Architecture
The console is centered around theChatConsolePanel, which orchestrates several specialized components and hooks to manage state and data flow.
Key Components
ChatConsolePanel: The root container that synchronizes sessions, run streams, and the inspector sidebar[apps/web/src/chat/ChatConsolePanel.tsx#70-76](http://apps/web/src/chat/ChatConsolePanel.tsx#70-76).ChatComposer: Handles user input, slash commands, file attachments, and context budget visualization[apps/web/src/chat/ChatComposer.tsx#53-84](http://apps/web/src/chat/ChatComposer.tsx#53-84).ChatTranscript: Renders the conversation history, including specialized blocks for tool payloads, approvals, and A2UI surfaces[apps/web/src/chat/ChatTranscript.tsx#27-42](http://apps/web/src/chat/ChatTranscript.tsx#27-42).ChatInspectorColumn: A secondary workspace panel for technical metadata, session lineage, and background task monitoring[apps/web/src/chat/ChatInspectorColumn.tsx#97-143](http://apps/web/src/chat/ChatInspectorColumn.tsx#97-143).
Data Flow: Message Submission
The following diagram illustrates the flow from a user typing a message to the daemon processing it. Message Submission and Recall Flow Sources:[apps/web/src/chat/ChatComposer.tsx](), [apps/web/src/chat/useRecallPreview.ts](), [apps/web/src/chat/ChatConsolePanel.tsx]()
ChatComposer and Slash Commands
The composer provides a command-line-like experience within the web UI using “Slash Commands”.Slash Command Implementation
Commands are defined inCHAT_SLASH_COMMANDS [apps/web/src/chat/chatShared.tsx#76-163](http://apps/web/src/chat/chatShared.tsx#76-163). The parseSlashCommand function extracts the command name and arguments from the raw text [apps/web/src/chat/chatShared.tsx#392-402](http://apps/web/src/chat/chatShared.tsx#392-402).
| Command | Usage | Description |
|---|---|---|
/new | /new [label] | Creates a fresh session [apps/web/src/chat/chatShared.tsx#84-88](http://apps/web/src/chat/chatShared.tsx#84-88). |
/branch | /branch [label] | Forks the current session from the latest run [apps/web/src/chat/chatShared.tsx#102-106](http://apps/web/src/chat/chatShared.tsx#102-106). |
/delegate | /delegate <profile> <text> | Spawns a sub-agent run [apps/web/src/chat/chatShared.tsx#114-119](http://apps/web/src/chat/chatShared.tsx#114-119). |
/compact | /compact [apply] | Triggers transcript compaction to save context [apps/web/src/chat/chatShared.tsx#145-150](http://apps/web/src/chat/chatShared.tsx#145-150). |
Context Budgeting
The UI calculates an estimated token count to prevent context window overflow.- Soft Limit: 12,000 tokens
[apps/web/src/chat/chatShared.tsx#22](http://apps/web/src/chat/chatShared.tsx#22). - Hard Limit: 16,000 tokens
[apps/web/src/chat/chatShared.tsx#23](http://apps/web/src/chat/chatShared.tsx#23). - Calculation:
buildContextBudgetSummaryaggregates baseline tokens, draft text, and attachment estimates[apps/web/src/chat/chatShared.tsx#244-290](http://apps/web/src/chat/chatShared.tsx#244-290).
[apps/web/src/chat/chatShared.tsx](), [apps/web/src/chat/ChatComposer.tsx]()
ChatTranscript and Tool Payloads
The transcript is not a simple text log; it is a structured feed ofTranscriptEntry objects [apps/web/src/chat/chatShared.tsx#186-203](http://apps/web/src/chat/chatShared.tsx#186-203).
Specialized Entry Types
- Tool Payloads: Large JSON outputs from tools are moved to the side panel to keep the transcript readable. The UI shows a “Payload moved to side panel” notice
[apps/web/src/chat/ChatTranscript.test.tsx#112-115](http://apps/web/src/chat/ChatTranscript.test.tsx#112-115). - Approval Blocks: Render
ApprovalRequestControlsfor human-in-the-loop decisions. Operators can select a scope (once,session, ortimeboxed)[apps/web/src/chat/chatShared.tsx#230-242](http://apps/web/src/chat/chatShared.tsx#230-242). - Canvas Iframes: If a tool returns a
canvas_url, the transcript renders a sandboxed<iframe>pointing to the Canvas API[apps/web/src/chat/ChatTranscript.tsx#233-245](http://apps/web/src/chat/ChatTranscript.tsx#233-245). - A2UI Documents: Dynamic UI surfaces pushed by agents are rendered using the
A2uiRenderer[apps/web/src/chat/ChatTranscript.tsx#217-224](http://apps/web/src/chat/ChatTranscript.tsx#217-224).
[apps/web/src/chat/ChatTranscript.tsx](), [apps/web/src/chat/chatShared.tsx](), [apps/web/src/chat/ChatConsolePanel.tsx]()
MemorySection: RAG Management
TheMemorySection provides administrative control over the agent’s long-term and short-term memory.
Workspace Documents
The “Workspace” represents curated knowledge (Markdown files).- CRUD Operations: Handled via
saveWorkspaceDocument,moveWorkspaceDocument, anddeleteWorkspaceDocument[apps/web/src/console/sections/MemorySection.tsx#58-61](http://apps/web/src/console/sections/MemorySection.tsx#58-61). - Pinning: Documents can be pinned to ensure they are always included in the agent’s context
[apps/web/src/console/sections/MemorySection.tsx#62](http://apps/web/src/console/sections/MemorySection.tsx#62).
Memory Purging and Maintenance
Operators can manually prune the SQLite-backed memory store:- Purge by Session: Deletes all memory items associated with a specific
session_id[apps/web/src/console/sections/MemorySection.tsx#30-31](http://apps/web/src/console/sections/MemorySection.tsx#30-31). - Purge by Channel: Deletes items from a specific connector channel
[apps/web/src/console/sections/MemorySection.tsx#28-29](http://apps/web/src/console/sections/MemorySection.tsx#28-29). - Global Purge: Clears all vector and FTS indexes
[apps/web/src/console/sections/MemorySection.tsx#32-33](http://apps/web/src/console/sections/MemorySection.tsx#32-33).
Recall Preview
ThepreviewMemoryRecall function allows operators to test search queries against the MemoryService and JournalStore to see what information the agent would retrieve for a given prompt [apps/web/src/console/sections/MemorySection.tsx#64](http://apps/web/src/console/sections/MemorySection.tsx#64).
Sources: [apps/web/src/console/sections/MemorySection.tsx](), [apps/web/src/chat/useRecallPreview.ts]()