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

Agent runtime engineering with Sophos

From cognokratos/sophos-agent · docs/runtime/README.md · pinned revision 8d9fe52182d8

Educational material: the why, the experiments and the failure modes. The precise what and how live in the architecture reference.

I want to…Go to
Learn production agent fundamentals (loops, tools, MCP, guardrails, evals, HITL, security)simple-agent-template — Learning path
Understand durable execution and runtime stateRuntime learning path
Follow one run end to endRun lifecycle walkthrough
See how the architecture evolved, and whyCase studies
Test myselfChallenges
Look up exact implementation detailsArchitecture reference
Set up the labsLab environment

Lessons

  1. Own the process — every resource has a creator, an owner and a closer
  2. Model execution state — conversation, thread, run, checkpoint
  3. Design durability boundaries — persist semantics, not everything
  4. Streaming is not persistence — transport vs truth
  5. Memory is not one thing — six responsibilities, six owners
  6. Failure, restart and resume — recovery as part of the model
  7. Side effects and idempotency — what checkpointing does not solve
  8. Local-first and runtime ownership — data flows, not labels

Lesson structure

Each lesson follows the same shape, so you can skip to the part you need:

Objective → Why it matters → Mental model → Where it lives in Sophos
  → Experiment (predict, break, inspect, recover)
  → Why the system behaves this way → What this does NOT guarantee
  → Takeaway → Go deeper

Predict before you inspect. The point of each lab is the gap between what you expected and what the runtime did.

Ground rules

  • Disposable state only. Labs use data/lab/ (lab environment). Nothing in this curriculum asks you to delete data/db/ or data/memory/.
  • Current code only. Everything described as behaviour is implemented on main. Lab results were observed while writing the labs; a few edge cases are read from the code, and the lessons say so. Anything that is not implemented is labelled challenge or future design.
  • Model output is observed, not guaranteed. Tool choice and wording vary between models and runs. Runtime behaviour does not.

This chapter is maintained in cognokratos/sophos-agent beside the code it teaches. The book shows docs/runtime/README.md at revision 8d9fe52182d8441454916ec8a6ab13c0773228e2 (branch main). View source at this revision · Report a correction.

Corrections are made upstream against the current main branch and appear here when the book's pin for this source is updated.