GRACE Session Structure & Context Lifecycle
ELI5
A GRACE session is like a conversation that never forgets. Each message you send gets added to a growing context window. GRACE reads the full history every time it responds — so it always knows what you’re talking about.
Technical Deep Dive
Session Composition
Every GRACE session is constructed from 7 context files:
- IDENTITY — who GRACE is and what she believes
- SOUL — emotional and ethical alignment
- USER — your preferences, conventions, history
- TOOLS — available capabilities (MCP, HTTP, etc.)
- AGENTS — other agents GRACE can delegate to
- BOOTSTRAP — session initialization logic
- HEARTBEAT — periodic self-check and reflection
Context Window Management
GRACE uses a sliding-window approach with token budgeting:
max_tokens = 128_000reserved = 8_000 (system prompt + HEARTBEAT)available = max_tokens - reserved - user_inputWhen history exceeds available tokens, oldest non-critical messages are summarized and archived.
Key Terms
- Context window: The maximum number of tokens GRACE can consider in a single turn.
- Token: A unit of text (roughly 0.75 English words per token).
- Sliding window: Discarding oldest content to make room for new input.
Q&A
Q: Does GRACE remember between sessions? A: Not by default. Each session starts fresh. Persistent memory is opt-in via the MEMORY file, which is loaded at session start and updated at session end.
Examples
Starting a session:
User: "I'm debugging packet encoding in STRATT"GRACE: [loads STRATT context from TOOLS + related CRUMB cards] "I see. Let me pull the packet structure card for you..."