How one user message travels through hawk and the GrayCodeAI ecosystem libraries.
User prompt (TUI or hawk exec)
│
▼
┌───────────────────┐
│ buildSystemPrompt │ AGENTS.md + prompt templates (practices.md)
└─────────┬─────────┘
│
▼
┌───────────────────┐ ┌─────────────┐
│ yaad recall │◄────│ ~/.yaad/ │ conventions, decisions, skills
│ (if bridge ready) │ │ yaad.db │
└─────────┬─────────┘ └─────────────┘
│
▼
┌───────────────────┐ ┌─────────────┐
│ tok token budget │ │ embedded │ CountTokens, CompressForContext
│ (context sizing) │ │ library │
└─────────┬─────────┘ └─────────────┘
│
▼
┌───────────────────┐ ┌─────────────┐
│ Hawk ChatClient │────►│ eyrie/engine│ catalog, credentials, routing
│ port + adapter │ │ generate/ │────► provider API
└─────────┬─────────┘ │ stream │
└─────────────┘
│
▼
Tool calls (Read, Edit, Bash, CoreMemory*, …)
│
├──► yaad Remember (CoreMemory tools, auto-remember)
│
▼
Response to user
│
▼ (when context grows)
┌───────────────────┐
│ tok Compress │ fast path before LLM summarization
│ + eyrie compact │
└───────────────────┘
- eyrie: The Hawk composition root creates an
eyrie/engine.Enginewith Eyrie-owned state paths, an injected secret store, and per-engine custom gateway metadata. The engine loads provider state and the model catalog, then builds transport behind Hawk'sChatClientport. - yaad:
configureSessioncreatesYaadBridge→ opens~/.yaad/data/yaad.db. If missing, hawk runs without persistent memory. - tok: No startup step — linked at compile time.
- Hawk templates (
internal/prompts/templates/*.md) define behavior, tools, and practices. - Project
AGENTS.mdis appended viahawkconfig.BuildContextWithDirs. - yaad:
Memory.Recallinjects relevant graph nodes into the system prompt.
Each turn:
- yaad — recall memories matching the latest user message (token budget ~2000).
- eyrie — Hawk's adapter calls engine generate/stream with Hawk-owned tool definitions; Eyrie normalizes provider events and tool requests.
- Tools run with
YaadBridgein context forCoreMemory*tools. - yaad — sleeptime consolidation, skill distillation, auto-remember after turns.
When messages exceed limits (internal/engine/compact.go):
- tok —
tok.Compress()tries a fast compression path for summaries. - eyrie — if tok reduction is insufficient, hawk calls the LLM to summarize, then keeps recent messages.
internal/engine/token/tokenizer.gowraps tok for precise and fast estimates used in budget UI and compaction decisions.
hawk doctor # ecosystem panel + eyrie preflight + yaad status
hawk yaad # inspect memory graph
./scripts/smoke-hawk.sh # build + quick tests| Module | Role in hawk | Required? |
|---|---|---|
| eyrie | LLM APIs, catalog, credentials, routing | Yes |
| yaad | SQLite memory graph at ~/.yaad/data/ |
No (degrades gracefully) |
| tok | Token estimate + context compression | Yes (embedded, no config) |
Pinned support-repo submodules live under external/{eyrie,yaad,tok} and are
wired via root go.work.
Production Hawk code imports Eyrie only through eyrie/engine. Conversation
history, WAL/resume, permissions, and tool execution remain in Hawk; provider
credentials, discovery, selection, transport, resilience, and normalized
streaming remain in Eyrie.