# local memory for AI agents Source: https://docs.screenpipe.com/agent-memory-workflow Give Claude, Codex, Cursor, and other AI agents continuity across sessions with small source-backed local context files built from screenpipe history. screenpipe cannot restore an AI model's hidden context. it can give the next session a local record of recent work: what changed, what was decided, what remains open, and where the evidence came from. ## two ways to start | method | choose it when | | --------------------------- | --------------------------------------------------------------------- | | [MCP](/mcp-server) search | the agent should query recent screen history on demand | | periodic local context file | several tools need the same compact project state over days or months | ```mermaid theme={null} flowchart TD A["bounded screenpipe history"] --> B["extract facts and open loops"] B --> C["reviewed local context file"] C --> D["Claude, Codex, Cursor, or another agent"] D --> E["new work"] E --> A ``` ## build a context file Start with one Markdown file in a private project folder, wiki, or Obsidian vault. avoid creating several competing memory stores on day one. Keep current objectives, recent changes, decisions, open loops, blockers, and source time ranges. separate durable facts from short-lived activity. Ask screenpipe or your MCP-connected agent to review a bounded period and update the file. require it to preserve still-valid entries and mark missing evidence. Remove secrets and irrelevant personal detail. confirm that decisions were accepted rather than merely discussed. Add one line to the project's agent instructions telling tools to read the file at the start of relevant work and update it only under your chosen policy. Once manual updates are reliable, run the pipe hourly or daily. keep a last-updated time and an explicit “no new evidence” state. ## starter schema ```markdown theme={null} # project context last reviewed: source window: to ## current objective - ... ## recent verified changes - fact — source: ,