Anton, chapter 4: Plumbing matures
2026-03-16 → 2026-03-22
I spend the next coding session improving local inference. Ollama has been useful for getting Anton running, but I now want more control over how models are deployed and served: concurrency, batching, memory use, context length, and the exact flags passed to the runtime. So I move the local inference path to vLLM. The change gives me a much more configurable serving layer and room to tune the system as Anton's workload grows.
I also want more control over what Anton remembers and when it recalls it. The simple Postgres rows tagged by user have been enough to get started, but retrieval is still blunt. I rebuild memory around more deliberate retrieval semantics: trigram-scored matching instead of vector embeddings (at personal-knowledge-base scale, trigrams are enough and an embedding pipeline is a tax I don't want to pay), provenance tags, domain-biased recall, a query paraphrase pass, and an episodic layer of past-conversation summaries that only gets injected when the question has temporal intent. Always-on episodic memory is context bloat dressed up as helpfulness. The principle that crystallises: filter at load time, not write time. Store generously, retrieve narrowly.
I add LiteLLM as the gateway in front of every model provider, and with it the codename roster: sunny, gandalf, gustav, and friends. It feels mildly silly the first time I type "ask gandalf" in a config, and it sticks immediately. Models get swapped, deprecated, repriced; the codename is stable. The indirection costs nothing and pays back every time a provider changes something.
I also resolve a naming collision from the previous week: I'd called two different things "skills", a typed function in code and a reusable prompt template in the database. I rename the reusable templates to prompts and keep skill for typed executable functions. Skill now means a typed function with a runtime contract; prompt means a template in the database. The cost of the cleanup is a couple of hours; the cost of letting the collision live another month would have been far worse. Naming is one of those things where the bill compounds.
Next I formalise the runtime contract with defineSkill(): every skill declares its inputs, outputs, scopes, and handler in one shape, and the skill-runner becomes its own service with hot reload and per-skill metrics. Traces move from Redis checkpoints into Postgres, one row per agent run, queryable forever. Permission filtering moves inside runAgent() itself, which closes a class of bugs I keep almost shipping: a scheduled job inheriting wildcard permissions because the filter lived in the wrong place. The right place to enforce a rule is the place every path has to go through.
By the third week, Anton has sixty-three tools. This feels like great progress. But now I have another problem.
The parent agent can search calendars, browse documents, manage media, inspect memory, schedule work, create files, and call everything else I have added since day one. It has become the place where every new capability lands. Unfortunately, it is getting worse at choosing between them. Multi-step tasks are especially flimsy: Anton picks the wrong tool, stops halfway through, or loses track of what it is trying to do.
So I split the parent into ten delegates.
The parent keeps two jobs: understand what the user wants and combine the result. Each delegate owns a much smaller area. Calendar questions go to calendar. Media goes to media. Research goes to research.
The answers improve immediately.
With that working, I make the same kind of change to agent prompts: all agent prompts go into the database. Editable, versioned, one row per agent. Anton's behaviour stops being something I deploy and starts being something I configure. Same principle as memory: keep behaviour as data, and you keep the option to change your mind cheaply.
By the time I stop, Anton is a different shape, and almost none of it is a feature anyone can see. The lesson I take from the session: the work that pays the most is the work that turns implicit conventions into explicit contracts. Once a thing has a shape on disk and an entry point in code, you can change anything around it without fear. Plumbing is invisible until it isn't, and this stretch was almost entirely plumbing.