Skip to content

Protocol Specification

The Context Relay Protocol (CRP) is a formal, language-neutral protocol for managing context across LLM invocations. This section covers the protocol's architecture and design decisions.

Specification Version

CRP v2.0.0 — RFC 2119 conformant. Full specification in specification/.

Protocol Architecture

graph TB
    subgraph "CRP Orchestrator"
        A[Session Manager] --> B[Security Manager]
        B --> C[Envelope Builder]
        C --> D[Dispatch Router]
        D --> E[Continuation Engine]
        E --> F[Extraction Pipeline]
        F --> G[Quality Assessor]
    end

    subgraph "Knowledge Layer"
        H[Warm Store] --> I[CKF Graph]
        I --> J[Cold Storage]
    end

    F --> H
    C --> H
    D --> K[LLM Provider]

Core Concepts

Concept Description
Session A stateful interaction with accumulated knowledge
Window A single LLM invocation within a session
Envelope The context payload packed into each window
Fact An atomic unit of extracted knowledge
Warm Store In-session fact storage with rapid retrieval
CKF Contextual Knowledge Fabric — graph-structured persistent storage
Quality Tier Output quality assessment: S, A, B, C, D

Design Principles

  1. Axiom 9: Zero Output Modification — CRP NEVER modifies LLM output. The stitched result is exactly what the LLM generated, concatenated without alteration.

  2. Provider Agnostic — CRP works with any LLM through a standard adapter interface. No vendor lock-in.

  3. Honest Quality Reporting — Quality tiers reflect actual output quality. CRP does not inflate scores.

  4. Security by Default — Every dispatch runs through injection detection, PII scanning, and HMAC-chained audit logging.

Sections