[{"data":1,"prerenderedAt":458},["ShallowReactive",2],{"docs-page-en-/usecase/blog/agent_memory_architecture":3,"surround-en-/usecase/blog/agent_memory_architecture":444},{"id":4,"title":5,"avatar":6,"banner":6,"body":7,"category":6,"desc":6,"description":13,"extension":438,"lead":6,"links":6,"meta":439,"navigation":6,"path":440,"seo":441,"stem":442,"__hash__":443},"docs/en/usecase/blog/agent_memory_architecture.md","Agent Memory Architecture: Building Cross-Session Memory with MemOS",null,{"type":8,"value":9,"toc":426},"minimark",[10,14,17,20,23,28,31,98,101,110,112,116,124,178,181,188,190,194,215,226,229,235,243,245,249,252,264,282,285,297,299,303,320,323,325,329,343,346,348,352,363,376,384,386,390,393,411,414],[11,12,13],"p",{},"A user has set email as the default for their weekly reports. A week later, they switch to Slack. Then they ask the assistant, “Email this report; I need to forward it to a client.”",[11,15,16],{},"The assistant should email that report and return to Slack for the next one. To do that across conversations, it needs to distinguish the user’s standing preference from a request for a single task.",[11,18,19],{},"MemOS provides a memory layer for the application to store that preference, retrieve it in a new conversation, and update it when the user changes their mind.",[21,22],"br",{},[24,25,27],"h2",{"id":26},"decide-when-each-instruction-applies","Decide when each instruction applies",[11,29,30],{},"The reporting assistant has to distinguish a lasting preference from an instruction for the current task:",[32,33,34,50],"table",{},[35,36,37],"thead",{},[38,39,40,44,47],"tr",{},[41,42,43],"th",{},"User instruction",[41,45,46],{},"Scope",[41,48,49],{},"Expected behavior",[51,52,53,65,76,87],"tbody",{},[38,54,55,59,62],{},[56,57,58],"td",{},"“Send my weekly reports by email by default.”",[56,60,61],{},"Ongoing preference",[56,63,64],{},"Use email until the user changes the default.",[38,66,67,70,73],{},[56,68,69],{},"“Use Slack for future weekly reports.”",[56,71,72],{},"Updated preference",[56,74,75],{},"Use Slack for later reports.",[38,77,78,81,84],{},[56,79,80],{},"“Email this report.”",[56,82,83],{},"One report",[56,85,86],{},"Use email for this report and keep Slack as the default.",[38,88,89,92,95],{},[56,90,91],{},"“Forget my report-delivery preference.”",[56,93,94],{},"Saved preference",[56,96,97],{},"Remove the preference and ask where to send a future report if no other instruction applies.",[11,99,100],{},"A question like “Would Slack work?” opens a discussion. “Use Slack from now on” establishes a preference. The email request can remain in the task history while the application applies it only to that report.",[11,102,103,104,109],{},"MemOS Cloud can extract ",[105,106,108],"a",{"href":107},"/memos_cloud/introduction/memory_types","preference memories"," from user statements and interaction history. Your application can combine a retrieved preference with the current request and apply its own rules for defaults and exceptions.",[21,111],{},[24,113,115],{"id":114},"see-how-the-memos-components-work-together","See how the MemOS components work together",[11,117,118,119,123],{},"The ",[105,120,122],{"href":121},"/open_source/modules/mos/overview","MemOS v2.0 open-source architecture"," separates memory processing into components coordinated by handlers:",[32,125,126,136],{},[35,127,128],{},[38,129,130,133],{},[41,131,132],{},"Component",[41,134,135],{},"Role in the open-source architecture",[51,137,138,146,154,162,170],{},[38,139,140,143],{},[56,141,142],{},"MemReader",[56,144,145],{},"Processes inputs into memory items that can be stored.",[38,147,148,151],{},[56,149,150],{},"MemCube",[56,152,153],{},"Holds memory modules for users and application scenarios.",[38,155,156,159],{},[56,157,158],{},"MemScheduler",[56,160,161],{},"Coordinates background processing, including storage and indexing.",[38,163,164,167],{},[56,165,166],{},"MemChat",[56,168,169],{},"Coordinates memory retrieval, response generation, and storage of new memories.",[38,171,172,175],{},[56,173,174],{},"MemFeedback",[56,176,177],{},"Processes natural-language corrections, additions, and replacements.",[11,179,180],{},"If a saved preference is wrong, you can inspect how the input was processed. If the preference is correct but the assistant misses it, check retrieval and the context passed to the model.",[11,182,183,187],{},[105,184,186],{"href":185},"/memos_cloud/getting_started/overview","MemOS Cloud"," provides managed APIs for adding, retrieving, and updating memories. The components above belong to the open-source framework; the reporting workflow below uses Cloud APIs.",[21,189],{},[24,191,193],{"id":192},"keep-the-same-user-across-conversations","Keep the same user across conversations",[11,195,196,197,201,202,206,207,210,211,214],{},"Send the user’s messages to the ",[105,198,200],{"href":199},"/memos_cloud/mem_operations/add_message","Add Message API",". A typical request includes a ",[203,204,205],"code",{},"user_id",", a ",[203,208,209],{},"conversation_id",", and a ",[203,212,213],{},"messages"," array containing each message’s role and content. MemOS extracts memories, including facts and preferences, and checks new information for duplication or conflicts with existing memories.",[11,216,217,218,222,223,225],{},"When the user starts another conversation, call the ",[105,219,221],{"href":220},"/memos_cloud/mem_operations/search_memory","Search Memory API"," with the same ",[203,224,205],{}," and a query about the task. For a weekly report, the application can search for the user’s current delivery preference and pass the relevant result to the model alongside the current request.",[11,227,228],{},"Search combines semantic and keyword retrieval with ranking and filters. Fact and preference memories are included by default, so the assistant can retrieve a delivery preference without reconstructing it from earlier conversations.",[11,230,231,232,234],{},"Keep the user ID stable across conversations, with a separate conversation ID for each interaction. When you include ",[203,233,209],{}," in a search, MemOS gives memories from that conversation greater weight while still allowing the user’s historical memories to be retrieved.",[11,236,237,238,242],{},"For applications serving multiple users, ",[105,239,241],{"href":240},"/memos_cloud/introduction/isolation_filters","user and agent memory boundaries"," help determine whose information is retrieved. Your backend should select the user ID from the authenticated account and enforce the permissions appropriate to your application. The application’s email or Slack integration sends the report.",[21,244],{},[24,246,248],{"id":247},"update-a-preference-when-it-changes","Update a preference when it changes",[11,250,251],{},"When the user says, “Use Slack for future weekly reports,” MemOS can process the new information as messages are added and update conflicting memories. MemOS Cloud also supports direct edits and natural-language corrections.",[11,253,254,255,259,260,263],{},"If your application knows which record needs editing, use ",[105,256,258],{"href":257},"/api_docs/core/update_memory","Update Memory"," with its ",[203,261,262],{},"memory_id",". You can change the content or title of an existing memory, including a preference. This works well when a user edits a saved preference in your application.",[11,265,266,267,271,272,274,275,277,278,281],{},"For a correction made in conversation, submit ",[105,268,270],{"href":269},"/memos_cloud/mem_operations/add_feedback","natural-language feedback"," with ",[203,273,205],{},", ",[203,276,209],{},", and ",[203,279,280],{},"feedback_content",". MemOS uses the feedback and conversation context to locate relevant memories and apply the correction, so the user does not need to find a memory ID.",[11,283,284],{},"Keep the one-report email request in the current task context, and make sure it is not saved as a new default. That allows the application to honor the immediate request while using Slack for a later report.",[11,286,287,288,292,293,296],{},"MemOS Cloud’s ",[105,289,291],{"href":290},"/memos_cloud/introduction/time_awareness","time awareness"," keeps historical versions of information that changes and uses time clues during retrieval. “Where should this week’s report go?” calls for the current preference; “What was my previous default?” calls for an earlier one. When importing historical conversations, you can provide ",[203,294,295],{},"chat_time"," to preserve the original timing.",[21,298],{},[24,300,302],{"id":301},"allow-for-background-processing","Allow for background processing",[11,304,305,306,310,311,314,315,319],{},"MemOS Cloud processes added messages ",[105,307,309],{"href":308},"/memos_cloud/features/async_mode","asynchronously by default",". An initial processing stage makes recent messages available for retrieval, while further refinement continues in the background. You can use the returned ",[203,312,313],{},"task_id"," with the ",[105,316,318],{"href":317},"/api_docs/message/get_status","task-status API"," to follow processing through completion.",[11,321,322],{},"If a user changes a preference and starts another task right away, keep the latest instruction in the current context while memory processing continues. For workflows that need to wait for message processing to finish, you can also use synchronous mode when adding messages.",[21,324],{},[24,326,328],{"id":327},"decide-what-to-delete","Decide what to delete",[11,330,331,332,271,336,339,340,342],{},"Use ",[105,333,335],{"href":334},"/memos_cloud/mem_operations/delete_memory","Delete Memory",[203,337,338],{},"memory_ids"," to remove selected memories, or with ",[203,341,205],{}," to clear a user’s memories within the current project. To forget only the report-delivery preference, identify and delete the relevant memories. Clearing all memories for the user is a separate operation.",[11,344,345],{},"After deletion, search again to check the result. If there is no other delivery instruction, the assistant can ask where the next report should go. If your application also retains summaries or source conversations, handle those records according to the request’s scope so a later import does not recreate the deleted preference.",[21,347],{},[24,349,351],{"id":350},"choose-the-right-form-of-memory","Choose the right form of memory",[11,353,354,355,362],{},"The reporting assistant uses editable information stored outside the model. Our ",[105,356,361],{"href":357,"rel":358,"target":360},"https://arxiv.org/abs/2507.03724",[359],"nofollow","_blank","research framework"," describes three forms of memory:",[364,365,366,370,373],"ul",{},[367,368,369],"li",{},"Plaintext memory stores information outside the model, where it can be retrieved and updated.",[367,371,372],{},"Activation memory holds runtime states, such as KV caches.",[367,374,375],{},"Parametric memory holds knowledge in model weights.",[11,377,378,379,383],{},"MemCube brings memory content and metadata together so memory can be organized and managed. The open-source ",[105,380,382],{"href":381},"/open_source/modules/memories/kv_cache_memory","KV-cache module"," supports reuse of cached context during inference. For a preference that users may change or delete, external memory is a practical starting point: your application can update the saved information without retraining the model.",[21,385],{},[24,387,389],{"id":388},"test-the-whole-flow","Test the whole flow",[11,391,392],{},"You can try the reporting scenario across several conversations with the same user:",[394,395,396,399,402,405,408],"ol",{},[367,397,398],{},"Save email as the default, then retrieve it in a new conversation.",[367,400,401],{},"Change the default to Slack and check the retrieved preference and assistant response.",[367,403,404],{},"Request email for one report, then check that a later report still uses Slack.",[367,406,407],{},"Search as a different user and confirm the first user’s private preference is not returned.",[367,409,410],{},"Delete the preference, start a new conversation, and check that it is no longer retrieved.",[11,412,413],{},"When a result needs investigation, compare the original instruction with the processing status, retrieved memory, and context sent to the model. That helps you see where the preference was captured, selected, or applied differently than intended.",[11,415,416,417,421,422,425],{},"Use the ",[105,418,420],{"href":419},"/memos_cloud/getting_started/quick_start","MemOS Cloud quickstart"," to add memory to your application, or explore the ",[105,423,424],{"href":121},"open-source architecture"," for a self-hosted deployment.",{"title":427,"searchDepth":428,"depth":428,"links":429},"",2,[430,431,432,433,434,435,436,437],{"id":26,"depth":428,"text":27},{"id":114,"depth":428,"text":115},{"id":192,"depth":428,"text":193},{"id":247,"depth":428,"text":248},{"id":301,"depth":428,"text":302},{"id":327,"depth":428,"text":328},{"id":350,"depth":428,"text":351},{"id":388,"depth":428,"text":389},"md",{},"/en/usecase/blog/agent_memory_architecture",{"title":5,"description":13},"en/usecase/blog/agent_memory_architecture","8BK87xtSEzQhN2aHIRCk2Pkpqd71KjEA4sx13zF8n48",[445,453],{"title":446,"path":447,"stem":448,"icon":449,"framework":6,"module":6,"class":450,"target":-1,"active":451,"defaultOpen":451,"children":-1,"description":452},"Edge–Cloud Collaboration: Long-Term Memory for Smart Devices","/usecase/edge_cloud_terminal_memory","usecase/edge_cloud_terminal_memory","i-ri-device-line",[],false,"How MemOS forms, maintains and retrieves memory for earbuds, watches, home speakers, robots, phones and computers, with four deployment options and API integration examples.",{"title":454,"path":455,"stem":456,"framework":6,"module":6,"class":457,"target":-1,"active":451,"defaultOpen":451,"children":-1,"description":-1},"Why AI Agents Need to Know When a Memory Is Out of Date","/usecase/blog/outdated_agent_memory","usecase/blog/outdated_agent_memory",[],1793187172868]