IntelligenceX

IX Chat Architecture

Edit on GitHub

Dual-process architecture, named pipe IPC, and tool registry design.

IX Chat Architecture

IX Chat uses a dual-process architecture to separate UI concerns from AI provider communication.

Process Model

flowchart LR
    classDef ui fill:#BAE6FD,stroke:#0369A1,color:#082F49,stroke-width:2px;
    classDef host fill:#DDD6FE,stroke:#5B21B6,color:#2E1065,stroke-width:2px;
    UI["UI Process<br/>(WinUI 3)<br/><br/>- Window management<br/>- Tray icon<br/>- WebView2 chat"]
    HOST["Host Process<br/>(Console App)<br/><br/>- AI providers<br/>- Tool execution<br/>- Thread storage"]
    UI <-->|"Named pipe (JSON-RPC)"| HOST

    class UI ui;
    class HOST host;

UI Process

The UI process is a WinUI 3 application responsible for:

  • Window Management -- Show/hide chat window, minimize to tray
  • Tray Icon -- System tray integration via H.NotifyIcon
  • Chat Rendering -- WebView2 hosts an embedded HTML/CSS/JS chat interface
  • User Input -- Captures messages and forwards to host via named pipe

The UI process has no direct dependency on AI providers or network access.

Host Process

The host process is a console application that handles:

  • Provider Communication -- Connects to ChatGPT or Copilot via IntelligenceX library
  • Tool Execution -- Manages the tool registry and executes tool calls
  • Thread Storage -- Persists conversation threads to local JSON files
  • Authentication -- Handles OAuth flows and credential storage

Named Pipe IPC

The two processes communicate via a named pipe:

  • Pipe name: IntelligenceX.Chat.{ProcessId}
  • Protocol: JSON-RPC 2.0 messages
  • Direction: Bidirectional (request/response and notifications)

Message Types

TypeDirectionPurpose
chat.sendUI -> HostSend a user message
chat.responseHost -> UIStream AI response chunks
chat.toolCallHost -> UINotify about tool execution
auth.statusHost -> UIAuthentication state changes
thread.listUI -> HostRequest conversation list

Tool Registry

Tools are registered at startup from installed tool packs:

  1. Host scans for IntelligenceX.Tools.* assemblies
  2. Each tool pack registers its tools with the tool registry
  3. When the AI requests a tool call, the host executes it locally
  4. Results are sent back to the AI provider for the next response

Storage Paths

DataLocation
Conversations%APPDATA%/IntelligenceX/threads/
Configuration%APPDATA%/IntelligenceX/config.json
Auth tokens%APPDATA%/IntelligenceX/auth/
Logs%APPDATA%/IntelligenceX/logs/