Skip to Content
Recodocs

Notebook sets

What a kit notebook set is, the house structure every set follows, the families of sets by technology, and how to run one.

6 min read

A notebook set is a folder under examples/ in the kit repository. It holds a short ordered list of Jupyter notebooks that exercise one kit capability against a realistic but synthetic scenario, together with a README, a checker script and a verification document. Sets are how the kit shows that a capability works as described, and they are the examples the capability index lists under example_sets.

A set proves kit behaviour. It does not carry its own copy of the logic: the notebooks call the kit owner, so a reader can see what the owner does and a checker can confirm the notebooks still say it.

The house structure

A notebook set lets you learn one capability through an experiment: run a scenario, see the result and inspect the evidence that supports it. The notebook is a worked example, not a guarantee about every production workload.

Every set follows the same layout, so a reader who has opened one can open any other.

README.md
01-contracts-scripted.ipynb
02-flows-recorded.ipynb
03-live-provision.ipynb
04-live-teardown.ipynb
.gitignore

Beside the set, two other places hold its support files: docs/example-set/ for the verification document, and scripts/check_example_set_notebooks.py for the set checker.

ElementWhat it contains
Numbered notebooksRun in order. Each opens with a persona, the claim it proves, its route and its call cap
README order tableOne row per notebook: order, notebook, persona and proof, route and call cap, and whether a browser checkpoint applies
Setup and version boundaryThe virtual environment, the kernel name and the installed versions
Safety and cleanup cellsGuard cells before any live call, and a final cleanup notebook that deletes what the set created
Recorded lanesNotebooks that replay captured or stubbed responses and say so in plain words
Runtime directoryScratch files go to a .runtime/ folder that is ignored by git and removed by the last cell
Verification documentBefore and after state, commands and results, retained attempts, and units consumed
CheckerA script that reads the notebooks without running them and fails on rule breaks

Routes

Each notebook declares one route, which says what it is allowed to call.

RouteCallsUse for
scriptedA scripted stand-in for the model, no providerContracts, schemas and deterministic logic
recordedStubbed service responses validated against the service modelControl-plane flows without a real account. The notebook states "recorded, not a capture of a real account"
codex-liveA live model call on the Codex route, with usage recorded per callBehaviour that depends on a real model
aws-liveReal cloud resources, tagged, in an explicit profile and regionProvisioning, attach and teardown

A set with any aws-live notebook ends with an aws-live cleanup notebook.

Safety and cleanup cells

A live notebook starts with a guard cell. It checks that the required marker files exist, builds an explicit session with a named profile and region, and prints skipped: <reason> instead of calling anything when a condition is missing. Credentials are never discovered implicitly.

Every create call is followed at once by a ledger entry, and every taggable resource carries the set's tag:

cleanup_cells.py
from recohut_kit.agentcore.cleanup import ResourceLedger, cleanup_all, set_tag, tagged_inventory

ResourceLedger is a locked JSON record of resources the notebook sets create. cleanup_all deletes every entry that carries exactly the set's tag, in dependency order, polls until each resource is absent and records the proof. tagged_inventory asks the tagging service what still carries the tag, as a cross-check. The ledger and per-resource lookups remain the authority, because some resource types do not appear in the tagging index.

The checker

The shared checker, tests/check_notebooks.py, reads notebooks as text and never executes them. Each set adds its own script that loads the shared one and adds set-specific rules.

