Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Cache Engineering for AI Agent Harnesses

Companion exercises, Python laboratories and checked solutions

This public repository contains the companion material for all 12 chapters of Cache Engineering for AI Agent Harnesses. The source code and fixtures are original, synthetic teaching examples. They are not production security controls or empirical performance benchmarks.

Each chapter folder contains a self-contained laboratory guide, exercise questions, checked solutions and its runnable Python script. Read the chapter, attempt the questions, then use the checked solutions to review your reasoning.

Chapter Topic Companion material Python lab
1 The Cache Problem in Agent Harness Engineering Laboratory, questions and answers Source code
2 Caching Taxonomy and Memory Hierarchy Laboratory, questions and answers Source code
3 Prompt Prefix Caching and Stable Context Design Laboratory, questions and answers Source code
4 Transformer KV-Cache and Attention Serving Laboratory, questions and answers Source code
5 Paged Attention, Quantisation and KV Eviction Laboratory, questions and answers Source code
6 Semantic Caching and Similarity Thresholds Laboratory, questions and answers Source code
7 Retrieval, RAG and Vector-Store Cache Strategies Laboratory, questions and answers Source code
8 Tool, API and Multi-Agent Result Caching Laboratory, questions and answers Source code
9 Invalidation, Consistency, Freshness and Provenance Laboratory, questions and answers Source code
10 Security, Tenant Isolation and Cache Poisoning Laboratory, questions and answers Source code
11 Cost, Latency, Energy and Adaptive Cache Policies Laboratory, questions and answers Source code
12 Benchmarking, Replay, Observability and Production Architecture Laboratory, questions and answers Source code

Running the laboratories

Requirements: Python 3.10 or later, with the standard library. No API keys, external services, network access or third-party packages are required by the supplied synthetic labs.

From the repository root, run a chapter's script, for example:

python3 chapters/01/helix_ch01.py

Run all scripts from the repository root with:

python3 scripts/run_all_labs.py

The verification workflow compiles and runs every exercise script in isolation. These checks confirm program behaviour only within its stated synthetic assumptions.

Scope and source attribution

  • The book manuscript remains in the cache repository; its repository may require author access.
  • This repository is the canonical home for hands-on laboratories, runnable code, exercise questions and checked solutions.
  • Architecture diagrams and in-text conceptual notation remain in the book because they are explanatory content rather than standalone exercise code.
  • The original chapter's limitations, assumptions and examples are preserved in each companion guide; readers should not extrapolate synthetic outputs to real deployments.

Chapters

Open a chapter from the table above. Changes to the manuscript's learning objectives should be reflected in the corresponding chapter guide and Python lab.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages