[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BZQSWFNG1WKTBPVARB7C84":3,"skill-same:01M7BZQSWFNG1WKTBPVARB7C84":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7BZQSWFNG1WKTBPVARB7C84","conversation-memory",null,"Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fplugins\u002Fantigravity-awesome-skills-claude\u002Fskills\u002Fconversation-memory\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: conversation-memory\ndescription: Persistent memory systems for LLM conversations including\n  short-term, long-term, and entity-based memory\nrisk: unknown\nsource: vibeship-spawner-skills (Apache 2.0)\ndate_added: 2026-02-27\n---\n\n# Conversation Memory\n\nPersistent memory systems for LLM conversations including short-term, long-term, and entity-based memory\n\n## Capabilities\n\n- short-term-memory\n- long-term-memory\n- entity-memory\n- memory-persistence\n- memory-retrieval\n- memory-consolidation\n\n## Prerequisites\n\n- Knowledge: LLM conversation patterns, Database basics, Key-value stores\n- Skills_recommended: context-window-management, rag-implementation\n\n## Scope\n\n- Does_not_cover: Knowledge graph construction, Semantic search implementation, Database administration\n- Boundaries: Focus is memory patterns for LLMs, Covers storage and retrieval strategies\n\n## Ecosystem\n\n### Primary_tools\n\n- Mem0 - Memory layer for AI applications\n- LangChain Memory - Memory utilities in LangChain\n- Redis - In-memory data store for session memory\n\n## Patterns\n\n### Tiered Memory System\n\nDifferent memory tiers for different purposes\n\n**When to use**: Building any conversational AI\n\ninterface MemorySystem {\n    \u002F\u002F Buffer: Current conversation (in context)\n    buffer: ConversationBuffer;\n\n    \u002F\u002F Short-term: Recent interactions (session)\n    shortTerm: ShortTermMemory;\n\n    \u002F\u002F Long-term: Persistent across sessions\n    longTerm: LongTermMemory;\n\n    \u002F\u002F Entity: Facts about people, places, things\n    entity: EntityMemory;\n}\n\nclass TieredMemory implements MemorySystem {\n    async addMessage(message: Message): Promise\u003Cvoid> {\n        \u002F\u002F Always add to buffer\n        this.buffer.add(message);\n\n        \u002F\u002F Extract entities\n        const entities = await extractEntities(message);\n        for (const entity of entities) {\n            await this.entity.upsert(entity);\n        }\n\n        \u002F\u002F Check for memorable content\n        if (await isMemoryWorthy(message)) {\n            await this.shortTerm.add({\n                content: message.content,\n                timestamp: Date.now(),\n                importance: await scoreImportance(message)\n            });\n        }\n    }\n\n    async consolidate(): Promise\u003Cvoid> {\n        \u002F\u002F Move important short-term to long-term\n        const memories = await this.shortTerm.getOld(24 * 60 * 60 * 1000);\n        for (const memory of memories) {\n            if (memory.importance > 0.7 || memory.referenced > 2) {\n                await this.longTerm.add(memory);\n            }\n            await this.shortTerm.remove(memory.id);\n        }\n    }\n\n    async buildContext(query: string): Promise\u003Cstring> {\n        const parts: string[] = [];\n\n        \u002F\u002F Relevant long-term memories\n        const longTermRelevant = await this.longTerm.search(query, 3);\n        if (longTermRelevant.length) {\n            parts.push('## Relevant Memories\\n' +\n                longTermRelevant.map(m => `- ${m.content}`).join('\\n'));\n        }\n\n        \u002F\u002F Relevant entities\n        const entities = await this.entity.getRelevant(query);\n        if (entities.length) {\n            parts.push('## Known Entities\\n' +\n                entities.map(e => `- ${e.name}: ${e.facts.join(', ')}`).join('\\n'));\n        }\n\n        \u002F\u002F Recent conversation\n        const recent = this.buffer.getRecent(10);\n        parts.push('## Recent Conversation\\n' + formatMessages(recent));\n\n        return parts.join('\\n\\n');\n    }\n}\n\n### Entity Memory\n\nStore and update facts about entities\n\n**When to use**: Need to remember details about people, places, things\n\ninterface Entity {\n    id: string;\n    name: string;\n    type: 'person' | 'place' | 'thing' | 'concept';\n    facts: Fact[];\n    lastMentioned: number;\n    mentionCount: number;\n}\n\ninterface Fact {\n    content: string;\n    confidence: number;\n    source: string;  \u002F\u002F Which message this came from\n    timestamp: number;\n}\n\nclass EntityMemory {\n    async extractAndStore(message: Message): Promise\u003Cvoid> {\n        \u002F\u002F Use LLM to extract entities and facts\n        const extraction = await llm.complete(`\n            Extract entities and facts from this message.\n            Return JSON: { \"entities\": [\n                { \"name\": \"...\", \"type\": \"...\", \"facts\": [\"...\"] }\n            ]}\n\n            Message: \"${message.content}\"\n        `);\n\n        const { entities } = JSON.parse(extraction);\n        for (const entity of entities) {\n            await this.upsert(entity, message.id);\n        }\n    }\n\n    async upsert(entity: ExtractedEntity, sourceId: string): Promise\u003Cvoid> {\n        const existing = await this.store.get(entity.name.toLowerCase());\n\n        if (existing) {\n            \u002F\u002F Merge facts, avoiding duplicates\n            for (const fact of entity.facts) {\n                if (!this.hasSimilarFact(existing.facts, fact)) {\n                    existing.facts.push({\n                        content: fact,\n                        confidence: 0.9,\n                        source: sourceId,\n                        timestamp: Date.now()\n                    });\n                }\n            }\n            existing.lastMentioned = Date.now();\n            existing.mentionCount++;\n            await this.store.set(existing.id, existing);\n        } else {\n            \u002F\u002F Create new entity\n            await this.store.set(entity.name.toLowerCase(), {\n                id: generateId(),\n                name: entity.name,\n                type: entity.type,\n                facts: entity.facts.map(f => ({\n                    content: f,\n                    confidence: 0.9,\n                    source: sourceId,\n                    timestamp: Date.now()\n                })),\n                lastMentioned: Date.now(),\n                mentionCount: 1\n            });\n        }\n    }\n}\n\n### Memory-Aware Prompting\n\nInclude relevant memories in prompts\n\n**When to use**: Making LLM calls with memory context\n\nasync function promptWithMemory(\n    query: string,\n    memory: MemorySystem,\n    systemPrompt: string\n): Promise\u003Cstring> {\n    \u002F\u002F Retrieve relevant memories\n    const relevantMemories = await memory.longTerm.search(query, 5);\n    const entities = await memory.entity.getRelevant(query);\n    const recentContext = memory.buffer.getRecent(5);\n\n    \u002F\u002F Build memory-augmented prompt\n    const prompt = `\n${systemPrompt}\n\n## User Context\n${entities.length ? `Known about user:\\n${entities.map(e =>\n    `- ${e.name}: ${e.facts.map(f => f.content).join('; ')}`\n).join('\\n')}` : ''}\n\n${relevantMemories.length ? `Relevant past interactions:\\n${relevantMemories.map(m =>\n    `- [${formatDate(m.timestamp)}] ${m.content}`\n).join('\\n')}` : ''}\n\n## Recent Conversation\n${formatMessages(recentContext)}\n\n## Current Query\n${query}\n    `.trim();\n\n    const response = await llm.complete(prompt);\n\n    \u002F\u002F Extract any new memories from response\n    await memory.addMessage({ role: 'assistant', content: response });\n\n    return response;\n}\n\n## Sharp Edges\n\n### Memory store grows unbounded, system slows\n\nSeverity: HIGH\n\nSituation: System slows over time, costs increase\n\nSymptoms:\n- Slow memory retrieval\n- High storage costs\n- Increasing latency over time\n\nWhy this breaks:\nEvery message stored as memory.\nNo cleanup or consolidation.\nRetrieval over millions of items.\n\nRecommended fix:\n\n\u002F\u002F Implement memory lifecycle management\n\nclass ManagedMemory {\n    \u002F\u002F Limits\n    private readonly SHORT_TERM_MAX = 100;\n    private readonly LONG_TERM_MAX = 10000;\n    private readonly CONSOLIDATION_INTERVAL = 24 * 60 * 60 * 1000;\n\n    async add(memory: Memory): Promise\u003Cvoid> {\n        \u002F\u002F Score importance before storing\n        const score = await this.scoreImportance(memory);\n        if (score \u003C 0.3) return;  \u002F\u002F Don't store low-importance\n\n        memory.importance = score;\n        await this.shortTerm.add(memory);\n\n        \u002F\u002F Check limits\n        await this.enforceShortTermLimit();\n    }\n\n    async enforceShortTermLimit(): Promise\u003Cvoid> {\n        const count = await this.shortTerm.count();\n        if (count > this.SHORT_TERM_MAX) {\n            \u002F\u002F Consolidate: move important to long-term, delete rest\n            const memories = await this.shortTerm.getAll();\n            memories.sort((a, b) => b.importance - a.importance);\n\n            const toKeep = memories.slice(0, this.SHORT_TERM_MAX * 0.7);\n            const toConsolidate = memories.slice(this.SHORT_TERM_MAX * 0.7);\n\n            for (const m of toConsolidate) {\n                if (m.importance > 0.7) {\n                    await this.longTerm.add(m);\n                }\n                await this.shortTerm.remove(m.id);\n            }\n        }\n    }\n\n    async scoreImportance(memory: Memory): Promise\u003Cnumber> {\n        const factors = {\n            hasUserPreference: \u002Fprefer|like|don't like|hate|love\u002Fi.test(memory.content) ? 0.3 : 0,\n            hasDecision: \u002Fdecided|chose|will do|won't do\u002Fi.test(memory.content) ? 0.3 : 0,\n            hasFactAboutUser: \u002Fmy|I am|I have|I work\u002Fi.test(memory.content) ? 0.2 : 0,\n            length: memory.content.length > 100 ? 0.1 : 0,\n            userMessage: memory.role === 'user' ? 0.1 : 0,\n        };\n\n        return Object.values(factors).reduce((a, b) => a + b, 0);\n    }\n}\n\n### Retrieved memories not relevant to current query\n\nSeverity: HIGH\n\nSituation: Memories included in context but don't help\n\nSymptoms:\n- Memories in context seem random\n- User asks about things already in memory\n- Confusion from irrelevant context\n\nWhy this breaks:\nSimple keyword matching.\nNo relevance scoring.\nIncluding all retrieved memories.\n\nRecommended fix:\n\n\u002F\u002F Intelligent memory retrieval\n\nasync function retrieveRelevant(\n    query: string,\n    memories: MemoryStore,\n    maxResults: number = 5\n): Promise\u003CMemory[]> {\n    \u002F\u002F 1. Semantic search\n    const candidates = await memories.semanticSearch(query, maxResults * 3);\n\n    \u002F\u002F 2. Score relevance with context\n    const scored = await Promise.all(candidates.map(async (m) => {\n        const relevanceScore = await llm.complete(`\n            Rate 0-1 how relevant this memory is to the query.\n            Query: \"${query}\"\n            Memory: \"${m.content}\"\n            Return just the number.\n        `);\n        return { ...m, relevance: parseFloat(relevanceScore) };\n    }));\n\n    \u002F\u002F 3. Filter low relevance\n    const relevant = scored.filter(m => m.relevance > 0.5);\n\n    \u002F\u002F 4. Sort and limit\n    return relevant\n        .sort((a, b) => b.relevance - a.relevance)\n        .slice(0, maxResults);\n}\n\n### Memories from one user accessible to another\n\nSeverity: CRITICAL\n\nSituation: User sees information from another user's sessions\n\nSymptoms:\n- User sees other user's information\n- Privacy complaints\n- Compliance violations\n\nWhy this breaks:\nNo user isolation in memory store.\nShared memory namespace.\nCross-user retrieval.\n\nRecommended fix:\n\n\u002F\u002F Strict user isolation in memory\n\nclass IsolatedMemory {\n    private getKey(userId: string, memoryId: string): string {\n        \u002F\u002F Namespace all keys by user\n        return `user:${userId}:memory:${memoryId}`;\n    }\n\n    async add(userId: string, memory: Memory): Promise\u003Cvoid> {\n        \u002F\u002F Validate userId is authenticated\n        if (!isValidUserId(userId)) {\n            throw new Error('Invalid user ID');\n        }\n\n        const key = this.getKey(userId, memory.id);\n        memory.userId = userId;  \u002F\u002F Tag with user\n        await this.store.set(key, memory);\n    }\n\n    async search(userId: string, query: string): Promise\u003CMemory[]> {\n        \u002F\u002F CRITICAL: Filter by user in query\n        return await this.store.search({\n            query,\n            filter: { userId: userId },  \u002F\u002F Mandatory filter\n            limit: 10\n        });\n    }\n\n    async delete(userId: string, memoryId: string): Promise\u003Cvoid> {\n        const memory = await this.get(userId, memoryId);\n        \u002F\u002F Verify ownership before delete\n        if (memory.userId !== userId) {\n            throw new Error('Access denied');\n        }\n        await this.store.delete(this.getKey(userId, memoryId));\n    }\n\n    \u002F\u002F User data export (GDPR compliance)\n    async exportUserData(userId: string): Promise\u003CMemory[]> {\n        return await this.store.getAll({ userId });\n    }\n\n    \u002F\u002F User data deletion (GDPR compliance)\n    async deleteUserData(userId: string): Promise\u003Cvoid> {\n        const memories = await this.exportUserData(userId);\n        for (const m of memories) {\n            await this.store.delete(this.getKey(userId, m.id));\n        }\n    }\n}\n\n## Validation Checks\n\n### No User Isolation in Memory\n\nSeverity: CRITICAL\n\nMessage: Memory operations without user isolation. Privacy vulnerability.\n\nFix action: Add userId to all memory operations, filter by user on retrieval\n\n### No Importance Filtering\n\nSeverity: WARNING\n\nMessage: Storing memories without importance filtering. May cause memory explosion.\n\nFix action: Score importance before storing, filter low-importance content\n\n### Memory Storage Without Retrieval\n\nSeverity: WARNING\n\nMessage: Storing memories but no retrieval logic. Memories won't be used.\n\nFix action: Implement memory retrieval and include in prompts\n\n### No Memory Cleanup\n\nSeverity: INFO\n\nMessage: No memory cleanup mechanism. Storage will grow unbounded.\n\nFix action: Implement consolidation and cleanup based on age\u002Fimportance\n\n## Collaboration\n\n### Delegation Triggers\n\n- context window|token -> context-window-management (Need context optimization)\n- rag|retrieval|vector -> rag-implementation (Need retrieval system)\n- cache|caching -> prompt-caching (Need caching strategies)\n\n### Complete Memory System\n\nSkills: conversation-memory, context-window-management, rag-implementation\n\nWorkflow:\n\n```\n1. Design memory tiers\n2. Implement storage and retrieval\n3. Integrate with context management\n4. Add consolidation and cleanup\n```\n\n## Related Skills\n\nWorks well with: `context-window-management`, `rag-implementation`, `prompt-caching`, `llm-npc-dialogue`\n\n## When to Use\n- User mentions or implies: conversation memory\n- User mentions or implies: remember\n- User mentions or implies: memory persistence\n- User mentions or implies: long-term memory\n- User mentions or implies: chat history\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","# Conversation Memory\n\nPersistent memory systems for LLM conversations including short-term, long-term, and entity-based memory\n\n## Capabilities\n\n- short-term-memory\n- long-term-memory\n- entity-memory\n- memory-persistence\n- memory-retrieval\n- memory-consolidation\n\n## Prerequisites\n\n- Knowledge: LLM conversation patterns, Database basics, Key-value stores\n- Skills_recommended: context-window-management, rag-implementation\n\n## Scope\n\n- Does_not_cover: Knowledge graph construction, Semantic search implementation, Database administration\n- Boundaries: Focus is memory patterns for LLMs, Covers storage and retrieval strategies\n\n## Ecosystem\n\n### Primary_tools\n\n- Mem0 - Memory layer for AI applications\n- LangChain Memory - Memory utilities in LangChain\n- Redis - In-memory data store for session memory\n\n## Patterns\n\n### Tiered Memory System\n\nDifferent memory tiers for different purposes\n\n**When to use**: Building any conversational AI\n\ninterface MemorySystem {\n    \u002F\u002F Buffer: Current conversation (in context)\n    buffer: ConversationBuffer;\n\n    \u002F\u002F Short-term: Recent interactions (session)\n    shortTerm: ShortTermMemory;\n\n    \u002F\u002F Long-term: Persistent across sessions\n    longTerm: LongTermMemory;\n\n    \u002F\u002F Entity: Facts about people, places, things\n    entity: EntityMemory;\n}\n\nclass TieredMemory implements MemorySystem {\n    async addMessage(message: Message): Promise\u003Cvoid> {\n        \u002F\u002F Always add to buffer\n        this.buffer.add(message);\n\n        \u002F\u002F Extract entities\n        const entities = await extractEntities(message);\n        for (const entity of entities) {\n            await this.entity.upsert(entity);\n        }\n\n        \u002F\u002F Check for memorable content\n        if (await isMemoryWorthy(message)) {\n            await this.shortTerm.add({\n                content: message.content,\n                timestamp: Date.now(),\n                importance: await scoreImportance(message)\n            });\n        }\n    }\n\n    async consolidate(): Promise\u003Cvoid> {\n        \u002F\u002F Move important short-term to long-term\n        const memories = await this.shortTerm.getOld(24 * 60 * 60 * 1000);\n        for (const memory of memories) {\n            if (memory.importance > 0.7 || memory.referenced > 2) {\n                await this.longTerm.add(memory);\n            }\n            await this.shortTerm.remove(memory.id);\n        }\n    }\n\n    async buildContext(query: string): Promise\u003Cstring> {\n        const parts: string[] = [];\n\n        \u002F\u002F Relevant long-term memories\n        const longTermRelevant = await this.longTerm.search(query, 3);\n        if (longTermRelevant.length) {\n            parts.push('## Relevant Memories\\n' +\n                longTermRelevant.map(m => `- ${m.content}`).join('\\n'));\n        }\n\n        \u002F\u002F Relevant entities\n        const entities = await this.entity.getRelevant(query);\n        if (entities.length) {\n            parts.push('## Known Entities\\n' +\n                entities.map(e => `- ${e.name}: ${e.facts.join(', ')}`).join('\\n'));\n        }\n\n        \u002F\u002F Recent conversation\n        const recent = this.buffer.getRecent(10);\n        parts.push('## Recent Conversation\\n' + formatMessages(recent));\n\n        return parts.join('\\n\\n');\n    }\n}\n\n### Entity Memory\n\nStore and update facts about entities\n\n**When to use**: Need to remember details about people, places, things\n\ninterface Entity {\n    id: string;\n    name: string;\n    type: 'person' | 'place' | 'thing' | 'concept';\n    facts: Fact[];\n    lastMentioned: number;\n    mentionCount: number;\n}\n\ninterface Fact {\n    content: string;\n    confidence: number;\n    source: string;  \u002F\u002F Which message this came from\n    timestamp: number;\n}\n\nclass EntityMemory {\n    async extractAndStore(message: Message): Promise\u003Cvoid> {\n        \u002F\u002F Use LLM to extract entities and facts\n        const extraction = await llm.complete(`\n            Extract entities and facts from this message.\n            Return JSON: { \"entities\": [\n                { \"name\": \"...\", \"type\": \"...\", \"facts\": [\"...\"] }\n            ]}\n\n            Message: \"${message.content}\"\n        `);\n\n        const { entities } = JSON.parse(extraction);\n        for (const entity of entities) {\n            await this.upsert(entity, message.id);\n        }\n    }\n\n    async upsert(entity: ExtractedEntity, sourceId: string): Promise\u003Cvoid> {\n        const existing = await this.store.get(entity.name.toLowerCase());\n\n        if (existing) {\n            \u002F\u002F Merge facts, avoiding duplicates\n            for (const fact of entity.facts) {\n                if (!this.hasSimilarFact(existing.facts, fact)) {\n                    existing.facts.push({\n                        content: fact,\n                        confidence: 0.9,\n                        source: sourceId,\n                        timestamp: Date.now()\n                    });\n                }\n            }\n            existing.lastMentioned = Date.now();\n            existing.mentionCount++;\n            await this.store.set(existing.id, existing);\n        } else {\n            \u002F\u002F Create new entity\n            await this.store.set(entity.name.toLowerCase(), {\n                id: generateId(),\n                name: entity.name,\n                type: entity.type,\n                facts: entity.facts.map(f => ({\n                    content: f,\n                    confidence: 0.9,\n                    source: sourceId,\n                    timestamp: Date.now()\n                })),\n                lastMentioned: Date.now(),\n                mentionCount: 1\n            });\n        }\n    }\n}\n\n### Memory-Aware Prompting\n\nInclude relevant memories in prompts\n\n**When to use**: Making LLM calls with memory context\n\nasync function promptWithMemory(\n    query: string,\n    memory: MemorySystem,\n    systemPrompt: string\n): Promise\u003Cstring> {\n    \u002F\u002F Retrieve relevant memories\n    const relevantMemories = await memory.longTerm.search(query, 5);\n    const entities = await memory.entity.getRelevant(query);\n    const recentContext = memory.buffer.getRecent(5);\n\n    \u002F\u002F Build memory-augmented prompt\n    const prompt = `\n${systemPrompt}\n\n## User Context\n${entities.length ? `Known about user:\\n${entities.map(e =>\n    `- ${e.name}: ${e.facts.map(f => f.content).join('; ')}`\n).join('\\n')}` : ''}\n\n${relevantMemories.length ? `Relevant past interactions:\\n${relevantMemories.map(m =>\n    `- [${formatDate(m.timestamp)}] ${m.content}`\n).join('\\n')}` : ''}\n\n## Recent Conversation\n${formatMessages(recentContext)}\n\n## Current Query\n${query}\n    `.trim();\n\n    const response = await llm.complete(prompt);\n\n    \u002F\u002F Extract any new memories from response\n    await memory.addMessage({ role: 'assistant', content: response });\n\n    return response;\n}\n\n## Sharp Edges\n\n### Memory store grows unbounded, system slows\n\nSeverity: HIGH\n\nSituation: System slows over time, costs increase\n\nSymptoms:\n- Slow memory retrieval\n- High storage costs\n- Increasing latency over time\n\nWhy this breaks:\nEvery message stored as memory.\nNo cleanup or consolidation.\nRetrieval over millions of items.\n\nRecommended fix:\n\n\u002F\u002F Implement memory lifecycle management\n\nclass ManagedMemory {\n    \u002F\u002F Limits\n    private readonly SHORT_TERM_MAX = 100;\n    private readonly LONG_TERM_MAX = 10000;\n    private readonly CONSOLIDATION_INTERVAL = 24 * 60 * 60 * 1000;\n\n    async add(memory: Memory): Promise\u003Cvoid> {\n        \u002F\u002F Score importance before storing\n        const score = await this.scoreImportance(memory);\n        if (score \u003C 0.3) return;  \u002F\u002F Don't store low-importance\n\n        memory.importance = score;\n        await this.shortTerm.add(memory);\n\n        \u002F\u002F Check limits\n        await this.enforceShortTermLimit();\n    }\n\n    async enforceShortTermLimit(): Promise\u003Cvoid> {\n        const count = await this.shortTerm.count();\n        if (count > this.SHORT_TERM_MAX) {\n            \u002F\u002F Consolidate: move important to long-term, delete rest\n            const memories = await this.shortTerm.getAll();\n            memories.sort((a, b) => b.importance - a.importance);\n\n            const toKeep = memories.slice(0, this.SHORT_TERM_MAX * 0.7);\n            const toConsolidate = memories.slice(this.SHORT_TERM_MAX * 0.7);\n\n            for (const m of toConsolidate) {\n                if (m.importance > 0.7) {\n                    await this.longTerm.add(m);\n                }\n                await this.shortTerm.remove(m.id);\n            }\n        }\n    }\n\n    async scoreImportance(memory: Memory): Promise\u003Cnumber> {\n        const factors = {\n            hasUserPreference: \u002Fprefer|like|don't like|hate|love\u002Fi.test(memory.content) ? 0.3 : 0,\n            hasDecision: \u002Fdecided|chose|will do|won't do\u002Fi.test(memory.content) ? 0.3 : 0,\n            hasFactAboutUser: \u002Fmy|I am|I have|I work\u002Fi.test(memory.content) ? 0.2 : 0,\n            length: memory.content.length > 100 ? 0.1 : 0,\n            userMessage: memory.role === 'user' ? 0.1 : 0,\n        };\n\n        return Object.values(factors).reduce((a, b) => a + b, 0);\n    }\n}\n\n### Retrieved memories not relevant to current query\n\nSeverity: HIGH\n\nSituation: Memories included in context but don't help\n\nSymptoms:\n- Memories in context seem random\n- User asks about things already in memory\n- Confusion from irrelevant context\n\nWhy this breaks:\nSimple keyword matching.\nNo relevance scoring.\nIncluding all retrieved memories.\n\nRecommended fix:\n\n\u002F\u002F Intelligent memory retrieval\n\nasync function retrieveRelevant(\n    query: string,\n    memories: MemoryStore,\n    maxResults: number = 5\n): Promise\u003CMemory[]> {\n    \u002F\u002F 1. Semantic search\n    const candidates = await memories.semanticSearch(query, maxResults * 3);\n\n    \u002F\u002F 2. Score relevance with context\n    const scored = await Promise.all(candidates.map(async (m) => {\n        const relevanceScore = await llm.complete(`\n            Rate 0-1 how relevant this memory is to the query.\n            Query: \"${query}\"\n            Memory: \"${m.content}\"\n            Return just the number.\n        `);\n        return { ...m, relevance: parseFloat(relevanceScore) };\n    }));\n\n    \u002F\u002F 3. Filter low relevance\n    const relevant = scored.filter(m => m.relevance > 0.5);\n\n    \u002F\u002F 4. Sort and limit\n    return relevant\n        .sort((a, b) => b.relevance - a.relevance)\n        .slice(0, maxResults);\n}\n\n### Memories from one user accessible to another\n\nSeverity: CRITICAL\n\nSituation: User sees information from another user's sessions\n\nSymptoms:\n- User sees other user's information\n- Privacy complaints\n- Compliance violations\n\nWhy this breaks:\nNo user isolation in memory store.\nShared memory namespace.\nCross-user retrieval.\n\nRecommended fix:\n\n\u002F\u002F Strict user isolation in memory\n\nclass IsolatedMemory {\n    private getKey(userId: string, memoryId: string): string {\n        \u002F\u002F Namespace all keys by user\n        return `user:${userId}:memory:${memoryId}`;\n    }\n\n    async add(userId: string, memory: Memory): Promise\u003Cvoid> {\n        \u002F\u002F Validate userId is authenticated\n        if (!isValidUserId(userId)) {\n            throw new Error('Invalid user ID');\n        }\n\n        const key = this.getKey(userId, memory.id);\n        memory.userId = userId;  \u002F\u002F Tag with user\n        await this.store.set(key, memory);\n    }\n\n    async search(userId: string, query: string): Promise\u003CMemory[]> {\n        \u002F\u002F CRITICAL: Filter by user in query\n        return await this.store.search({\n            query,\n            filter: { userId: userId },  \u002F\u002F Mandatory filter\n            limit: 10\n        });\n    }\n\n    async delete(userId: string, memoryId: string): Promise\u003Cvoid> {\n        const memory = await this.get(userId, memoryId);\n        \u002F\u002F Verify ownership before delete\n        if (memory.userId !== userId) {\n            throw new Error('Access denied');\n        }\n        await this.store.delete(this.getKey(userId, memoryId));\n    }\n\n    \u002F\u002F User data export (GDPR compliance)\n    async exportUserData(userId: string): Promise\u003CMemory[]> {\n        return await this.store.getAll({ userId });\n    }\n\n    \u002F\u002F User data deletion (GDPR compliance)\n    async deleteUserData(userId: string): Promise\u003Cvoid> {\n        const memories = await this.exportUserData(userId);\n        for (const m of memories) {\n            await this.store.delete(this.getKey(userId, m.id));\n        }\n    }\n}\n\n## Validation Checks\n\n### No User Isolation in Memory\n\nSeverity: CRITICAL\n\nMessage: Memory operations without user isolation. Privacy vulnerability.\n\nFix action: Add userId to all memory operations, filter by user on retrieval\n\n### No Importance Filtering\n\nSeverity: WARNING\n\nMessage: Storing memories without importance filtering. May cause memory explosion.\n\nFix action: Score importance before storing, filter low-importance content\n\n### Memory Storage Without Retrieval\n\nSeverity: WARNING\n\nMessage: Storing memories but no retrieval logic. Memories won't be used.\n\nFix action: Implement memory retrieval and include in prompts\n\n### No Memory Cleanup\n\nSeverity: INFO\n\nMessage: No memory cleanup mechanism. Storage will grow unbounded.\n\nFix action: Implement consolidation and cleanup based on age\u002Fimportance\n\n## Collaboration\n\n### Delegation Triggers\n\n- context window|token -> context-window-management (Need context optimization)\n- rag|retrieval|vector -> rag-implementation (Need retrieval system)\n- cache|caching -> prompt-caching (Need caching strategies)\n\n### Complete Memory System\n\nSkills: conversation-memory, context-window-management, rag-implementation\n\nWorkflow:\n\n```\n1. Design memory tiers\n2. Implement storage and retrieval\n3. Integrate with context management\n4. Add consolidation and cleanup\n```\n\n## Related Skills\n\nWorks well with: `context-window-management`, `rag-implementation`, `prompt-caching`, `llm-npc-dialogue`\n\n## When to Use\n- User mentions or implies: conversation memory\n- User mentions or implies: remember\n- User mentions or implies: memory persistence\n- User mentions or implies: long-term memory\n- User mentions or implies: chat history\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n",{"name":5,"risk":24,"source":25,"date_added":26,"description":7},"unknown","vibeship-spawner-skills (Apache 2.0)",1772150400000,"main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fplugins\u002Fantigravity-awesome-skills-claude\u002Fskills\u002Fconversation-memory",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill conversation-memory",{"tool":42,"command":43},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill conversation-memory",{"tool":45,"command":46},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill conversation-memory","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fplugins\u002Fantigravity-awesome-skills-claude\u002Fskills\u002Fconversation-memory\u002FSKILL.md",true,[],[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]