Architecture Overview
Book is a modular, strictly layered system following Clean Architecture principles. Core logic stays independent of external frameworks β LLM providers, terminal rendering libraries, all of it.
This page is the architecture hub. The detail lives in two pages:
Architecture Overview β
:domaincore abstractions, logging architecture, design philosophies, key dependenciesModule Map β per-package breakdown of
:infrastructure,:core:providers:koog,:features:mcp,:features:acp, and:cli; architecture diagram catalogueRelated deep dives: Agent Loop Β· Koog Provider Layer Β· LiteRT-LM Provider Layer Β· Gallery App Integration Β· DI & Wiring Β· TUI Architecture + TUI Internals
The Six Modules
| Module | Ring | Summary |
|---|---|---|
|
Innermost |
Core abstractions and business logic: |
|
Middle |
Implements |
|
Outer adapter |
LLM integration via the Koog framework: |
|
Outer adapter |
On-device LLM integration via LiteRT-LM SDK: |
|
Outer adapter |
Self-contained MCP client. Public surface: |
|
Outer adapter |
ACP server for IDE integration. Per-session isolation, capability-driven environment. |
|
Outermost |
Clikt commands, TUI, DI graph ( |
Dependency direction: :cli β features/providers β :infrastructure β :domain. Nothing in an inner ring imports from an outer ring.
Where to go next
| If you want to⦠| Read |
|---|---|
Understand the domain abstractions & design rules |
|
Work on a specific module’s packages |
|
Understand the agent execution loop in depth |
|
Modify LLM integration / add a provider |
|
Trace the Metro DI graph |
|
Browse diagrams |