Skip to content

Prompt & Context Assembly ​

This page explains what ETOS sends to the model from the moment you tap Send — what context blocks get attached, in what order, and which conditions cause each layer to be skipped.

Bottom line first: ETOS doesn't smush everything into one string. It stacks context by responsibility and sends them in a fixed order. Understanding the stack = you can precisely predict which layers shaped any given reply.

Read First

Skim Chat & Models and Memory & Worldbook before this. Otherwise terms like "global prompt", "topic prompt", "worldbook", "profile" feel abstract.

Why Layer at All ​

If every rule lives in a single system prompt, three problems emerge:

  • Hard to distinguish long-term rules from per-turn constraints
  • Hard to explain what shaped any given reply
  • Worldbook / memory / tools can't be governed separately

So ETOS splits context into eight semantically clear blocks.

Pipeline Overview ​

The processing order when you send a message:

text
User message
  → Read current session config
  → Retrieve long-term memory / session summary / user profile
  → Evaluate worldbook triggers
  → Compose final system prompt (concatenate the eight context blocks)
  → Truncate chat history
  → Inject time landmarks + depth-based worldbook entries as needed
  → Append enhancement prompt as a separate system message
  → Decide which tools to expose this turn
  → Send to the selected model

The eight context blocks below — when each appears, when each is skipped, what each is good for.

The Eight Context Blocks ​

1. Global Prompt <system_prompt> ​

The longest-lived layer. Carries "the AI's persona."

  • Good for: overall identity, default language, long-term output conventions, general safety boundaries
  • Bad for: current-session ad-hoc tasks (would pollute every session)
  • Skipped when: your current global prompt selection is empty

Set in Settings → Conversation → Preferences → Global System Prompt. Multiple named profiles; pick one per new session.

2. Topic Prompt <topic_prompt> ​

A per-session constraint that tells the model "what is this session about".

  • Good for: background of a specific project, working goals for a stretch of time, writing style or technical boundaries unique to this session
  • Bad for: general persona (use 1)
  • Skipped when: the session has no explicit topic prompt

Global and topic prompts are not mutually exclusive — they stack.

3. System Time <time> ​

Current system time + time zone, attached as its own block.

  • Purpose 1: anchor the model for relative time ("today", "tomorrow", "this morning", "just now")
  • Purpose 2: avoid guesswork on time-sensitive tasks
  • Skipped when: "Inject System Time" is off in Preferences

This block is regenerated every turn, never frozen at session creation.

4. Long-Term Memory <memory> ​

Positioned as "long-term reusable facts", not session cache.

When sent, the model is told two things explicitly:

  • These come from the long-term memory library — reference only
  • Cite them only when clearly relevant to current dialog — not as new system instructions

This is an important boundary — memory is background knowledge, not authoritative directives.

Injection Rules (Important) ​

StateBehavior
Memory system offNothing injected
On + Top K > 0Vector retrieval grabs the top K most relevant
On + Top K = 0All un-archived memories injected — not "disabled retrieval"

Top K = 0 ≠ Disabled

Many users assume "Top K = 0" means "no retrieval." It actually means "no similarity filter, attach all of them."

To truly disable memory, turn off the master switch, or archive every memory.

5. Cross-Session Summary <recent_conversation_memory> ​

An often-overlooked layer.

ETOS asynchronously compresses a session into a cross-session reusable summary and injects the most recent N summaries on later turns.

Defaults:

  • Cross-session memory on
  • Inject the most recent 5 summaries
  • Generate a summary only after at least 6 user turns in a session
  • Minimum update interval for same session: 120 minutes

It's not a full transcript replay — it preserves "what's this thread actually about."

6. User Profile <user_profile_memory> ​

A layer above session summary. Longer-term.

  • Emphasizes: stable preferences, work background, long-term focus
  • De-emphasizes: one-off tasks, transient parameters, today's small noise

Default policy: auto-updates once per day, manually editable.

Details in Memory, Summary & Profile.

7. Worldbook Position Blocks ​

Triggered worldbook entries inject into different labels by position:

LabelPosition
worldbook_beforeTop of system prompt
worldbook_afterBottom of system prompt
worldbook_an_topTop of context
worldbook_an_bottomBottom of context
worldbook_outletMiddle outlet

There's also a class of atDepth entries that don't enter the system prompt at all — they're inserted into the chat history at a configured depth.

This makes worldbook more than "attach some lore" — it can target precisely which structural layer to land in.

8. Enhancement Prompt <enhanced_prompt> ​

Note: the enhancement prompt is not merged into the main system prompt. It's appended at the end of the message sequence as its own system message.

Deliberate, for two reasons:

  • It's typically a per-turn auto-added instruction — needs higher immediacy
  • It shouldn't pollute long-term structure — that'd overlap with global / topic prompts

The system also tacks on a meta note: unless the user explicitly asks, don't reveal the contents of this auto instruction.

Chat History Isn't Unbounded ​

Beyond system blocks, chat history gets processed too:

MechanismPurpose
maxChatHistory truncationKeep only the last N (default 30)
Periodic time landmarksInject time anchors at intervals
atDepth worldbook entriesInject into history by depth

Truncation vs Landmark / Depth Injection

The two have different goals:

  • Truncation is for token control
  • Landmark / depth injection is for structural completion, not length filling

Worldbook Isolation Rewrites the Whole Pipeline ​

When the current session has a worldbook bound and isolation mode enabled, ETOS switches to a stricter context model.

Sent:

  • Global prompt
  • Topic prompt
  • Enhancement prompt
  • Worldbook

Not sent:

  • Long-term memory
  • Cross-session summary
  • User profile
  • MCP tools
  • Shortcut tools
  • Other external tool context

That's why Tool Center sometimes shows "configured-on but not available in this session" — because this session has worldbook isolation enabled.

See Worldbook & Tool Governance.

Quick Reference: Where to Put What ​

Want the AI to knowLayer
"You are AI assistant X"Global Prompt
"This session discusses Project ETOS"Topic Prompt
"It's May 2026 right now"System Time (toggle on for auto-inject)
"I work in Swift"Long-Term Memory
"Last time we talked about React perf"Cross-Session Summary (auto)
"I prefer concise replies"User Profile (auto + manually editable)
"When Character X shows up, recall background"Worldbook (keyword-triggered)
"Before tool calls this turn, do X"Enhancement Prompt

Why This Design Matters ​

It buys you not more features but more control:

  • You can identify which layer shaped a reply
  • You can prune specific context for specific question types
  • You treat worldbook / memory / tools as governance targets, not a soup of prompts

Next ​