Expand description
CELLSTATE Context - Context Assembly
Provides intelligent context assembly with token budget management. Combines all inputs into a single coherent prompt following the Context Conveyor pattern.
Structs§
- Assembly
Decision - Decision made during context assembly for audit trail.
- Context
Assembler - Context assembler that builds context windows from packages. Adds sections by priority until budget is exhausted.
- Context
Outline - Lightweight outline of a context package for progressive disclosure.
- Context
Package - Context package - all inputs for assembly. Similar to ContextPackage in the TypeScript CRM pattern.
- Context
Page Diff - Diff between two context windows after re-paging.
- Context
Section - A section of the assembled context.
- Context
Window - Assembled context window with token budget management.
- Graph
Link - Graph link hint for context assembly (from SQL adjacency projection).
- Kernel
Config - Kernel configuration for persona and behavior.
- Scope
Summary - Summary of a scope for context assembly.
- Segment
Usage - Segment usage tracking.
- Session
Markers - Session markers for tracking active context.
- Source
Ref - Reference to a source entity.
- Token
Budget - Segment-based token budget allocation.
- Token
Budget Builder - Builder for constructing TokenBudget with custom ratios.
Enums§
- Assembly
Action - Action taken during context assembly.
- Context
Segment - Context segment types for budget tracking.
- Section
Type - Type of context section.
- Segment
Budget Error - Error type for segment budget violations.
Functions§
- estimate_
tokens 🔒 - Estimate tokens using the default heuristic tokenizer.
- truncate_
to_ token_ budget - Truncate text to fit within token budget. Prefers sentence boundaries, falls back to word boundaries.