Flows category icon
Memory & Context
Intermediate

Design a Memory Index Loaded Every Session

Build the pattern behind minimalist memory systems: a compact index file the agent always loads, pointing to detail files it loads on demand.

3 steps9 verify checks60-90 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/3 verified

Context Pack

Paste this first. It briefs the AI on requirements, constraints, and the Definition of Done before your first build prompt.

Context Pack
PROJECT CONTEXT:
My agent's memory grew past what fits in context, but most of it is irrelevant to any given task. The index pattern from minimalist memory systems solves this: always load a small index, lazily load details when the task needs them.

GOAL:
Split memory into an always-loaded index and on-demand detail files, with the agent trained to follow index pointers.

REQUIREMENTS:
- A compact index file (hard token cap) always loaded at session start
- Detail files per topic, referenced from the index with one-line descriptions
- A memory_read tool for loading detail files on demand
- Index entries carry enough signal for relevance decisions without opening details
- Index maintenance: new topics added, stale pointers pruned

CONSTRAINTS:
- The index never exceeds its cap - details always live in detail files
- Every detail file must be reachable from the index or it does not exist

DEFINITION OF DONE:
- Session start loads only the index; context cost is small and constant
- Given a relevant task, the agent loads the right detail file unprompted
- Given an irrelevant task, no detail files are loaded
- The index accurately reflects the detail files after multiple sessions of updates

COMMON FAILURES TO AVOID:
- An 'index' that grew into the very memory dump it was meant to replace
- Detail files the agent never loads because index descriptions are too vague
- Orphaned detail files invisible to the index
- Loading every detail file every time, defeating the entire design

Paste this into your AI builder first. It teaches the AI what you want before you give it the build prompt.

Related routes

More Memory & Context flows that share ground with this one.

Flows category icon
Memory & Context

Add File-Based Persistent Memory

Give your agent durable memory with plain files - the radical-minimalism approach production practitioners keep converging on.

01Design the memory file structure
02Load memory at session start
03Build the guarded memory_update tool

+1 more steps to Done

Best foryour first pass at this - no prior setup assumed

4 steps45-75 minutesBeginner
Flows category icon
Memory & Context

Cross-Session Project State

Keep long-horizon work coherent across many sessions: externalized project state that any session can load, advance, and hand off.

01Design the project-state document
02Implement the session-start protocol
03Implement the session-end advance

+1 more steps to Done

Best forproduction-grade builds with strict verification

4 steps90-120 minutesAdvanced
Flows category icon
Memory & Context

Episodic, Semantic, and Procedural Stores

Organize agent memory by kind - what happened, what is true, and how to do things - instead of one undifferentiated pile.

01Define the three schemas
02Build classification and routing
03Implement type-appropriate recall

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate

Made with Emergent