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.
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.
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.
| Element | What it contains |
|---|---|
| Numbered notebooks | Run in order. Each opens with a persona, the claim it proves, its route and its call cap |
| README order table | One row per notebook: order, notebook, persona and proof, route and call cap, and whether a browser checkpoint applies |
| Setup and version boundary | The virtual environment, the kernel name and the installed versions |
| Safety and cleanup cells | Guard cells before any live call, and a final cleanup notebook that deletes what the set created |
| Recorded lanes | Notebooks that replay captured or stubbed responses and say so in plain words |
| Runtime directory | Scratch files go to a .runtime/ folder that is ignored by git and removed by the last cell |
| Verification document | Before and after state, commands and results, retained attempts, and units consumed |
| Checker | A 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.
| Route | Calls | Use for |
|---|---|---|
scripted | A scripted stand-in for the model, no provider | Contracts, schemas and deterministic logic |
recorded | Stubbed service responses validated against the service model | Control-plane flows without a real account. The notebook states "recorded, not a capture of a real account" |
codex-live | A live model call on the Codex route, with usage recorded per call | Behaviour that depends on a real model |
aws-live | Real cloud resources, tagged, in an explicit profile and region | Provisioning, 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:
from recohut_kit.agentcore.cleanup import ResourceLedger, cleanup_all, set_tag, tagged_inventoryResourceLedger 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.
python tests/check_notebooks.py examples/example-set/*.ipynb
python tests/check_notebooks.py examples/example-set/*.ipynb --executed| Rule | Why |
|---|---|
| Code cells stay at or under 25 lines | A cell fits on one screen |
| Nesting depth is at most 2 | Logic stays readable |
No semicolons, noqa markers, global statements or unbounded loops | Plain, safe code |
| No host tokens, resource identifiers, account numbers or secrets in code or output | Notebooks are shareable |
| First cell has persona, proof, route and call cap | Every notebook states what it claims |
| Recorded lanes use the fixed wording | A replay is never presented as live |
| The last live notebook prints a zero tagged-inventory line | Cleanup 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/.
| Family | What the sets cover | Example folders |
|---|---|---|
| Amazon Bedrock AgentCore | Gateway, identity, memory, policy, runtime deploy and operations, browser use, code interpreter, evaluations, observability, onboarding | agentcore-gateway-live, agentcore-memory-strategies, agentcore-runtime-deploy |
| Amazon Bedrock Agents | Managed and inline agents, multi-agent collaboration, knowledge bases and guardrails | bedrock-agents-core, bedrock-inline-agents, bedrock-multi-agent |
| Strands | Strands on Bedrock, single and portfolio | strands-bedrock-agent, strands-bedrock-portfolio |
| LangChain and LangGraph | Workflows, checkpoints, retrieval and operations | langchain-agents, langchain-rag, langgraph, langgraph-operations |
| Databricks | Business notebooks over SQL, serving, registry, vector search and evaluation | databricks, lakehouse-operations |
| Retrieval and vector stores | RAG, cited answers, vector backends, document indexes | rag, vector-backends, s3-vectors-multi-view, rag-evaluation-regression |
| Graph and ontology | Property graphs, RDF stacks, virtual graphs, versioned ontologies | neo4j-semantics, memgraph-mage, rdf-local-stack, ontop-virtual-graph |
| Metadata and semantic layer | Catalogs, metric models and semantic backends | openmetadata, metricflow-dbt, semantic-layer, cube-core |
| Model Context Protocol | Clients, hosts, servers and tool gateways | mcp-clients, mcp-hosts, mcp-servers, tool-gateway |
| Evaluation | Gates in CI, red-team scenarios, user simulation, scheduled triage | eval-gate-ci, red-team-scenarios, user-simulation, scheduled-evals-and-triage |
| Observability | Phoenix tracing and latency monitoring | phoenix-observability, latency-monitoring |
| Harness and loops | Governed runs, thin orchestration, a loop built from scratch | production-harness, thin-orchestrator, react-from-scratch |
| Voice | Calls and turn handling | voice-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.
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-setExecute in order
Run the notebooks in the README order. Execute them one at a time and stop on a failure.
.venv-example-set/bin/jupyter nbconvert --to notebook --execute --inplace \
--ExecutePreprocessor.timeout=900 --ExecutePreprocessor.kernel_name=example-set \
examples/example-set/01-contracts-scripted.ipynbRun 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