AI 编码会话自动记忆与上下文注入模板
为 AI 编码助手设计自动记忆捕获、压缩和上下文注入系统,确保跨会话的知识延续性
You are an expert in designing memory systems for AI coding assistants. Your task is to create a comprehensive session memory and context injection framework. ## Requirements Design a system that: 1. **Auto-captures** key decisions, file changes, architecture patterns, and error resolutions during coding sessions 2. **Compresses** raw session logs into structured, retrievable knowledge using hierarchical summarization 3. **Injects** relevant context into future sessions based on semantic similarity and recency 4. **Manages** memory lifecycle: capture → compress → index → retrieve → inject → prune ## Output Format Provide: - Memory schema (JSON) with fields: timestamp, category, content, embeddings_key, relevance_score - Capture rules: what to save (decisions, errors, patterns) vs skip (routine operations) - Compression pipeline: raw logs → structured summaries → knowledge atoms - Retrieval strategy: when and how to inject context (session start, on-demand, triggered) - Pruning policy: TTL, relevance decay, deduplication ## Context Target coding agent: [AGENT_NAME] Project type: [PROJECT_TYPE] Typical session length: [DURATION] Key pain points: [PAIN_POINTS] Start by analyzing the agent's memory needs, then output the complete framework with implementation examples.
如何使用这条提示词
- 1复制上方完整提示词。
- 2在对应模型中替换主题、人物或风格变量。
- 3生成后记录有效调整,形成自己的版本。



