conversation-memory
Skill này làm gì
Công cụ này giúp AI nhớ các cuộc trò chuyện trước. Nó lưu những gì vừa được nói và cả thông tin dài hạn quan trọng, như chi tiết về người hoặc sự vật được nhắc đến.
Khi nào nên dùng
- ✓Khi xây dựng bất kỳ loại chatbot hoặc trợ lý ảo nào.
- ✓Khi bạn muốn AI nhớ lại các chi tiết cụ thể từ cuộc trò chuyện trước.
- ✓Để tạo trải nghiệm người dùng cá nhân hóa và liền mạch hơn.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/conversation-memory/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“AI, hãy nhớ rằng tên tôi là John và tôi thích chó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Nó hoạt động như bộ não của AI. Nó giữ các tin nhắn gần đây trong bộ nhớ ngắn hạn và thông tin quan trọng hơn trong bộ nhớ dài hạn. Nó cũng ghi lại các sự kiện về người, nơi chốn hoặc sự vật được nhắc đến.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Conversation Memory
Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory
Capabilities
- short-term-memory
- long-term-memory
- entity-memory
- memory-persistence
- memory-retrieval
- memory-consolidation
Prerequisites
- Knowledge: LLM conversation patterns, Database basics, Key-value stores
- Skills_recommended: context-window-management, rag-implementation
Scope
- Does_not_cover: Knowledge graph construction, Semantic search implementation, Database administration
- Boundaries: Focus is memory patterns for LLMs, Covers storage and retrieval strategies
Ecosystem
Primary_tools
- Mem0 - Memory layer for AI applications
- LangChain Memory - Memory utilities in LangChain
- Redis - In-memory data store for session memory
Patterns
Tiered Memory System
Different memory tiers for different purposes
When to use: Building any conversational AI
interface MemorySystem {
// Buffer: Current conversation (in context)
buffer: ConversationBuffer;
// Short-term: Recent interactions (session)
shortTerm: ShortTermMemory;
// Long-term: Persistent across sessions
longTerm: LongTermMemory;
// Entity: Facts about people, places, things
entity: EntityMemory;
}
class TieredMemory implements MemorySystem {
async addMessage(message: Message): Promise<void> {
// Always add to buffer
this.buffer.add(message);
// Extract entities
const entities = await extractEntities(message);
for (const entity of entities) {
await this.entity.upsert(entity);
}
// Check for memorable content
if (await isMemoryWorthy(message)) {
await this.shortTerm.add({
content: message.content,
timestamp: Date.now(),
importance: await scoreImportance(message)
});
}
}
async consolidate(): Promise<void> {
// Move important short-term to long-term
const memories = await this.shortTerm.getOld(24 * 60 * 60 * 1000);
for (const memory of memories) {
if (memory.importance > 0.7 || memory.referenced > 2) {
await this.longTerm.add(memory);
}
await this.shortTerm.remove(memory.id);
}
}
async buildContext(query: string): Promise<string> {
const parts: string[] = [];
// Relevant long-term memories
const longTermRelevant = await this.longTerm.search(query, 3);
if (longTermRelevant.length) {
parts.push('## Relevant Memories\n' +
longTermRelevant.map(m => `- ${m.content}`).join('\n'));
}
// Relevant entities
const entities = await this.entity.getRelevant(query);
if (entities.length) {
parts.push('## Known Entities\n' +
entities.map(e => `- ${e.name}: ${e.facts.join(', ')}`).join('\n'));
}
// Recent conversation
const recent = this.buffer.getRecent(10);
parts.push('## Recent Conversation\n' + formatMessages(recent));
return parts.join('\n\n');
}
}
Entity Memory
Store and update facts about entities
When to use: Need to remember details about people, places, things
interface Entity {
id: string;
name: string;
type: 'person' | 'place' | 'thing' | 'concept';
facts: Fact[];
lastMentioned: number;
mentionCount: number;
}
interface Fact {
content: string;
confidence: number;
source: string; // Which message this came from
timestamp: number;
}
class EntityMemory {
async extractAndStore(message: Message): Promise<void> {
// Use LLM to extract entities and facts
const extraction = await llm.complete(`
Extract entities and facts from this message.
Return JSON: { "entities": [
{ "name": "...", "type": "...", "facts": ["..."] }
]}
Message: "${message.content}"
`);
const { entities } = JSON.parse(extraction);
for (const entity of entities) {
await this.upsert(entity, message.id);
}
}
async upsert(entity: ExtractedEntity, sourceId: string): Promise<void> {
const existing = await this.store.get(entity.name.toLowerCase());
if (existing) {
// Merge facts, avoiding duplicates
…
Câu hỏi thường gặp
Khác nhau giữa bộ nhớ ngắn hạn và dài hạn là gì?
Bộ nhớ ngắn hạn giữ các cuộc trò chuyện gần đây, như những gì được nói trong vài phút qua. Bộ nhớ dài hạn lưu thông tin quan trọng cần nhớ lâu hơn, kể cả sau khi cuộc trò chuyện kết thúc.
AI có nhớ mọi thứ tôi nói không?
Không, nó tập trung lưu những gì liên quan nhất hoặc được đánh dấu là quan trọng. Nó có giới hạn và ưu tiên những gì thiết yếu cho cuộc trò chuyện.
“Entities” là gì?
Entities là người, nơi chốn, sự vật hoặc khái niệm mà AI có thể lưu thông tin cụ thể về chúng. Ví dụ, nếu bạn nhắc đến chú chó “Rex” của mình, AI có thể lưu thông tin đó.
Chi tiết
Mô tả gốc của tác giả
Persistent memory systems for LLM conversations including short-term, long-term, and entity-based memory
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4263
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.