Skip to content
C.W.K.
Stream
Lesson 03 of 07 · published

ContextEngine — Vault → System Prompt

~11 min · context-engine, system-prompt

Level 0Curious
0 XP0/69 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

Load order matters

For WebUI, backend/context/engine.py loads the soul identity file first, then shared instructions.md and shared core/*, soul-specific instructions.md and core/*, and finally index/*. The soul layer follows the shared layer so a soul-specific override wins on the same topic. Some reference doctrine stays as an on-demand pointer by kind, and oversized index material is also represented by a path instead of being inlined.

RAG injection

The system prompt also includes RAG context (next lesson). RAG runs before the system prompt is finalized — the retrieved chunks become a section of the system prompt, not a user message.

Cache hint

The vault content is huge. The Claude SDK uses prefix caching — same vault content across sessions, same prefix, cached. Tokens billed once, reused on every session start. The cache hint is implicit; the structure is what makes it work.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue
💛 by Pippawarm💛 by Ttoriwarm

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.