Expand description
Context assembly — builds LLM prompts with token budget management.
Manages the token budget for LLM context windows:
- System prompt (~500 tokens)
- User model snapshot (~300 tokens)
- Conversation history (~2000 tokens)
- Retrieved memories (remaining budget)
- Response buffer (~400 tokens)
Structs§
- Context
Assembler - Context assembler — builds prompts respecting token budgets.
- Token
Budget - Token budget allocation.
- User
Profile - User profile data for context injection.
Constants§
- ONBOARDING_
ADDENDUM - System-prompt addendum injected while the user has fewer than 5 facts. Makes the LLM naturally curious and question-asking during onboarding.
- ONBOARDING_
GREETING - Hardcoded greeting for first-ever chat session (0 facts). Printed directly — no LLM call needed.
- TOKEN_
BUDGETS - Default token budgets.