Architecture
The system on one machine
Everything runs on your machine, except the model when you pick a remote provider. There are two kinds of process: one daemon, and any number of clients.
One daemon, any number of clients
Everything runs on your machine, except the model when you pick a hosted one. Click a part to see what it does and which chapter explains it, or follow one message from your keyboard to the model and back.
What talks to what, and how:
- Client to daemon. A Unix socket file. Each line is one JSON-RPC 2.0 object. No network port is opened.
- Inside the daemon. Ordinary Python calls in one asyncio process. A run is an asyncio task. The graph is a library the session manager calls. It is not a second process.
- Daemon to model. HTTPS to Anthropic, OpenAI, or another hosted provider, or plain HTTP to Ollama's native API. The model router resolves each session's model name to one of them.
- Daemon to disk. SQLite files under
~/.golem.checkpoints.dbis written by LangGraph's SQLite checkpointer.golem.dbis ours: the event log and the session and run tables, through oneaiosqliteconnection. - Who starts what. launchd starts the daemon at login and again after a crash. You start the clients. When no daemon answers and there is no launch agent, the TUI's setup window asks once whether to install it, or to run a daemon only while the terminal is open (ADR-036).
golemasks the same in plain lines before it opens the browser (ADR-033).
Where to go next
- Start with The agent loop, and follow the Next links, through to Coding.
- What golem keeps between chats, and which model may read it, is in Memory. The user's side is in Memory.
- How golem lets a model query your files and databases without being able to change them is in Data. The user's side is in Data.
- The choice behind each part is an ADR in Decisions.
- How the Python and TypeScript trees share one repository is in The monorepo.
- Every setting in
config.tomlis in Settings.