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¶
-
Axiom 9: Zero Output Modification — CRP NEVER modifies LLM output. The stitched result is exactly what the LLM generated, concatenated without alteration.
-
Provider Agnostic — CRP works with any LLM through a standard adapter interface. No vendor lock-in.
-
Honest Quality Reporting — Quality tiers reflect actual output quality. CRP does not inflate scores.
-
Security by Default — Every dispatch runs through injection detection, PII scanning, and HMAC-chained audit logging.
Sections¶
-
Session lifecycle, configuration, and orchestration.
-
How CRP packs facts into the context window.
-
All 9 dispatch strategies with use cases.
-
6-stage fact extraction from LLM output.
-
Graph-structured knowledge storage and retrieval.
-
S/A/B/C/D output quality assessment.