Flows category icon
Memory & Context
Beginner

Add File-Based Persistent Memory

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

4 steps12 verify checks45-75 minutesWorks with: emergent · chatgpt · claude · cursor
Start Guided Walkthrough

The Route

0/4 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 forgets everything between sessions and I keep being told I need a vector database. Practitioner reports and memory-system analyses show plain files (markdown/JSONL) cover most agent memory needs with full inspectability.

GOAL:
Implement file-based memory: a project memory file the agent reads at start and updates through a guarded tool, all inspectable in a text editor.

REQUIREMENTS:
- A MEMORY.md (or agent-memory directory) per project with defined sections
- Memory loaded into context at session start
- A memory_update tool the agent uses to add or revise entries
- Human-readable format: a user can read and edit the memory directly
- Size discipline: per-section caps with a consolidation routine

CONSTRAINTS:
- No databases, no embeddings in v1 - files only, versioned with the project
- Every memory write goes through the tool so writes are validated and logged

DEFINITION OF DONE:
- Facts recorded in one session are used correctly in the next
- The memory file remains readable and sensibly organized after 20+ writes
- User edits to the file are picked up on next session start
- Sections stay under their caps via consolidation, not silent truncation

COMMON FAILURES TO AVOID:
- Building embedding infrastructure for what a 200-line markdown file handles
- The agent appending duplicates because it never reads before writing
- A memory file that decays into an unstructured dump nobody trusts
- Writes scattered through code instead of one validated tool path

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

Session Summaries That Survive Compaction

Write durable session summaries at the right moments so knowledge outlives compaction and process restarts.

01Define what deserves to survive
02Write at the moments that matter
03Load summaries into new sessions

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate
Flows category icon
Memory & Context

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.

01Structure the index and details
02Wire loading: index always, details on demand
03Maintain the index as memory evolves

Best forbuilders who have shipped a basic app before

3 steps60-90 minutesIntermediate
Flows category icon
Memory & Context

Memory Write Policies

Decide what gets remembered: write gates, provenance, confidence, and validation - because memory quality is set at write time.

01Write the memorability criteria
02Attach provenance and confidence
03Detect and resolve contradictions

+1 more steps to Done

Best forbuilders who have shipped a basic app before

4 steps60-90 minutesIntermediate

Made with Emergent