terminal
python tests/check_notebooks.py examples/example-set/*.ipynb
python tests/check_notebooks.py examples/example-set/*.ipynb --executed
RuleWhy
Code cells stay at or under 25 linesA cell fits on one screen
Nesting depth is at most 2Logic stays readable
No semicolons, noqa markers, global statements or unbounded loopsPlain, safe code
No host tokens, resource identifiers, account numbers or secrets in code or outputNotebooks are shareable
First cell has persona, proof, route and call capEvery notebook states what it claims
Recorded lanes use the fixed wordingA replay is never presented as live
The last live notebook prints a zero tagged-inventory lineCleanup is proven, not assumed

The --executed mode also checks saved outputs, cleanup readback and retained receipts.

Families of sets

Sets are grouped here by the technology they exercise. Folder names are in examples/.

FamilyWhat the sets coverExample folders
Amazon Bedrock AgentCoreGateway, identity, memory, policy, runtime deploy and operations, browser use, code interpreter, evaluations, observability, onboardingagentcore-gateway-live, agentcore-memory-strategies, agentcore-runtime-deploy
Amazon Bedrock AgentsManaged and inline agents, multi-agent collaboration, knowledge bases and guardrailsbedrock-agents-core, bedrock-inline-agents, bedrock-multi-agent
StrandsStrands on Bedrock, single and portfoliostrands-bedrock-agent, strands-bedrock-portfolio
LangChain and LangGraphWorkflows, checkpoints, retrieval and operationslangchain-agents, langchain-rag, langgraph, langgraph-operations
DatabricksBusiness notebooks over SQL, serving, registry, vector search and evaluationdatabricks, lakehouse-operations
Retrieval and vector storesRAG, cited answers, vector backends, document indexesrag, vector-backends, s3-vectors-multi-view, rag-evaluation-regression
Graph and ontologyProperty graphs, RDF stacks, virtual graphs, versioned ontologiesneo4j-semantics, memgraph-mage, rdf-local-stack, ontop-virtual-graph
Metadata and semantic layerCatalogs, metric models and semantic backendsopenmetadata, metricflow-dbt, semantic-layer, cube-core
Model Context ProtocolClients, hosts, servers and tool gatewaysmcp-clients, mcp-hosts, mcp-servers, tool-gateway
EvaluationGates in CI, red-team scenarios, user simulation, scheduled triageeval-gate-ci, red-team-scenarios, user-simulation, scheduled-evals-and-triage
ObservabilityPhoenix tracing and latency monitoringphoenix-observability, latency-monitoring
Harness and loopsGoverned runs, thin orchestration, a loop built from scratchproduction-harness, thin-orchestrator, react-from-scratch
VoiceCalls and turn handlingvoice-calls, voice-turns

The list is a sample. Run ls examples in the repository for the full set, or search the capability index for a technology and read example_sets in the result.

Notebook outputs are not a guarantee

A set's saved outputs record what happened when it was last run. The verification document lists attempts, including failed and unexecuted paths. Read it before you cite a set as evidence.

Run a set

Read the README

Open examples/<set>/README.md. Check the order table, the routes and the call caps. Do not run a live notebook before you know what it will create.

Create the environment

Follow the README's setup block. A typical block creates a virtual environment, installs the kit with the needed extras, and registers a kernel with the set's name.

terminal
uv venv .venv-example-set --python 3.13
uv pip install --python .venv-example-set/bin/python -e '.[agentcore]' nbconvert ipykernel pandas
.venv-example-set/bin/python -m ipykernel install --user --name example-set

Execute in order

Run the notebooks in the README order. Execute them one at a time and stop on a failure.

terminal
.venv-example-set/bin/jupyter nbconvert --to notebook --execute --inplace \
  --ExecutePreprocessor.timeout=900 --ExecutePreprocessor.kernel_name=example-set \
  examples/example-set/01-contracts-scripted.ipynb

Run the checker and clean up

Run the set checker in executed mode. For a set with live resources, finish with the teardown notebook and confirm the tagged-inventory line reads zero.

Limits

  • A set uses synthetic data. It shows that a capability behaves as described, not that it fits your data.
  • Live sets create real, billable resources in an account you choose. Use a sandbox account.
  • Recorded lanes validate request and response shapes. They do not prove the live service behaves the same way.
  • Notebook titles use the word "agent" only where a model chooses the next action.

How is this page?

Last updated on