Skip to content

Architecture

┌─────────────────────────────────────────────────┐
│                    Hosts                         │
│  ┌───────────┐  ┌───────────┐  ┌─────────────┐  │
│  │  Desktop   │  │HTTP Server│  │  MCP Server  │  │
│  │  (Wails)   │  │  (Gin)    │  │ (stdio/SSE) │  │
│  └─────┬─────┘  └─────┬─────┘  └──────┬──────┘  │
│        └───────────────┼───────────────┘         │
│                   ┌────┴────┐                    │
│                   │ engine  │  ← single entry    │
│                   └────┬────┘                    │
│        ┌───────────────┼───────────────┐         │
│   ┌────┴────┐   ┌──────┴──────┐  ┌─────┴─────┐  │
│   │toolloop │   │conversation │  │    llm     │  │
│   └─────────┘   └─────────────┘  └───────────┘  │
│                      core/                       │
├─────────────────────────────────────────────────┤
│   gateway (OpenAPI)       mcp (MCP protocol)     │
│   bootstrap (init helper)                        │
└─────────────────────────────────────────────────┘

Layers

LayerPackageResponsibility
core/toolloop, conversation, llmPure logic. Tool-calling loop, conversation manager, LLM client. Zero external dependencies.
engine/engineThe only entry point for hosts. Isolates core internals.
service/serviceShared business logic: target CRUD, config management, LLM settings.
gateway/gatewayParses OpenAPI specs, builds LLM tool definitions, executes HTTP calls.
mcp/mcpBidirectional MCP support: expose tools or consume external MCP servers.
bootstrap/bootstrapInitialization helper: discovers tools, builds system prompts, wires everything up.

Hosts

All hosts go through engine/ — they never touch toolloop or conversation directly.

  • HTTP Server (server/) — Gin-based REST + SSE streaming.
  • Desktop (desktop/) — Wails v2 app with React frontend. Separate Go module.
  • MCP Server — Exposes NLUI tools via MCP stdio/SSE for Claude Desktop and other clients.