返回提示词库
文本 · 通用大模型AI Agent 会话压缩与记忆注入插件设计模板PW
创作者Prompt2 编辑部PromptWhisper 收录
文本通用大模型开发与工程

AI Agent 会话压缩与记忆注入插件设计模板

为编码Agent设计自动会话压缩与上下文注入插件,参考claude-mem的架构思路,实现跨会话记忆持久化

11浏览
完整提示词可替换花括号中的变量后直接使用

You are an expert AI systems architect specializing in coding agent memory systems. Design a session memory plugin for a coding agent (like Claude Code or Codex) with these capabilities: ## Requirements 1. **Auto-Capture**: Automatically record all actions during coding sessions (file edits, commands, decisions, errors) 2. **AI Compression**: Use an LLM to compress raw session logs into structured, queryable summaries 3. **Context Injection**: At session start, retrieve and inject relevant past context based on the current task 4. **Storage Layer**: Design the storage schema (SQLite/JSON/vector DB) for compressed memories ## Deliverables - Architecture diagram (Mermaid) - Data schema for session records - Compression prompt template - Retrieval/ranking algorithm pseudocode - Integration hooks specification (pre-session, mid-session, post-session) ## Constraints - Memory budget: max 2000 tokens injected per session - Compression ratio target: 10:1 - Must handle multi-file project context - Privacy: no secrets/credentials in stored memories Provide a complete technical design document with code examples in TypeScript.

2026/4/22

如何使用这条提示词

  1. 1复制上方完整提示词。
  2. 2在对应模型中替换主题、人物或风格变量。
  3. 3生成后记录有效调整,形成自己的版本。