Cross-Cutting Design Principles
Status: Applies to all planned features
These principles apply across Trackers, Mode-Lorebook Injection, Journal, Packages, Fuzzy Time Search, and Entity Changelog. They address concerns that cut across individual feature boundaries.
User Editability: Humans Correct Machines
Every piece of auto-generated content -- tracker values, journal profiles, state facts, location cards -- must be editable by the user. LLMs make mistakes. The evaluation call will misread the narrative, merge two characters that shouldn't be merged, miss a location change, or hallucinate a detail that wasn't there. The user is the final authority.
Principles
Everything is editable. Every auto-generated field, profile, fact, and tracker value can be directly edited by the user. No read-only AI outputs.
Edits are authoritative. When a user edits a profile field, that edit takes precedence over future evaluation attempts. The evaluation call should not overwrite user corrections. Options:
- Field-level "pinned" flag: user-edited fields are marked and skipped by evaluation
- Edit history: if the user changed
appearancefrom X to Y, future evaluation preserves Y unless the user un-pins it - Simplest: user edits bump
updated_aton the field; evaluation only overwrites fields it originally set
Inline editing, not forms. Profile fields should be editable in-place (click to edit) rather than through a separate form. Reduces friction for quick corrections.
Bulk operations. Users should be able to merge duplicate profiles (the evaluation created two entries for the same character), split incorrectly merged ones, deactivate stale entries, and reorder.
Where this applies
| Feature | What's editable |
|---|---|
| Trackers | Current tracker values, tracker definitions, extraction hints |
| Journal | State facts, character profile fields, location profile fields, relationship state, aliases |
| Journal (Living Lorebook) | All materialized lorebook entries |
| Packages | All preset values, custom instructions, settings overrides |
Evaluation Error Handling: Fail Gracefully, Surface Clearly
The evaluation LLM call (shared by trackers and journal) returns structured JSON. When that JSON is malformed, the system must handle it gracefully without losing the LLM's work.
Raw Response Preservation
When JSON parsing fails:
Store the raw response. The evaluation LLM's raw text output is saved alongside the message, not discarded. The LLM might have produced useful content that just wasn't valid JSON.
Carry forward previous values. Tracker values and journal profiles are unchanged -- the system uses the last known good state. No corruption.
Notify the user. A non-intrusive indicator appears (e.g., a warning icon on the tracker sidebar or journal panel) letting the user know the evaluation produced an unparseable result. The user can:
- View the raw response to see what the LLM intended
- Manually apply the changes (edit tracker values or profile fields)
- Dismiss the notification (accept the carry-forward)
Log for debugging. The raw response and parse error are logged so patterns can be identified (bad model choice, prompt needs tuning, etc.).
UI for Failed Evaluations
[!] Tracker evaluation returned an unparseable response.
[View raw response] [Dismiss]
Raw response:
"The game time has advanced to Day 3, Afternoon and the party
moved to Level 3. HP is now about 58 after the fight."
← This was prose instead of JSON. The user can read it and
manually update the tracker values.
Structured Output Preference
To minimize parse failures, the evaluation call should prefer models and configurations that support structured output:
- JSON mode (when the provider supports it)
- Schema-constrained output (OpenAI structured outputs, Anthropic tool use)
- If neither is available, use strong few-shot prompting with explicit JSON examples
User vs. Creator Experience
Trackers, journal, and living lorebook features introduce significant complexity. This complexity is valuable for creators building experiences but overwhelming for users who just want to chat. The UI must cleanly separate these audiences.
The Problem
Today's chat interface already has settings for mode, lorebook, persona, custom instructions, summarization, memory, and knowledge retrieval. Adding trackers, journal, profiles, materialization, and evaluation settings on top creates a configuration firehose that intimidates casual users.
The Split
Two distinct UI modes, not just different pages but different levels of visibility:
| Aspect | User Experience | Creator Experience |
|---|---|---|
| Goal | Chat with a character | Build and tune the experience |
| Tracker visibility | See current values in sidebar, maybe toggle non-required ones | Define trackers, set types/hints, bind to characters, link lorebooks |
| Journal visibility | See character and location cards, edit if needed | Full profile management, materialization, export to lorebook |
| Evaluation errors | Simple "something went wrong" with manual edit option | Full raw response, parse errors, evaluation prompt debugging |
| Settings | Minimal (what model, how creative) | Full (evaluation LLM, journal depth, materialization options) |
| Lorebook injection | Transparent (just works) | Mode editor with lorebook targeting, budget control |
How Packages Enable This
Packages are the primary mechanism for bridging this gap. A creator builds the experience (picks trackers, tunes journal settings, configures modes with lorebook targeting, sets up evaluation hints) and publishes it as a package. The user starts the package and gets a polished experience where:
- Trackers are pre-configured and labeled clearly
- Journal runs in the background, profiles appear as character cards
- Evaluation settings are tuned by the creator
- Locked components prevent users from accidentally breaking the experience
- Custom instructions from the package explain what to expect
Packages turn creator complexity into user simplicity.
Progressive Disclosure
Even outside packages, the UI should use progressive disclosure:
- Default view: Chat + minimal sidebar (tracker values, character cards from journal). No settings, no configuration.
- Expanded view: Click to see journal details, tracker history, edit profiles. Still no evaluation/system internals.
- Creator/debug view: Full control -- evaluation prompts, raw responses, parse errors, materialization tools, mode editor with lorebook targeting. Accessed via a toggle or separate page.
Settings that only matter to creators should live in the Forge (creator tools), not in the chat interface. Chat settings should be limited to things that affect the user's immediate experience (model choice, temperature, font size, streaming).
Token Budget: Lorebook Entry Sizing
Lorebook entries are injected into the prompt alongside character data, trackers, journal, persona, and memories. Every token spent on lorebook content competes with everything else for context window space.
The 500-Token Rule
Individual lorebook entries should not exceed ~500 tokens. Entries larger than this should be split into multiple focused entries or trimmed to their essential content.
Why 500 tokens:
- With
Knowledge.MaxEntriestypically set to 5-10, that's 2,500-5,000 tokens for lorebooks alone - Add tracker-driven lorebook results (3 entries per linked tracker), and the lorebook budget grows further
- Combined with character prompt (~500-1,000), journal profiles (always-on), tracker values, memories, and conversation history, the context window fills fast
- Smaller, focused entries also improve search relevance -- a 500-token entry about "Shadowkeep Level 2" will score higher for Level 2 queries than a 2,000-token entry covering all five levels
Guidance for Creators
- Split by topic: One entry per location, one per NPC, one per concept. Not one entry for "the whole world."
- Trim to essentials: The AI doesn't need a 3-paragraph backstory for every NPC. Focus on details that affect interactions.
- Use keywords wisely: Good keywords mean the right entry triggers at the right time. A well-keyworded 200-token entry beats a poorly-keyworded 1,500-token entry.
- Linked lorebook trackers amplify this: When a roster tracker pulls NPC entries per character in the scene, each entry fires independently. Five NPCs × 500 tokens = 2,500 tokens just from the roster. Keep entries lean.
Platform Enforcement
- Soft warning: Entries over 500 tokens show a warning in the lorebook editor ("This entry is large. Consider splitting it for better search relevance and token efficiency.")
- No hard cap: Some entries genuinely need more space (complex mechanics, detailed maps). The warning educates without blocking.
- Materialization guidance: When journal profiles are materialized into lorebook entries, the materialization process should target the ~500-token limit, compressing verbose profiles into concise entries.
Evaluation Architecture: Shared Call, Unified Error Surface
The tracker evaluation and journal evaluation share a single post-response LLM call. This section clarifies how the unified call works with the principles above.
Single Call, Multiple Outputs
After the story response completes:
Evaluation LLM call:
Input:
- AI response text
- Current tracker values + definitions + hints
- Current journal profiles (active characters/locations)
- Journal state facts
Output (JSON):
{
"trackers": { ... changed tracker values ... },
"journal": {
"facts": [ ... new/updated facts ... ],
"characters": { ... new/updated character profile fields ... },
"locations": { ... new/updated location profile fields ... }
}
}
Error Handling Per-Section
JSON parsing can fail at different levels:
| Failure | Impact | Handling |
|---|---|---|
| Total parse failure (not JSON at all) | No trackers or journal update | Store raw response, notify user, carry forward everything |
trackers section malformed |
No tracker update | Carry forward tracker values, apply journal changes if valid |
journal section malformed |
No journal update | Apply tracker changes if valid, carry forward journal |
| Individual field invalid (e.g., HP = "lots") | That field skipped | Apply all valid fields, log warning for skipped ones |
Partial success is better than total failure. If the evaluation returns valid tracker updates but broken journal output, apply the trackers and carry forward the journal.