Skip to content

Architecture ​

Lay out the parts. On parchment, the golem's parts float apart and come back together. On a blueprint the same parts are numbered: 1 head, the agent loop; 2 torso, the daemon; 3 hips, the protocol; 4 left arm, tools; 5 right arm, MCP; 6 left foot, sessions; 7 right foot, sandboxes; 8 scroll, the model

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.

CLIENTS · NODEDAEMON · PYTHON, ONE PER USER~/.golemOUTSIDETUIgolem, in a terminalgolem commandstatus, skills, configweb UIa browser tabgatewaygolem web, 127.0.0.1socketgolem.sockProtocol serverone JSON line, one commandSessionsruns, the event log, fan-outGraph runtimethe agent loopRoutername → modelSystem promptbuilt per callSkillsSKILL.md foldersToolsfiles, shell, git, webPermissionsallow, ask, denySandboxsandbox-execModel APIAnthropic, OpenAI, OllamaMCP serverschild processes, HTTPlaunchdstarts it, restarts itgolem.dbthe event log, sessions, runscheckpoints.dbthe model's memoryconfig.tomlyour settings and rules
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.db is written by LangGraph's SQLite checkpointer. golem.db is ours: the event log and the session and run tables, through one aiosqlite connection.
  • 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). golem asks 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.toml is in Settings.