Skip to main content
Engra

The L0–L3 wake-up stack: how agents load the right memory depth

L0 identity, L1 narrative, L2 topic recall, L3 deep search—when to call wake_up vs recall vs search, and why flat RAG context windows waste tokens.

The problem with flat context

Dumping “top-k chunks” into every turn treats all tasks as equally memory-hungry. A linter fix does not need your full customer narrative; a pricing negotiation does. Flat pipelines over-inject context, burn tokens, and still miss the right fact when chunks split across boundaries.

Engra’s concept guide defines four layers. Each layer answers a different question about what the agent should remember right now.

Layer by layer

L0 — Identity: Who is this agent for? Stable traits, tone, role boundaries. Loaded via memory_wake_up alongside L1.

L1 — Core narrative: The running story—project goals, active customer, current sprint theme. Also part of wake_up output so every session starts aligned.

L2 — Topic recall: Subject-specific summaries and clustered atoms. Use memory_recall when you know the topic area but need breadth.

L3 — Deep semantic search: Atom-level vector retrieval. Use memory_search when the question is narrow or cross-topic.

Choosing a call

Session start → wake_up (L0+L1). Topic shift mid-session → recall (L2). Specific fact lookup → search (L3). New durable fact → save_atom with Library/Scope/Topic metadata.

Skills document this decision tree so IDE agents do not spam search on every message. See our Agent Skills guide and production Skill workflows.

Explainability

Each layer returns atom IDs and path backlinks. You can log which atoms were injected per turn—critical for regulated workflows and debugging hallucinated citations.