Architecture

Huginn is a single Go binary built around a TUI, an orchestrator, and a local Ollama backend.

High-level overview

┌─────────────────────────────────┐
│          TUI (Bubble Tea)       │
│   Input → Viewport → Wizard     │
└──────────────┬──────────────────┘

┌──────────────▼──────────────────┐
│         Orchestrator            │
│  Plan→Approve→Implement Loop    │
└───┬──────────────────────┬──────┘
    │                      │
┌───▼────────┐    ┌────────▼──────┐
│  Planner   │    │    Coder      │
│  (model)   │    │   (model)     │
└───┬────────┘    └────────┬──────┘
    │                      │
┌───▼──────────────────────▼──────┐
│        Ollama REST API          │
│      (local inference)          │
└──────────────┬──────────────────┘

┌──────────────▼──────────────────┐
│       Repo Indexer              │
│  git ls-files → chunking → BM25  │
│  + HNSW vectors (optional)      │
└─────────────────────────────────┘

Key components

ComponentLocationPurpose
TUIinternal/tui/Bubble Tea terminal interface
Orchestratorinternal/agent/Plan→Approve→Implement state machine
Named Agentsinternal/agents/Persistent personas + tiered memory
Toolsinternal/tools/File, git, bash, test tools
Repo Indexerinternal/repo/git ls-files + BM25 context
Semantic Searchinternal/search/BM25 + HNSW + RRF
Storageinternal/storage/Pebble KV (history, summaries, symbols)
MCPinternal/mcp/Model Context Protocol client
Skillsinternal/skills/Prompt + rules loading

Architecture Decision Records

Full ADRs are in the GitHub repository:

  • ADR-001 — Skills as packaging, not execution
  • ADR-002 — Tiered memory over raw history
  • ADR-003 — WebSocket relay protocol
  • ADR-004 — Per-machine agent identity