Terminal & Interactive Chat
Relevant source files
The following files were used as context for generating this wiki page:
The Terminal & Interactive Chat system provides the primary interface for users to interact with Isabella AI. It combines a command-line interface (CLI) with natural language processing and multimodal capabilities to execute commands, generate content, and maintain governed cognitive dialogues.
Sources: src/components/Terminal/TerminalCommandLine.tsx, README.md
Interface Components
Terminal Command Line
The TerminalCommandLine component manages user input via a text area that supports multi-line entries and keyboard shortcuts. It features a prompt identified as isabella@crown:~$ and provides a ribbon for quick commands and voice interaction.
Sources: src/components/Terminal/TerminalCommandLine.tsx:103-140
| Feature | Description |
|---|---|
| History Navigation | Users navigate previous commands using ArrowUp and ArrowDown keys. |
| Command Prefix | Strings starting with / are processed as system commands via executeCommand. |
| Quick Commands | Predefined buttons for common interactions like greeting, status checks, and art generation. |
| Voice Ingestion | A microphone toggle enables Speech-to-Text (STT) for voice-driven prompts. |
Sources: src/components/Terminal/TerminalCommandLine.tsx:30-80
Perception Runner
Located within the Isabella Hub, the Perception Runner acts as a diagnostic and testing interface for chat inputs. It allows operators to simulate different input types and risk levels to observe the system's decision-making process.
Sources: src/components/Hub/IsabellaHubView.tsx:432-560
Cognitive Processing Pipeline
The chat system follows a canonical cycle to process inputs. When a user submits a message, the CROWN layer routes the tokens through several specialized modules before synthesizing a response.
Synaptic Routing Flow
The flow diagram illustrates the 5-step synaptic routing process:
- Input Ingestion: Ingests CLI prompts or API signals as tokens.
- ARGUS Sentinel: Validates the input against ethical filters and alignment scores.
- CROWN Gateway: Arbitrates state and routes the request to specialized cores.
- Tri-Modal Core: Processes the request through ISA (Empathy), SOPHIA (Logic), and ORION (Execution).
- Synthesized Output: Harmonizes results into a proactive, warm response.
Sources: src/components/Dashboard/SynapticFlowDiagram.tsx:100-240
The diagram shows the governed routing from user input through security and specialized cognitive modules to final output.
Sources: src/components/Dashboard/SynapticFlowDiagram.tsx, src/data/canonical-docs.ts
Backend Architecture
The backend handles chat execution through modular endpoints and a local episodic memory system. It operates fully in-process to maintain sovereignty.
Message Processing Endpoints
The Express server exposes several endpoints for chat and agent orchestration:
POST /api/isabella/process: The primary endpoint for cognitive synthesis and CROWN routing.POST /api/v1/isabella/agent/chat: Executes instructions within a leased agent session, providing thought streaming and tool interception.POST /api/v1/isabella/agent/stream: Provides real-time Server-Sent Events (SSE) for tokens and cognitive thoughts.
Sources: server.ts:983-1080, server.ts:1146-1210
Memory and Recommendations
The system utilizes a Jaccard similarity-based episodic memory to track interactions. It tokenizes inputs, excluding common stopwords, and registers "episodes" that include the actor, input, output, and emotional state.
Sources: src/lib/isabella.server.ts:15-55
The sequence diagram demonstrates the flow of a single chat request being processed and committed to local memory.
Sources: server.ts:1085-1140, src/lib/isabella.server.ts:44-50
Keyboard Shortcuts
The terminal interface supports specific hotkeys to improve operator efficiency.
Enter: Submit message.Ctrl+Enter/Cmd+Enter: Instant submit (ignores multi-line).Shift+Enter: Create a new line.Ctrl+K: Clear terminal.Ctrl+M: Toggle voice recording.
Sources: src/components/Terminal/TerminalCommandLine.tsx:55-100
Data Models
Chat messages are structured using a discriminated union to ensure type safety between user, assistant, and system roles.
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the message. |
kind | string | Discriminator (e.g., user_message, isabella_message). |
content | string | The text content of the message. |
cognitiveTelemetry | Object | Telemetry data including logic depth and resonance. |
routingDecision | Object | Details on how CROWN routed the message. |
Sources: src/types.ts:250-320
Summary
The Terminal & Interactive Chat system serves as the central orchestration point for human-AI interaction. By routing inputs through the CROWN and ARGUS layers, the project ensures that every dialogue is governed, secure, and territoriality conscious while providing high-performance features like thought streaming and persistent episodic memory.