这篇文章最精彩的是用 Zettelkasten(卡片盒笔记法) 这个故事包装了一个由提示驱动的 agentic memory system for LLM agents(这里有点绕,就是这个记忆系统本身就是智能体型的,然后这个记忆系统还是专门设计给智能体用的),公式很清晰简洁(主要是我这种小白也能看懂),提示词设计也很有意思,尤其是那个笔记链接的提示词,感觉很有启发性,值得好好学习一下。
摘要
While large language model (LLM) agents can effectively use external tools for complex real-world tasks, they require memory systems to leverage historical experiences. Current memory systems enable basic storage and retrieval but lack sophisticated memory organization, despite recent attempts to incorporate graph databases. Moreover, these systems’ fixed operations and structures limit their adaptability across diverse tasks. To address this limitation, this paper proposes a novel agentic memory system for LLM agents that can dynamically organize memories in an agentic way. Following the basic principles of the Zettelkasten method, we designed our memory system to create interconnected knowledge networks through dynamic indexing and linking. When a new memory is added, we generate a comprehensive note containing multiple structured attributes, including contextual descriptions, keywords, and tags. The system then analyzes historical memories to identify relevant connections, establishing links where meaningful similarities exist. Additionally, this process enables memory evolution – as new memories are integrated, they can trigger updates to the contextual representations and attributes of existing historical memories, allowing the memory network to continuously refine its understanding. Our approach combines the structured organization principles of Zettelkasten with the flexibility of agent-driven decision making, allowing for more adaptive and context-aware memory management. Empirical experiments on six foundation models show superior improvement against existing SOTA baselines.
Jiho Kim, Woosog Chay, Hyeonji Hwang, Daeun Kyung, Hyunseung Chung, Eunbyeol Cho, Yohan Jo, and Edward Choi. Dialsim: A real-time simulator for evaluating long-term multi-party dialogue understanding of conversational agents. arXiv preprint arXiv:2406.13144, 2024.
DialSim 是一个用于评估长期对话记忆能力的问答数据集,来源于长期多角色对话场景。该数据集基于热门电视剧(如 Friends、The Big Bang Theory 和 The Office)构建,覆盖 约五年的剧情内容。
Generate a structured analysis of the following content by: 1. Identifying the most salient keywords (focus on nouns, verbs, and key concepts) 2. Extracting core themes and contextual elements 3. Creating relevant categorical tags
Format the response as a JSON object:
{ "keywords": [ // several specific, distinct keywords that capture key concepts and terminology // Order from most to least important // Don’t include keywords that are the name of the speaker or time // At least three keywords, but don’t be too redundant. ], "context": // one sentence summarizing: // - Main topic/domain // - Key arguments/points // - Intended audience/purpose , "tags": [ // several broad categories/themes for classification // Include domain, format, and type tags // At least three tags, but don’t be too redundant. ] }
You are an AI memory evolution agent responsible for managing and evolving a knowledge base. Analyze the new memory note according to keywords and context, also with its several nearest neighbor memories.
The new memory: - context: {context} - content: {content} - keywords: {keywords}
The nearest neighbor memories: - {nearest_neighbors_memories}
Based on this information, determine: Should this memory be evolved? Consider its relationships with other memories.
中文翻译:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
你是一个 AI 记忆演化智能体,负责管理并持续演化一个知识库。 请结合关键词、上下文以及若干条最近邻记忆,对新记忆笔记进行分析。
You are an AI memory evolution agent responsible for managing and evolving a knowledge base. Analyze the new memory note according to keywords and context, along with several nearest neighbor memories. Make decisions about its evolution.
The new memory: - context: {context} - content: {content} - keywords: {keywords}
The nearest neighbor memories: - {nearest_neighbors_memories}
Based on this information, determine: 1. What specific actions should be taken (strengthen, update_neighbor)? 1.1 If choosing to strengthen, which memory should it connect to? Can you provide updated tags for this memory? 1.2 If choosing to update_neighbor, you may update the context and tags of these memories based on improved understanding. Tags should reflect the content characteristics of these memories for future retrieval and categorization.
All information should be returned in list order: [[new_memory], [neighbor_memory_1], ... [neighbor_memory_n]]
These actions can be combined.
Return your decision in JSON format with the following structure: { "should_evolve": true/false, "actions": ["strengthen", "merge", "prune"], "suggested_connections": ["neighbor_memory_ids"], "tags_to_update": ["tag_1", ..., "tag_n"], "new_context_neighborhood": ["new context", ..., "new context"], "new_tags_neighborhood": [["tag_1", ..., "tag_n"], ..., ["tag_1", ..., "tag_n"]] }
Question 686: Which hobby did Dave pick up in October 2023? Prediction: photography Reference: photography
talk start time: 10:54 am on 17 November, 2023 memory content: Speaker Dave says: Hey Calvin, long time no talk! A lot has happened. I've taken up photography and it's been great, been taking pics of the scenery around here which is really cool. memory context: The main topic is the speaker's new hobby of photography, highlighting their enjoyment of capturing local scenery, aimed at engaging a friend in conversation about personal experiences. memory keywords: ['photography', 'scenery', 'conversation', 'experience', 'hobby'] memory tags: ['hobby', 'photography', 'personal development', 'conversation', 'leisure']
talk start time: 6:38 pm on 21 July, 2023 memory content: Speaker Calvin says: Thanks, Dave! It feels great having my own space to work in. I've been experimenting with different genres lately, pushing myself out of my comfort zone. Adding electronic elements to my songs gives them a fresh vibe. It's been an exciting process of self-discovery and growth! memory context: The speaker discusses their creative process in music, highlighting experimentation with genres and the incorporation of electronic elements for personal growth and artistic evolution. memory keywords: ['space', 'experimentation', 'genres', 'electronic', 'self-discovery', 'growth'] memory tags: ['music', 'creativity', 'self-improvement', 'artistic expression']