R005 · Agent architecture › Mental models of the agent system

Second Brain OS: the five-layer map of AI agents

Read the original

mental-modelsagent-architecturecontext-engineeringharness-configevalslearning-resources

TL;DR

The post (Charly Wargnier, LinkedIn, 2026-11-04) is a pointer, not an argument: it recommends secondbrainos.dev, a free, MIT-licensed course and handbook set by Yarchi (repo) that renders 130 Markdown pages, a 57-term glossary and 100+ tools as one force-directed graph (1,236 links, about 9-10 per page). The "other way to understand AI" is twofold. The content says an agent is the model plus five layers around it (context, loop, gate, harness, evals), each answering one question, and most failures live in a layer, not the model. The form says learn the field as a dependency graph, not a linear syllabus, because a failure in one layer masquerades as another.

The mental model: five layers, one system

The site's Five layers, one system page frames the agent as a bright new hire on day one; everything that decides success is the system built around them. It rejects treating "context engineering", "loop engineering" and so on as rival schools: they are layers of one stack, and each answers a single question.

LayerQuestionAnalogyFailure when missingLooks like
ContextWhat does it see?What's on the deskGuesses, invents, re-asks for things it was givenA dumb model
LoopWho decides the next step?Checklist vs. self-directedBrittle script, or a wanderer burning tokensFlakiness or cost
GateWho sorts incoming work?Front desk sorting mailJunk and trivia hit the most expensive pathRunaway cost
HarnessWhat can it reach?Office, keys, reviewerCan decide but not act, or acts on everything uncheckedUseless or dangerous
EvalsHow do you know?The same test every monthRegressions found by usersNothing, until prod

Underneath sits Google's agent anatomy (model = brain, tools = hands, orchestration loop = nervous system, deployment = body) and its five levels of agency (0 bare model to 4 self-evolving); the site says most production value today is at levels 1-2. The diagnostic heuristic worth keeping: name the layer before blaming the model. The "Gate" layer is the least standard of the five; it maps to cheap classifiers or small "System One" models returning typed decisions in front of an LLM.

Engineering claims worth keeping

Critique

The taxonomy is the real contribution: it gives a shared vocabulary for root-causing agent failures, and it is grounded in primary sources (Google's agent whitepapers, Anthropic engineering posts, cited papers) with a contributing rule that every factual claim needs one. The graph UI is a good onboarding device, but it is presentation; the value is in the Markdown.

Weaknesses to keep in mind:

Using it

A layer-by-layer review checklist for any agent design:

Related entries: R002 (memory layers; the second brain's "record contradictions, never overwrite" is one answer to R002's open contradiction problem). R004 (both say config rots across model upgrades; this site turns R004's one-off wipe into a scheduled audit with evals).

Sources

Connections

See R005 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.