What goes into the Context sent to the AI?
About the AI
Context represents the aggregate data payload transmitted to the Questsmith generation engine during each operational cycle. This payload defines the parameters, boundaries, and historical record the AI evaluates to compute the next narrative sequence.
When the volume of active narrative data exceeds the model physical capacity, the engine separates elements into two primary classifications to prevent context overflow: Core Structural Elements and Dynamic Allocation Elements.
Core Structural Elements Required
Core Structural Elements establish the foundational logic and thematic constraints of your adventure. The engine prioritizes these elements, allocating up to a maximum threshold of 70% of the total available context bandwidth.
If the combined volume of these elements exceeds 70%, the engine executes a strict priority trimming matrix to preserve system stability:
- Terminal Log and Active Input: The absolute most recent action or player input. This is always preserved at 100% volume.
- Front Memory Infrastructure: System level scripting data utilized for active modifications. This is always preserved at 100% volume.
- Author Notes: Contextual modifiers that dictate immediate tone or stylistic constraints.
- Plot Essentials: The permanent anchor containing foundational data regarding your protagonist and critical universe mechanics.
- Core Engine Instructions: System level prompts that govern the functional behavior of the AI model.
- Story Summary: The macro record of completed narrative arcs.
If a low priority element fails to fit within the remaining allocation space, its terminal text is cleanly truncated, and any subsequent elements are omitted from the active payload cycle.
Dynamic Allocation Elements
Dynamic Allocation Elements represent fluid, situational information. These elements occupy the remaining context bandwidth left vacant by the Core Structural Elements. The remaining space is distributed mathematically across three distinct pipelines:
- Story Cards Allocation 25%: Lore entries triggered dynamically by keywords appearing in recent player actions. The engine scans a rolling window of recent history to identify asset matches. The depth of this historical scan expands proportionally with available token bandwidth, prioritizing entries based on frequency and recency.
- Narrative History Allocation 50% to 75%: The chronological record of past actions. The engine compiles this data in reverse order, starting from the most recent sequence and building backward until the allocated bandwidth is fully consumed. If the Automated Memory System is deactivated, this pipeline expands to consume up to 75% of the dynamic space.
- Automated Memory System Allocation 25%: A secondary historical matrix that retrieves long term behavioral summaries and past milestones. The engine ranks these vectors based on semantic relevance to the immediate terminal action, injecting as many matching data nodes as the remaining bandwidth permits.