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 │
└─────────┬─────────┘ └─────────────┘
│
▼
┌───────────────────┐ ┌─────────────┐
│ eyrie ChatClient │────►│ LLM API │ catalog, keychain, routing
│ (stream loop) │ │ (provider) │
└─────────┬─────────┘ └─────────────┘
│
▼
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: Loads
~/.hawk/provider.json, keychain credentials, and~/.eyrie/model_catalog.json. BuildsChatClientviaengine.BuildChatClient. - 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 —
client.Chat/ streaming with tool definitions fromtool.EyrieTools. - 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) |
Workspace checkouts live under external/{eyrie,yaad,tok} and are wired via root go.work.