EPISODE · Apr 24, 2026 · 4 MIN
@RLanceMartin:Claude Managed Agents 中的記憶 Claude Managed Agents(現已於 Claude Platform 上線)現在具備了…
from EasyVibeCoding Podcast · host Lance Martin
Claude Managed Agents 中的記憶 Claude Managed Agents(現已於 Claude Platform 上線)現在具備了記憶功能。這些記憶會以檔案形式儲存,並可在不同工作階段(session)之間存取,讓 Agent 能從經驗中學習。此外,這些記憶也能透過 API 匯出。 --- @DavidSHershey 與我分享了一個關於 Agent 記憶的故事:在他進行「Claude 玩寶可夢 (Claude Plays Pokémon)」的專案時,他賦予了 Claude 一個能讀寫記憶檔案到特定資料夾的工具。這些記憶檔案旨在協助 Claude 在遊戲中進行導航。 這在早期的模型中效果並不理想。Sonnet 3.5 將記憶視為一份逐字稿,記錄了非玩家角色 (NPC) 說了什麼,而不是記錄真正重要的資訊。在執行了 14,000 個步驟後,它產生了 31 個記憶檔案,但進度卻沒什麼進展(它卡在第二個城鎮)。以下是其中一個檔案的範例: `json caterpieweedleinfo: Caterpie and Weedle are both caterpillar Pokémon. Caterpie is a caterpillar Pokémon that does not have poison. Weedle is a caterpillar Pokémon that does have poison. This information is crucial for future encounters and battles. If our Pokémon get poisoned, we should seek healing at a Pokémon Center as soon as possible. ` 為了克服這些限制,許多論文提出了具備記憶管理工具的 harness。@tedsumers 的 CoALA 論文,以及 @sarahwooders 和 @charlespacker 的 memGPT 研究是我最喜歡的兩篇。這些研究運用了認知科學和作業系統的概念來建立 Agent 記憶模型。 但寶可夢的實驗顯示了一個有趣的結果:較新的模型學會了利用檔案系統來更有效地組織記憶。Opus 4.6 在相同的步驟數下,產生了 10 個組織在不同目錄下的檔案,獲得了三個道館徽章,並建立了一份從自身失敗經驗中提煉出的學習心得檔案: `json /gameplay/learnings.md: Bellsprout Sleep+Wrap combo: KO FAST with BITE before Sleep Powder lands. Don't let it set up! Gen 1 Bag Limit: 20 items max. Toss unneeded TMs before dungeons. Spin tile mazes: Different entry y-positions lead to DIFFERENT destinations. Try ALL entries and chain through multiple pockets. B1F y=16 wall CONFIRMED SOLID at ALL x=9-28 (step 14557) ` 這個範例凸顯了一個趨勢,我曾在此處寫過:給予 Claude 通用的工具來管理它自己的 context 與行動。隨著智慧程度的提升,Claude 可以學會使用這些通用工具來解決問題,例如記憶管理。 透過通用的檔案管理工具,我們觀察到 Claude 學會了什麼該儲存以及如何組織自己的記憶。@Letta_AI 也獨立證實了檔案系統的表現可以優於專門的記憶工具。 這個故事解釋了為什麼我們在 Claude Managed Agents(於 Claude Platform 提供)中選擇使用檔案系統來處理記憶。Claude 可以使用標準的檔案工具,隨心所欲地組織檔案。平台僅負責透過記憶儲存庫 (memory stores) 在不同工作階段間保存這些檔案;記憶儲存庫是 workspace 範圍內的文字文件集合,其生命週期超越了單一工作階段。 當你將一個記憶儲存庫掛載到工作階段時,它會作為一個目錄掛載到容器內的 /mnt/memory// 路徑下。系統會自動在 system prompt 中注入一則關於此掛載的簡短說明,讓 Claude 知道它的存在。 多個 Agent 可以存取同一個記憶儲存庫,平台會即時同步記憶:如果一個 Agent 進行了編輯,該編輯將會反映在所有掛載了該記憶儲存庫的其他 Agent 的檔案系統中。平台也會處理並發 (concurrency) 問題,確保一個 Agent 不會覆蓋掉另一個 Agent 所做的記憶更新。 檔案還有一個額外的好處——它們具備可解釋性且易於分享。在寶可夢的例子中,@DavidSHershey 可以直接下載並分享這些記憶資料夾。透過 Managed Agents,你也可以匯出記憶: `python client.beta.memorystores.memories.list(storeid, view="full") ` 這建立了一種思考 Managed Agents 中 context 的簡單方式:存在一個工作階段日誌 (session log) 和一個記憶儲存庫。正如 @mc_anthropic、@gcemaj 和我在此處所寫的,Claude 可以在執行任務的過程中獲取並轉換工作階段的 context。工作階段存在於 context window 之外,這帶來了 @a1zhang 和 @lateinteraction 在此處所概述的優點。如果 Claude 希望在不同工作階段間保存 context,它可以將檔案寫入記憶儲存庫。 若要開始使用,請參閱我們的文件或使用我們的 claude-api skill。此 skill 已內建於 Claude Code 中,並可透過執行 /claude-api 來觸發。接著,你就可以詢問關於 Claude Managed Agents 或其他 API 功能的問題。 原文:https://easyvibecoding.app/curated/921
Embed this episode
Ready to play
@RLanceMartin:Claude Managed Agents 中的記憶 Claude Managed Agents(現已於 Claude Platform 上線)現在具備了…
No transcript for this episode yet
Similar Episodes
No similar episodes found.
Similar Podcasts
No similar podcasts found.