TL;DR

Trong bản Managed Agents public beta tung ngày 08/04/2026, Anthropic ra mắt memory stores — một kiểu resource mới, scope ở mức workspace, lưu dưới dạng text filemount trực tiếp vào /mnt/memory/ bên trong container của session. Agent đọc/ghi bằng đúng bộ file tool sẵn có, mọi thay đổi sinh ra memory version bất biến, và một store có thể được gắn vào nhiều session khác nhau. Đây là bước nhảy từ "context window dài hơn" sang "agent có bộ nhớ thật, có audit trail".

What's new

Nguồn tweet gốc của @ClaudeDevs tóm tắt thẳng:

Memory is scoped to a workspace and stored as text files that persist across sessions. When a store is attached to a session, it mounts inside the container, and Claude can read and write to it.

Dịch nhanh sang ngôn ngữ engineer: memory không còn là mẹo prompt hay một vector DB bên cạnh — nó là một thư mục thật trong sandbox. Các thao tác view, create, str_replace, insert, delete, rename đều là file I/O. Platform tự chèn thêm mô tả về mount (path, mode, description, instructions) vào system prompt nên agent biết đường tìm.

Why it matters

Trước đây có hai lựa chọn: (1) nhét tất cả vào context window và cầu trời đừng tràn, hoặc (2) dựng RAG/vector store riêng và tự lo path traversal, versioning, multi-tenant. Memory stores gộp được hai hướng đó thành một primitive đơn giản hơn:

  • Filesystem semantics — Claude vốn đã rất giỏi làm việc với file; không phải học API truy xuất mới.
  • Persistence thật — session kết thúc, memory vẫn còn. Session kế tiếp mount lại đúng thư mục đó.
  • Audit trail — mỗi ghi tạo ra một memver_... bất biến, có endpoint redact cho PII/secret lộ.
  • Multi-tenant sẵn — một store cho mỗi user/team/project, chia sẻ cùng agent config.

Technical facts

PropertyValue
Mount path trong container/mnt/memory/<store>
Access modesread_write (default) hoặc read_only
Số store / sessiontối đa 8
Kích thước 1 memory100 KB (~25K tokens)
Memory / store2,000
Dung lượng / store100 MB
Store / org1,000
Version / store250,000
Giữ lịch sử version30 ngày (các version mới nhất luôn giữ)
Optimistic concurrencyprecondition content_sha256
Beta headermanaged-agents-2026-04-01
Zero Data RetentionHỗ trợ

Tạo store và gắn vào session chỉ vài dòng Python:

store = client.beta.memory_stores.create(
    name="User Preferences",
    description="Per-user preferences and project context.",
)

session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    resources=[{
        "type": "memory_store",
        "memory_store_id": store.id,
        "access": "read_write",
        "instructions": "Check before starting any task.",
    }],
)

Lưu ý store chỉ attach được khi tạo session — không thể hot-swap giữa chừng.

Comparison — client-side memory tool vs Managed memory stores

Tiêu chímemory_20250818 toolMemory stores
Nơi lưu dataHạ tầng của bạnAnthropic-managed
MountẢo, qua tool callThư mục thật trong container
VersioningTự làmBuilt-in + redact
Chia sẻ giữa sessionKhông nativeAttach vào nhiều session
Path traversal safetyBạn phải validatePlatform enforce
Audit / complianceTự xâyAPI sẵn

So với mô hình RAG vector thuần: memory stores là file system, không phải retrieval-embedded chunks. Agent không query "tìm đoạn gần nhất với câu hỏi này"; nó ls /mnt/memory/preferences rồi đọc thẳng file. Đơn giản hơn, deterministic hơn, dễ debug hơn.

Use cases

  • Per-user preferences: style, ngôn ngữ, format output. Mount read-write vào từng session của user đó.
  • Shared reference material: style guide, GAAP formatting, domain knowledge — mount read_only cho nhiều agent session khác nhau.
  • Multi-session software dev: progress log + feature checklist — docs chính thức đề xuất pattern "initializer session tạo artifact, các session sau mở ra đọc, cuối phiên update log".
  • Customer support agents: nhớ ticket cũ, policy, giải pháp đã áp dụng cho khách hàng đó.
  • Long-running research: tích luỹ note xuyên nhiều run mà không nổ context window.

Limitations & caveats

  • Prompt injection = memory poisoning. Docs cảnh báo rõ: nếu agent xử lý input không tin cậy (prompt user, fetch web, tool output bên thứ ba) thì injection có thể ghi bậy vào store read-write, session sau đọc lại như "ký ức thật". Fix: dùng read_only cho mọi thứ không cần ghi.
  • Không hot-swap store trên session đang chạy.
  • Beta limits: 100 KB/memory buộc bạn chia nhỏ — nhiều file nhỏ tập trung, không phải vài file to.
  • Version retention 30 ngày — nếu compliance cần lâu hơn, phải tự export qua API.
  • Toàn bộ tính năng vẫn gate sau header beta managed-agents-2026-04-01.

What's next

Cặp primitive tự nhiên đi kèm memory stores là context editing + compaction: compaction tóm tắt context server-side khi gần full, memory giữ lại những gì quan trọng xuyên qua ranh giới tóm tắt đó. Kết hợp cả ba, bạn có một agent chạy hàng ngày/hàng tuần mà không bị "amnesia" mỗi lần session reset.

Với solo dev và indie hacker, đây là cái nên thử sớm: bỏ được một phần lớn hạ tầng tự-xây (vector DB, auth, versioning) mà vẫn có agent biết "tôi hôm qua vừa làm gì". Nguồn: Claude API Docs — Using agent memory, Memory tool reference, Help Net Security.