chapter eight

8 Evaluation and observability

 

This chapter covers

  • How context failures appear in LLM-based systems and how to classify them.
  • How evals, metrics, datasets, benchmarks, and LLM-as-judge support context-aware evaluation.
  • How observability, active telemetry, and context graphs expose the causes of AI system behavior.

Chapter 1 introduced context engineering as a layered architecture for designing and building context-aware AI systems. This stack consists of three core technical layers (context sources, management, and orchestration) surrounded by a harness that includes evaluation, observability, governance, and operations. This chapter analyzes the evaluation and observability components of the harness. These components are not just external constraints but integral parts of the overall architecture. They provide the feedback, evidence, and control mechanisms that keep the core context components aligned with the application objective.

The chapter starts by naming common context failures, as teams cannot evaluate or observe problems they cannot describe. It then explains evaluation methods for context-aware systems, including evals, metrics, benchmarks, and LLM-as-judge. The second part turns to observability, active telemetry, and context graphs.

8.1 A taxonomy of context failures

8.1.1 Context rot

8.1.2 Context staleness

8.1.3 Context drift

8.1.4 Context poisoning

8.1.5 Context pollution

8.1.6 Context distraction

8.1.7 Context confusion

8.1.8 Context clash

8.1.9 Context overflow

8.2 Evaluation methods for context-aware systems

8.2.1 Evals

8.2.2 Evaluation metrics

8.2.3 Evaluation datasets

8.2.4 Benchmarks

8.2.5 LLM-as-judge

8.3 Observability

8.3.1 Traditional observability foundations

8.3.2 Active telemetry

8.3.3 Context graphs

8.3.4 Observability tools

8.4 Hands-on

8.4.1 Metrics with DeepEval

8.4.2 Evals with Promptfoo