§ Technical report · CGP-TR-2026-01

The Context Graph Protocol: Typed, Budgeted, Provenance-Carrying Context Retrieval for LLM Agents

Mac Anderson · Context Graph Protocol contributors · July 2026

Abstract

Large-language-model agents assemble their working context from retrieval pipelines that return opaque strings: nothing states where a passage came from, what it costs against the context window, whether it is still true, or how to cite it. We present the Context Graph Protocol (CGP), an open wire protocol that replaces the blob with a typed unit of exchange — the frame — carrying kind, relevance, canonical token cost, provenance, temporal validity, and a citation label. Frames relate to one another through labelled edges, making context a graph a host can traverse by anchor proximity. The protocol defines an eight-envelope NDJSON binding over stdio and streamable HTTP, an explicit capability handshake, a deterministic budget-accounting rule that renders budget honesty machine-checkable, a consent model for data egress, and three content representations that let large context travel by hash without sacrificing verifiability. Conformance is falsifiable by construction: a seven-check suite is validated against fourteen single-fault misbehaviour modes, and four independent implementations — Rust, TypeScript, Python, and Go — pass the same oracle. We argue that deterministic, canonical-order composition converts provider prompt caches from an accident into a contract, with a worked example showing a ~7× reduction in context tokens over a twenty-turn session.

Contents

  1. Introduction: the blob-pipe problem
  2. Design principles
  3. The frame model
  4. The wire protocol
  5. Budget honesty
  6. Consent and data flow
  7. Deterministic composition and context reuse
  8. Conformance as falsification
  9. Related work
  10. Status and governance

Cite this report

@techreportbibtex
@techreport{anderson2026contextgraph,
  title       = {The Context Graph Protocol: Typed, Budgeted,
                 Provenance-Carrying Context Retrieval for LLM Agents},
  author      = {Anderson, Mac and {Context Graph Protocol contributors}},
  institution = {Context Graph Protocol Project},
  number      = {CGP-TR-2026-01},
  year        = {2026},
  month       = {7},
  url         = {https://context-graph-protocol.vercel.app/research}
}