Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Part I — What survives, and where to go next

Part I teaches a production-agent architecture through a real framework replacement. The repository first implemented the agent with NVIDIA NeMo Agent Toolkit and now implements it with Rig in Rust. That history gives us a concrete way to separate the properties the architecture depends on from the way one runtime happens to provide them.

What should survive an implementation change?

The agent runtime is the most replaceable box in the template. It has already been replaced once: the current Rig/Rust agent superseded the NAT implementation while the gateway, MCP capability boundary, database, service contract, approval verifier and evaluation specification stayed recognisable.

Whatever replaces it next, these properties should still be true, and you should be able to point at the code or configuration that makes them true:

BoundaryProperty that must surviveHow to check it on any runtime
IdentityThe caller is established by the gateway, never by conversation text.Send a request without the service key, or with ambiguous identity, and expect a refusal before any model call.
CapabilityThe tool list is a grant. The model reaches data only through tools, and the agent has no route to the database.List the tools the runtime exposes and compare them with the allow-list. Inspect the network the agent runs on.
Execution responsibilityThe model proposes a call; deterministic software decides whether it may run, and the tool service decides whether a mutation is valid.Find the code that refuses an unlisted tool or malformed arguments, then find the server-side point-of-mutation check.
Model and tool separationNo credential appears in a prompt, tool description or model-proposed argument.Read a trace and inspect model-visible context for credentials.
Authority (where enabled)A state change needs a human approval verified at the point of mutation, not a model assertion.Replay an approval token, or change the premise it was signed for, and expect the MCP server to refuse it.
EvidenceEach request produces one correlated trace without credential-bearing headers.Run a request and find exactly one trace for it.
Measured behaviourA runtime change is judged by the same source-controlled evaluation cases and gates, not by impression.Run the deterministic checks and the live evaluation suites before and after the replacement.

Some things are allowed to differ, as long as the difference is explicit. The current Rust implementation has stricter tool-argument validation, an explicit execution state machine and a smaller runtime image, while its deterministic PII detection is narrower than the historical Presidio-based detector. The framework migration records those differences.

The test of understanding is simple: can you still recognise the architecture after the framework has been replaced? If the answer depends on framework vocabulary, go back to the migration case study.

Continue beyond this laboratory

You now understand this architectural problem. These are strong implementations, standards or ecosystems to explore next. They are a short, deliberate selection; Where CognoKratos fits explains how they were chosen and what the labels mean.

  • Rig portable open source
    The current template's agent framework. Its deliberately small surface makes the surrounding application architecture visible.
  • NVIDIA NeMo portable open source
    The historical implementation used NeMo Agent Toolkit. The preserved nat-1.9-final tree is useful for studying the migration, while current NeMo components remain relevant examples of specialised safety, instrumentation and evaluation capabilities around an agent runtime.
  • OpenAI Agents SDK portable open source
    A deliberately small framework with tools, guardrails, human-in-the-loop and tracing. Try mapping its primitives onto the same trust boundaries.
  • Strands Agents portable open source
    An open-source SDK from AWS that runs in your own process with many model providers. Use it as another exercise in separating framework features from architectural controls.

If the agent loop or tool calling still felt unfamiliar in this part, revisit the learning paths before continuing.