<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MemTensor</title>
    <description>The latest articles on DEV Community by MemTensor (@memtensor).</description>
    <link>https://dev.to/memtensor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4115409%2Ff20be9d4-3cdb-49f4-887e-b4ef1dd32d69.png</url>
      <title>DEV Community: MemTensor</title>
      <link>https://dev.to/memtensor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/memtensor"/>
    <language>en</language>
    <item>
      <title>What to Log and Measure in a Production Agent Memory Service</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Wed, 18 Nov 2026 08:43:51 +0000</pubDate>
      <link>https://dev.to/memos/what-to-log-and-measure-in-a-production-agent-memory-service-7im</link>
      <guid>https://dev.to/memos/what-to-log-and-measure-in-a-production-agent-memory-service-7im</guid>
      <description>&lt;p&gt;Start with a simple question: did the information the agent needed make it from memory into the model’s request?&lt;/p&gt;

&lt;p&gt;A retrieval dashboard can look healthy while the application drops a useful record before the model call. Even when the record reaches the model, the task can still fail. To find out where to make a change, track the write, retrieval, context assembly, and final action separately.&lt;/p&gt;

&lt;p&gt;Anthropic’s November 6 agent memory study offers one example. On a CL-Bench database task, Sonnet 4.6 earned a mean reward of 0.364 with memory and 0.641 with memory and refined instructions. Those instructions asked the model to read its memory before answering and test its explanations.&lt;/p&gt;

&lt;p&gt;The result is specific to that task, but it illustrates why retrieval alone is not enough to evaluate an application. Teams also need to check what reaches the model and whether the resulting action succeeds.&lt;/p&gt;

&lt;h1&gt;
  
  
  Put these measures on the dashboard
&lt;/h1&gt;

&lt;p&gt;Use live request data for reliability and latency. Use labeled replays or reviewed samples for measures that depend on knowing which record or action was correct. Show the sample count beside each rate.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Measure&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Definition and denominator&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Where to collect it&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Write readiness&lt;/td&gt;
&lt;td&gt;Of accepted writes expected to create or update a known record and whose deadline has passed, the share whose expected result was visible by that deadline. Keep failed and overdue writes in the total.&lt;/td&gt;
&lt;td&gt;Write acknowledgment, task status where available, and a scoped read-back probe. Report failed and overdue jobs separately.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lookup failures and latency&lt;/td&gt;
&lt;td&gt;Failed or timed-out lookups divided by attempted lookups. Report p95 latency over successful lookups, including empty results, and show the timeout count next to it.&lt;/td&gt;
&lt;td&gt;The application's retrieval call, from start to response or timeout.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hit rate at k&lt;/td&gt;
&lt;td&gt;Labeled lookups with the expected record in the top k divided by labeled lookups with a known target. Keep k fixed across comparisons.&lt;/td&gt;
&lt;td&gt;Retrieval response, before context assembly.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context delivery rate&lt;/td&gt;
&lt;td&gt;Of labeled turns that retrieved the expected record, the share that sent the record or its relevant content to the model.&lt;/td&gt;
&lt;td&gt;Compare retrieval results with the application’s final context assembly. Track which record IDs contributed to each included block.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stale or out-of-scope context&lt;/td&gt;
&lt;td&gt;For each category, divide inspected requests containing a violating record by inspected requests containing any memory.&lt;/td&gt;
&lt;td&gt;The outgoing model request after scope and freshness checks. Count blocks separately.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Task success&lt;/td&gt;
&lt;td&gt;Runs meeting the workflow's outcome criteria divided by scored runs. In a delivery workflow, check the destination actually submitted.&lt;/td&gt;
&lt;td&gt;Tool result or business event, joined to the originating turn.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory processing tokens&lt;/td&gt;
&lt;td&gt;For sampled turns with complete usage data, report the tokens or other billed units used by memory-related processing. Keep extraction, embedding, and ranking separate where their usage is available.&lt;/td&gt;
&lt;td&gt;Provider usage and billing records for memory-related calls, including linked background work when reported. Show coverage and missing usage.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory added to the prompt&lt;/td&gt;
&lt;td&gt;Estimated tokens in included memory blocks divided by sampled model requests that contain memory.&lt;/td&gt;
&lt;td&gt;Final prompt assembly, using the model's tokenizer where available.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For write readiness, use an authorized probe with a known target and a fixed query. Record the probe interval alongside the observed time.&lt;/p&gt;

&lt;p&gt;If the expected record does not appear, check both the write status and the search conditions. A search can miss a record because of its query, filters, or result limit. Count empty responses separately from lookup errors, since some turns need no memory.&lt;/p&gt;

&lt;p&gt;For stale context, check the record against the current version or validity window. For scope, alert on any confirmed violation and report how many inputs were inspected. Review task success by case type, including routine recall, a corrected preference, and a case where the agent should ask for clarification.&lt;/p&gt;

&lt;h1&gt;
  
  
  Trace a turn from search to action
&lt;/h1&gt;

&lt;p&gt;Give each user turn a trace ID. Record the write job ID when one exists, the retrieval outcome and duration, the record IDs returned and included, and the final action result. Link background jobs back to their originating turn. Keep user and memory IDs in restricted traces, and leave memory text out of routine logs. Use dimensions such as workflow, model version, and result status for aggregate metrics. The estimated prompt footprint is part of the main request. Keep it separate from provider-reported usage for memory-only calls.&lt;/p&gt;

&lt;p&gt;OpenTelemetry’s GenAI conventions can help structure model and retrieval telemetry. The application still needs to define how it labels freshness, authorization, and task success for its own workflow.&lt;/p&gt;

&lt;p&gt;With MemOS Cloud, keep the task ID returned for an asynchronous write and use &lt;a href="https://memos-docs.openmem.net/api_docs/message/get_status/" rel="noopener noreferrer"&gt;Task Status&lt;/a&gt; to follow processing. Once the task completes, its response can summarize memory changes and the affected IDs.&lt;/p&gt;

&lt;p&gt;Then use a scoped &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/search_memory/" rel="noopener noreferrer"&gt;Search Memory&lt;/a&gt; request to check what the application can retrieve. During context assembly, record which returned memories contributed to the model request. This helps distinguish a record that was not found from one that was found but never reached the model.&lt;/p&gt;

&lt;h1&gt;
  
  
  Read the rates together
&lt;/h1&gt;

&lt;p&gt;In an illustrative replay of 120 turns, search found the expected record in 96 turns, and 82 of those turns included it in the model request. The hit rate is 80%. Delivery among hits is 85.4%, and delivery across all 120 turns is 68.3%.&lt;/p&gt;

&lt;p&gt;The 14 turns where the record was retrieved but not delivered point the team toward context assembly. Inspect those before changing the search index.&lt;/p&gt;

&lt;p&gt;If the expected record arrived and the action still failed, hold that record and the tool responses fixed while testing revised instructions. If the agent proposed the right action and the system executed the wrong one, follow the tool call and its receipt. Use matched replays with and without memory when you want to measure its contribution to task success.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>memory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to Choose a Production AI Memory System</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Wed, 18 Nov 2026 08:13:05 +0000</pubDate>
      <link>https://dev.to/memos/how-to-choose-a-production-ai-memory-system-o4p</link>
      <guid>https://dev.to/memos/how-to-choose-a-production-ai-memory-system-o4p</guid>
      <description>&lt;p&gt;Shortlist MemOS Cloud when an agent needs to bring user history and shared knowledge into the same task. Consider Mem0 Platform for a hosted user-memory API, Zep for relationships that change over time, and LangGraph with PostgresStore when your team wants to own the memory schema and write rules.&lt;/p&gt;

&lt;p&gt;Start with the information your agent needs, then decide which parts of memory management you want a service to handle and which parts your team needs to control.&lt;/p&gt;

&lt;p&gt;On November 10, n8n Labs released Nod as a desktop research preview. Its memory can stay on the machine running the app, while the user chooses the model provider.&lt;/p&gt;

&lt;p&gt;For a production memory system, the same distinction is worth checking. Where are records stored? Where are they processed and retrieved? And which information is sent to a model?&lt;/p&gt;

&lt;h1&gt;
  
  
  Compare four candidates on the same questions
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Candidate&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;What it stores and how it changes&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;How the application retrieves and scopes it&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Deployment and engineering trade-off&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MemOS Cloud&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A managed service that derives and maintains memory from inputs, including facts, preferences, and tool memories.&lt;/td&gt;
&lt;td&gt;Search user memory, select memory types, and apply filters. An application can also include authorized project knowledge bases in the same search.&lt;/td&gt;
&lt;td&gt;Start here when the agent needs to combine customer history with shared information. For example, a support assistant can retrieve a customer’s communication preference alongside a team’s escalation policy. The application still determines the user’s identity and which sources it is allowed to query. &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/search_memory/" rel="noopener noreferrer"&gt;Search Memory&lt;/a&gt; · &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/knowledge_base/" rel="noopener noreferrer"&gt;Knowledge Base&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Mem0 Platform&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A hosted API that extracts memory entries from messages and supports updates and deletion.&lt;/td&gt;
&lt;td&gt;Add records with a user ID and search with a user filter. Your app decides which records reach the model.&lt;/td&gt;
&lt;td&gt;Start here if the first release needs to remember individual preferences across sessions. Test what extraction keeps, how corrections appear on the next lookup, and how your app scopes shared material. &lt;a href="https://docs.mem0.ai/platform/quickstart" rel="noopener noreferrer"&gt;Mem0 Platform quickstart&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Zep v4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A managed context graph that derives entities and facts from source episodes. Facts can carry validity dates and links to the episodes that produced them.&lt;/td&gt;
&lt;td&gt;Search a user or shared graph, or request an assembled context block. The app selects an authorized graph.&lt;/td&gt;
&lt;td&gt;Start here when changing relationships or historical answers matter. Test how your business events map to graph facts and whether the derived dates match the cases you need to answer. &lt;a href="https://help.getzep.com/v4/facts" rel="noopener noreferrer"&gt;Zep facts&lt;/a&gt; · &lt;a href="https://help.getzep.com/v4/searching-the-graph" rel="noopener noreferrer"&gt;Zep graph search&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LangGraph with PostgresStore&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cross-thread key-value records in PostgreSQL. Your application decides what to write, replace, or delete.&lt;/td&gt;
&lt;td&gt;Read by key or search within a namespace. Vector search is optional and requires pgvector and an embedding configuration.&lt;/td&gt;
&lt;td&gt;Start here if you already run LangGraph and need to control the data model and storage environment. You own the extraction code, access rules, migrations, and database operations. &lt;a href="https://docs.langchain.com/oss/python/langgraph/stores" rel="noopener noreferrer"&gt;LangGraph stores&lt;/a&gt; · &lt;a href="https://reference.langchain.com/python/langgraph.store.postgres/base/PostgresStore" rel="noopener noreferrer"&gt;PostgresStore reference&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Use the workload to cut the shortlist
&lt;/h1&gt;

&lt;p&gt;Pick the first case that would fail without memory. A support assistant may need to apply a customer’s preferred channel and an approved escalation policy in the same reply.&lt;/p&gt;

&lt;p&gt;With MemOS Cloud, a team can test that workflow by retrieving user memory alongside a specified knowledge base. If the customer later corrects a preference, the application can &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;update a known memory&lt;/a&gt; or submit &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; for the system to process.&lt;/p&gt;

&lt;p&gt;For an account handoff, ask who was responsible before and after the effective date. Use that case to decide what information your application needs to preserve and how it should be retrieved.&lt;/p&gt;

&lt;p&gt;For any hosted edition, confirm the data region, retention terms, and export options for the plan you would actually use. Use those answers to narrow the trial. If a policy requires data to stay in an approved environment, trace the embedding and model calls as well as the database. For a hosted service, ask the vendor to confirm those paths for your plan. For the store you operate, check the providers you configure.&lt;/p&gt;

&lt;h1&gt;
  
  
  Run the same trial against the finalists
&lt;/h1&gt;

&lt;p&gt;Use one synthetic customer workflow. Save email as the customer’s usual contact preference, then add a confirmed instruction to use the support portal for one specific case.&lt;/p&gt;

&lt;p&gt;In a fresh session, check that the agent uses the portal for that case and still uses email for an unrelated case. Then run the same questions from a second account with a different preference. It should retrieve its own information without exposing the first account’s record.&lt;/p&gt;

&lt;p&gt;Delete a separate record and check the target through the available record or deletion interfaces. Then run fresh searches and inspect application-managed caches to see whether the deleted content can still reach the agent.&lt;/p&gt;

&lt;p&gt;Keep the agent model, maximum memory context budget, and scoring rules fixed across candidates.&lt;/p&gt;

&lt;p&gt;Measure time from write acknowledgment to usable recall, retrieval latency, and the share of scored cases with a correct action. Record the engineering hours needed to set up scoping and the time it takes to trace a wrong answer to a source or stored record.&lt;/p&gt;

&lt;p&gt;For teams evaluating MemOS, the trial can also inform the deployment choice: &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/cloud_and_opensource/" rel="noopener noreferrer"&gt;MemOS Cloud and the open-source framework&lt;/a&gt; offer different ways to integrate and operate memory.&lt;/p&gt;

&lt;p&gt;Resolve isolation or deletion failures before comparing speed. Among the remaining candidates, choose the one that handles the required cases with an operating burden your team can support.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>memory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to Measure the Cost of a Correct Memory-Assisted Task</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:22:49 +0000</pubDate>
      <link>https://dev.to/memos/how-to-measure-the-cost-of-a-correct-memory-assisted-task-2649</link>
      <guid>https://dev.to/memos/how-to-measure-the-cost-of-a-correct-memory-assisted-task-2649</guid>
      <description>&lt;p&gt;A useful memory cost report should answer a product question: can the agent complete the same work, to the required standard, at a lower total cost?&lt;/p&gt;

&lt;p&gt;Start with a task customers repeat. A support assistant might need to find the current agreement and recommend the right replacement. It has to use the correct policy and the right customer’s information each time.&lt;/p&gt;

&lt;p&gt;A shorter prompt can help, but it is only part of the calculation. When evaluating MemOS, include the work needed to create, retrieve, and update memory alongside the cost of producing each answer.&lt;/p&gt;

&lt;h1&gt;
  
  
  Find the reuse point before comparing request prices
&lt;/h1&gt;

&lt;p&gt;Memory moves some processing ahead of later requests. A system may extract facts, build an index, or prepare a state. That preparation needs enough later use to recover its cost.&lt;/p&gt;

&lt;p&gt;Consider an illustrative setup with three assumed costs. These numbers are examples for the calculation, not MemOS prices:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Assumed cost&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prepare a reusable history&lt;/td&gt;
&lt;td&gt;$0.24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Process a later request without it&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Process a later request with it&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In this example, each later request saves $0.006. Dividing the $0.24 preparation cost by that saving gives a break-even point of 40 uses. At 40 uses, the two paths cost the same; after that, the memory setup begins to save money.&lt;/p&gt;

&lt;p&gt;After 10 uses, the baseline costs $0.14 and the memory setup costs $0.32. After 100 uses, the figures are $1.40 and $1.04. The per-request saving matters only if the prepared history is reused enough times.&lt;/p&gt;

&lt;p&gt;Now suppose the history changes often enough to require four full preparations across those 100 uses. Preparation costs $0.96, and the 100 later requests cost another $0.80. The total is $1.76.&lt;/p&gt;

&lt;p&gt;In this example, the same memory setup costs less when the history stays stable and more when it has to be prepared four times.&lt;/p&gt;

&lt;p&gt;For a real pilot, replace full preparation with the update path your application actually uses. In MemOS Cloud, a team can &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;update a known memory&lt;/a&gt; directly or submit &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; to correct relevant information.&lt;/p&gt;

&lt;p&gt;Measure those operations under your own workload. Updating an existing record may involve less work than preparing the full history again, but the result depends on how the application uses and updates memory.&lt;/p&gt;

&lt;h1&gt;
  
  
  Decide what a passing task must achieve
&lt;/h1&gt;

&lt;p&gt;Write the success conditions before testing. For the support assistant, the recommendation must match the current agreement and include the information needed to complete the next step.&lt;/p&gt;

&lt;p&gt;Include cases where the correct next step is a question. If the customer’s product version is missing, asking for it may be better than giving an unsupported recommendation. Define in advance whether that question counts as a passing result for the task being measured.&lt;/p&gt;

&lt;p&gt;Use the same tasks, answer model, and success conditions for both configurations. Compare short histories with short histories, and separate first use from repeated use. That makes it easier to see when preparing memory pays off.&lt;/p&gt;

&lt;p&gt;Calculate total processing costs divided by the number of tasks that pass. Keep unsuccessful attempts and retries at the cost. If no task passes, report the failure directly.&lt;/p&gt;

&lt;p&gt;Also set essential quality conditions. A system that applies another customer’s agreement has failed the task, however little it costs. Resolve that problem before selecting a cheaper configuration.&lt;/p&gt;

&lt;h1&gt;
  
  
  Include the work around the visible answer
&lt;/h1&gt;

&lt;p&gt;A memory-assisted request can involve processing, retrieval, generation, storage, and updates. Record the services used in each stage, then apply their actual billed units.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memos-docs.openmem.net/memos_cloud/features/async_mode/" rel="noopener noreferrer"&gt;MemOS Cloud’s async mode&lt;/a&gt; makes one distinction especially relevant: initial processing can make information available while refinement continues in the background. The time until the application receives a response and the time needed to finish processing are therefore worth measuring separately.&lt;/p&gt;

&lt;p&gt;For an asynchronous operation that returns a &lt;code&gt;task_id&lt;/code&gt;, associate that ID with the business task. The &lt;a href="https://memos-docs.openmem.net/api_docs/message/get_status/" rel="noopener noreferrer"&gt;task-status interface&lt;/a&gt; reports processing status and, after completion, summarizes memory changes and the relevant memory IDs. Use usage and billing records to assess cost; task status helps explain what happened during processing.&lt;/p&gt;

&lt;p&gt;For hosted services, use the units shown in usage and billing records. For self-hosting, state how shared compute and storage are allocated.&lt;/p&gt;

&lt;p&gt;Count each preparation or update once in total. If you also show an average cost per task, spread that cost across the tasks it supports without adding it a second time.&lt;/p&gt;

&lt;p&gt;When a task fails, inspect the useful evidence: what information was stored, what retrieval returned, and what reached the answer model. This helps locate the change that could improve both quality and cost.&lt;/p&gt;

&lt;h1&gt;
  
  
  Choose a workload the product will actually serve
&lt;/h1&gt;

&lt;p&gt;The final comparison needs four figures: preparation and update cost, cost per passing task, completion time, and reuse count.&lt;/p&gt;

&lt;p&gt;For a stable customer history used throughout the day, more preparation may pay back quickly. For a short-lived conversation used once, a simpler request path may be better. Frequent corrections can move the break-even point again.&lt;/p&gt;

&lt;p&gt;Report the range of outcomes as well as the average. A slower first request may be acceptable if later work becomes faster; a long delay after every correction may affect the experience users care about most.&lt;/p&gt;

&lt;p&gt;Use these findings to decide where MemOS fits in the workflow and when memory needs to be updated. Some tasks may benefit from reusing customer history; others may be cheaper to handle without preparing it first.&lt;/p&gt;

&lt;p&gt;As the product grows, rerun the comparison with the workload customers actually create. The decision can then change with reuse, update frequency, and the quality the task requires.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>memory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Choosing an Agent Memory Framework by the Code You Need to Own</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:45:18 +0000</pubDate>
      <link>https://dev.to/memos/choosing-an-agent-memory-framework-by-the-code-you-need-to-own-5gpn</link>
      <guid>https://dev.to/memos/choosing-an-agent-memory-framework-by-the-code-you-need-to-own-5gpn</guid>
      <description>&lt;p&gt;What happens when an agent remembers a policy that has changed?&lt;/p&gt;

&lt;p&gt;Consider a support assistant answering a return request. The standard policy allows 30 days, but one customer’s contract extends that window to 60 days. The assistant needs to find the right agreement, explain it to the right customer, and stop using the exception if the contract changes.&lt;/p&gt;

&lt;p&gt;A “remember my name” demo won’t tell you much about this case. You need to know whether the assistant can find the customer’s agreement, distinguish it from the standard policy, and use the updated terms when the agreement changes.&lt;/p&gt;

&lt;p&gt;That makes the return request a useful way to evaluate a memory framework: follow the information from the first conversation through the next policy change.&lt;/p&gt;

&lt;h1&gt;
  
  
  Start with the change, then choose the layer
&lt;/h1&gt;

&lt;p&gt;Write down what the task needs: the current return policy, the customer’s contract, and any approved exception. Keep shared policy separate from customer-specific information, and preserve the source and scope of each fact.&lt;/p&gt;

&lt;p&gt;Then look at what your application already provides. A workflow with durable state may need a searchable store. An application that follows changing relationships may benefit from a temporal graph. A team that needs to process, retrieve, and correct several kinds of memory may want a dedicated memory layer.&lt;/p&gt;

&lt;p&gt;The options cover different parts of this path:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Option&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Useful starting point&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Question for your project&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.langchain.com/oss/python/concepts/memory" rel="noopener noreferrer"&gt;LangGraph&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Thread state and long-term stores&lt;/td&gt;
&lt;td&gt;Which memory rules belong in the workflow?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/getzep/graphiti" rel="noopener noreferrer"&gt;Graphiti&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Time-aware facts and relationships&lt;/td&gt;
&lt;td&gt;Does the task depend on how relationships change?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://docs.mem0.ai/open-source/overview" rel="noopener noreferrer"&gt;Mem0&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;A dedicated memory layer&lt;/td&gt;
&lt;td&gt;How much of the write-and-retrieve path does it cover?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview" rel="noopener noreferrer"&gt;MemOS&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Memory processing, retrieval and correction components&lt;/td&gt;
&lt;td&gt;Where can the required behavior be extended?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A small preference store may be enough for a simple assistant. For a support workflow with changing agreements, look at how each option handles the information your application needs to maintain.&lt;/p&gt;

&lt;p&gt;With MemOS, teams can choose how they want to deploy and maintain that memory. The &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;open-source framework&lt;/a&gt; lets teams configure and extend the components in their own environment. &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/cloud_and_opensource/" rel="noopener noreferrer"&gt;MemOS Cloud&lt;/a&gt; provides a managed service for adding memory through APIs.&lt;/p&gt;

&lt;p&gt;Both give applications a way to carry information into later interactions. The choice depends on how much of the infrastructure and customization the team wants to manage.&lt;/p&gt;

&lt;h1&gt;
  
  
  Put business decisions where they can be changed
&lt;/h1&gt;

&lt;p&gt;In the returns example, the assistant can retrieve the relevant agreement and explain it. The order service applies the current return entitlement. That gives the product a clear place to update the rule when a contract changes.&lt;/p&gt;

&lt;p&gt;Identity matters here, too. Resolve the customer through the authenticated session, then select the information that customer is allowed to use. The model can interpret the question using the information the application provides.&lt;/p&gt;

&lt;p&gt;In MemOS Cloud, the standard return policy can be stored as shared information in a &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/knowledge_base/" rel="noopener noreferrer"&gt;knowledge base&lt;/a&gt;, while customer-specific information can be organized within the appropriate &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/isolation_filters/" rel="noopener noreferrer"&gt;user and project scope&lt;/a&gt;. The application can bring both into the same request after it has determined which customer is asking and what they are allowed to access.&lt;/p&gt;

&lt;p&gt;In a self-hosted MemOS implementation, the &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;Components and Handlers architecture&lt;/a&gt; separates these steps. MemReader processes conversations or documents into memory items. MemCube organizes memory for users and application scenarios. SearchHandler retrieves relevant memories, while FeedbackHandler handles corrections.&lt;/p&gt;

&lt;p&gt;That separation gives the team a place to start when the assistant gives the wrong answer. If the 60-day term was missed, inspect how the agreement was processed. If the term is saved but doesn’t appear for the customer, check retrieval and scope. If the saved term is outdated, send a correction and verify the result.&lt;/p&gt;

&lt;p&gt;Suppose a conversation includes a request for a longer return period that has not been approved. The application needs to preserve that distinction when it processes the request. Making the request easier to retrieve won’t turn it into an approved agreement.&lt;/p&gt;

&lt;h1&gt;
  
  
  Run a correction through a complete customer task
&lt;/h1&gt;

&lt;p&gt;Build a short evaluation around policy change. Ask about an ordinary customer, the customer with a special contract, and an order placed under the previous policy.&lt;/p&gt;

&lt;p&gt;Then withdraw the exception and repeat the current question. The answer should reflect the updated agreement.&lt;/p&gt;

&lt;p&gt;Now ask about an order placed while the 60-day exception was still active. The application may need the terms that applied to that order, depending on the company’s return rules. Keep that historical agreement or order record available so the assistant can distinguish it from the current policy.&lt;/p&gt;

&lt;p&gt;Keep the input, retrieved information, and results together. If the answer is wrong, the team can check whether the agreement was processed incorrectly, the wrong scope was selected, or the evidence was interpreted incorrectly.&lt;/p&gt;

&lt;p&gt;In the self-hosted MemOS architecture, requests marked as feedback can enter the correction path. Use an explicit correction when you intend to change a saved fact. An ordinary conversation message and a correction to an existing memory can serve different purposes.&lt;/p&gt;

&lt;p&gt;For teams using MemOS Cloud, there are two ways to submit a correction. If the application knows which record contains the 60-day exception, it can &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;update that memory directly&lt;/a&gt;. If an authorized user explains the change in a conversation, the application can submit &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; with the conversation context.&lt;/p&gt;

&lt;p&gt;After the update, search again to check that the current agreement is returned for the right customer. Keep the historical order case in the test as well.&lt;/p&gt;

&lt;p&gt;Finally, introduce a second source for the same agreement. Check whether your application can preserve its origin and identify the latest approved terms. This gives the team another useful case to test before a full production migration.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prefer changes that survive the next upgrade
&lt;/h1&gt;

&lt;p&gt;For each extension, record where it lives: application code, configuration, a documented handler, or a framework fork. A change in one well-defined place is easier to review than logic spread across several extraction prompts and retrieval hooks.&lt;/p&gt;

&lt;p&gt;Keep the policy cases as a small regression set. Run them when the framework, model, or retrieval configuration changes, and keep a readable export of the information they depend on.&lt;/p&gt;

&lt;p&gt;By the end, the team should know where the standard policy lives, how the customer’s exception is retrieved, and what needs to change when that exception is withdrawn.&lt;/p&gt;

&lt;p&gt;That is a more useful basis for choosing a memory framework than a demo that only shows the assistant remembering a fact. The better test is whether the team can keep that fact useful when the agreement changes.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>memory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>MemT 1.0 is launched: Towards Memory-Native Evolution.</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Fri, 30 Oct 2026 09:08:59 +0000</pubDate>
      <link>https://dev.to/memos/memt-10-is-launched-towards-memory-native-evolution-581c</link>
      <guid>https://dev.to/memos/memt-10-is-launched-towards-memory-native-evolution-581c</guid>
      <description>&lt;p&gt;On October 20th, we are officially releasing and open-sourcing the memory-native foundation model series, MemT 1.0.&lt;/p&gt;

&lt;p&gt;MemT 1.0 integrates persistent, updatable internal memory into model computation, so that historical information and task experience can be retained and recalled in subsequent related tasks. Our goal is to make "remember, update, and apply experience" a capability the model can learn.&lt;/p&gt;

&lt;p&gt;This release includes MemT-1.0-Flash and MemT-1.0-Nano, with 288B and 36B total parameters and 17B and 3B active parameters, respectively. Across 11 memory benchmarks, the two models achieve average scores of 50.6 and 47.0, ranking first and second among the parametric memory methods evaluated in this assessment — all under conditions where the query context does not provide the original history text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwylsfyzgis7h3pujfidz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwylsfyzgis7h3pujfidz.png" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figure: Memory performance of MemT 1.0 across benchmarks&lt;/p&gt;

&lt;h1&gt;
  
  
  01 Memory-Native: From Information Retention to a Learnable Capability
&lt;/h1&gt;

&lt;p&gt;Foundation models are internalizing capabilities such as reasoning and multimodality into themselves; memory is another critical capability. It enables a model to carry forward prior information and experience, accumulating and using them across sustained interactions.&lt;/p&gt;

&lt;p&gt;Earlier, Metis introduced memory foundation models, exploring memory as a native capability of the model. MemT 1.0 builds on this foundation with an upgrade: native memory modules are added to selected Transformer blocks, so that the original attention and memory attention run in parallel, jointly supporting information storage and use through dynamic local memory and trainable hyper memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F86w4l7lk9x0edce455hp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F86w4l7lk9x0edce455hp.png" alt=" " width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figure: The memory-native architecture of MemT 1.0&lt;/p&gt;

&lt;p&gt;Textual memory methods provide the original history or retrieved evidence at query time; MemT 1.0 instead leverages previously written information through internal memory states, without requiring the raw history text to be provided again.&lt;/p&gt;

&lt;p&gt;The key innovation is teaching the model how to retain, update, and read memory. During online interaction, the backbone and hyper-memory weights remain fixed; what changes is the dynamic memory state maintained independently for each interaction trajectory. Generation in the current turn reads existing memory; once the interaction completes, the input and answer are written back to memory for use in subsequent interactions.&lt;/p&gt;

&lt;h1&gt;
  
  
  02 The Memory Mechanism: How It Updates, How It Scales
&lt;/h1&gt;

&lt;p&gt;The memory mechanism of MemT 1.0 is built around three key pillars.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Token-wise stable updates&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A stable update mechanism based on Gated DeltaNet-2 updates memory token by token during the storage process after each interaction, merging new information into existing memory through erase, write, and forget mechanisms.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mixture-of-Storage for capacity scaling&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mixture-of-Storage (MoS) expands the native memory module into multiple memory experts, distributing information through independent storage and utilization routing. MoS employs dense routing in which all experts participate, providing a mechanism for expanding memory capacity. In this main evaluation, each memory layer uses a single expert; multi-expert scaling is examined separately in ablation experiments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F79n9q1ofyqs72i6axc05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F79n9q1ofyqs72i6axc05.png" alt=" " width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Figure: Mixture-of-Storage (MoS)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Two-stage training&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Continual pretraining builds language modeling capability that relies on native memory, followed by post-training that learns to complete tasks based on memory. The report constructs a 34B-token training corpus, comprising 20B tokens for continual pretraining and 14B tokens for post-training. Post-training adopts a "context–query–answer" format, in which the student model learns to reproduce the full-context teacher's answering behavior using only its memory state.&lt;/p&gt;

&lt;h1&gt;
  
  
  03 Measured Performance: It Remembers, and It Stays Reliable
&lt;/h1&gt;

&lt;p&gt;A memory-native model must not only make good use of historical information, but also maintain its original capabilities under memory noise. We evaluated MemT 1.0's actual performance along two dimensions: memory capability and general capability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory capability: can it use history well without the source text?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The experiments span 11 memory benchmarks, evaluating information retention and retrieval across different history lengths, dynamic updates and management, and personalized understanding. History is written into memory in chronological order; the model then answers related questions. Memory is strictly isolated across different users and histories.&lt;/p&gt;

&lt;p&gt;With no original history text in the query context, MemT-1.0-Flash and MemT-1.0-Nano score 50.6 and 47.0 on average, ranking first and second among the parametric memory methods in this evaluation — 12.5 and 8.9 points above the best average of other parametric memory methods, respectively.&lt;/p&gt;

&lt;p&gt;The two models have different strengths: Flash performs better on memory operations, personalized understanding, dialogue recall, and implicit learning; Nano scores higher on PerMemSafe and Memora. The strongest textual memory systems still hold an overall advantage, particularly in long-history tests. Ensuring that important details survive continuous updates and are accurately read back when needed remains a key direction for memory-native models.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu6t3me0xtzx4t5j3nb17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu6t3me0xtzx4t5j3nb17.png" alt=" " width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Memory capability evaluation across 11 benchmarks. Benchmarks are grouped by interaction trajectory length. DS denotes DeepSeek-V4-Flash-0731; QW denotes Qwen3.6-35B-A3B. In the original table, bold and underline denote the best and second-best results within each memory category, respectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General capability: can it hold up against irrelevant memory?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Models must also cope with interference from irrelevant memory. We write irrelevant information into memory before evaluation to simulate interference during sustained interaction, then compare against the corresponding backbone models under the same noise setting across four dimensions — knowledge and scientific reasoning, instruction following, long-context understanding, and code generation — on six benchmarks. Flash's average score is roughly on par with its backbone, while Nano drops by 0.9 points.&lt;/p&gt;

&lt;p&gt;First, instruction following: can the model accurately execute the current request? In the table, IFE refers to IFEval, which tests whether a model complies with explicit requirements such as specified formats, length limits, and required keywords — matters that determine whether an answer can be put directly to work. Under irrelevant information, Flash improves 0.9 points over its backbone to 93.9; Nano improves 3.3 points to 92.6, showing that both models still execute current instructions well in this test.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fum80907k106dpp5vescx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fum80907k106dpp5vescx.png" alt=" " width="799" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*General capability evaluation under the noise setting. Values for MemT 1.0 denote score differences relative to the corresponding backbone under the same setting.&lt;/p&gt;

&lt;p&gt;Second, the practical programming everyone cares about: can generated code actually get the job done? BCB-H refers to BigCodeBench-Hard, which requires the model to understand complex requirements, combine software libraries, and generate code that passes execution tests — testing whether the model can turn programming knowledge into runnable solutions. In this test, Flash and Nano each improve 2.0 points over their backbones, reaching 34.4 and 27.7, respectively. However, another code test, LiveCodeBench v6, drops by 0.7 and 5.8 points, indicating that different types of programming tasks are affected differently, and a single improvement should not be extrapolated into an overall gain in programming capability.&lt;/p&gt;

&lt;p&gt;Long-text understanding asks: faced with a large body of material, can the model sort out the information and answer questions? LB refers to LongBench v2, which covers long documents, multi-document settings, long conversations, and code repositories, testing the model's comprehension and reasoning over long-form material. Under irrelevant information, Flash improves 0.2 points over its backbone to 64.4, roughly on par overall, while Nano drops 2.0 points. The retention of historical information in internal memory and the comprehension of current long-form material need to be examined separately.&lt;/p&gt;

&lt;p&gt;These results show that memory capability and general capability can largely coexist, but some tasks still incur performance loss. Keeping models reliable while they continuously accumulate information is the direction memory-native models need to keep optimizing.&lt;/p&gt;

&lt;h1&gt;
  
  
  04 Putting Experience to Work: How Memory Changes What Happens Next
&lt;/h1&gt;

&lt;p&gt;MemT 1.0 explores a new path for growing foundation model capabilities: beyond parameters, data, and context, effective experience is retained and put to work in subsequent tasks.&lt;/p&gt;

&lt;p&gt;In a Coding Agent, operational experience — methods for reproducing problems, failure modes, and verification workflows — is retrieved, written into the model's internal memory, and then guides subsequent actions, without continuously occupying task context in textual form. The current experiments use an externally constructed experience library and apply task-specific post-training on top of Nano.&lt;/p&gt;

&lt;p&gt;We compared no experience, textual experience, and memory-native approaches on 500 tasks from SWE-bench Verified and 300 tasks from SWE-bench Multilingual covering nine programming languages, running each task independently three times.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;On Verified, with experience provided at task start, Nano raises the average success rate from 66.07% to 69.33%, versus 68.87% with textual experience. When the execution framework triggers experience writing at key breakpoints, the average success rate reaches 69.73%, and the proportion of tasks succeeding all three times rises from 54.00% to 62.80%, an improvement of 8.80 percentage points.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On Multilingual, the framework-triggered setting achieves an average success rate of 63.56%, higher than 60.00% without experience and 63.00% with textual experience; the proportion of tasks succeeding all three times rises from 45.33% to 55.33%. The gains mainly appear in average success rate and consistency across repeated runs; the proportion of tasks succeeding at least once did not consistently improve.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs2l0rk6lla67thm8c1qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs2l0rk6lla67thm8c1qf.png" alt=" " width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Agentic coding performance on SWE-bench Verified and SWE-bench Multilingual. In the original table, bold and underline denote the best and second-best results within each benchmark and experience-setting combination.&lt;/p&gt;

&lt;h1&gt;
  
  
  05 Storage and Runtime Efficiency: Persistent Accumulation with a Controllable State
&lt;/h1&gt;

&lt;p&gt;With a fixed memory configuration, new information updates the existing matrix, and the persistent state size does not keep growing with history. In the main evaluation configuration, Nano's FP32 memory state is 40 MiB per interaction trajectory, and Flash's is 1,280 MiB, excluding shared model weights and the current turn's KV cache.&lt;/p&gt;

&lt;p&gt;In the efficiency evaluation on BEAM history, at a 128K-token history length, Nano achieves roughly 1.86x end-to-end inference speed compared with the full-context approach, with a persistent state about 1/66 of its size; at a 256K history, end-to-end speed is about 3.99x.&lt;/p&gt;

&lt;p&gt;After history preparation, across the evaluated range from 512 to 256K tokens, Nano's average query first-token latency is approximately 104–112 ms, remaining essentially stable. End-to-end latency includes history preparation and the generation of a fixed 128-token answer; query first-token latency excludes history preparation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3mfxjvw9pfifva31x8hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3mfxjvw9pfifva31x8hn.png" alt=" " width="799" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Efficiency evaluation results: end-to-end latency and query first-token latency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyhn4tfzx1u9elltsnro6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyhn4tfzx1u9elltsnro6.png" alt=" " width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Persistent storage footprint per interaction trajectory.&lt;/p&gt;

&lt;p&gt;These advantages mainly appear in long-history scenarios; with short histories, Nano is usually slower. A fixed state also means limited information capacity: total storage still grows with the number of sessions and the configured capacity. The efficiency experiments above should not be directly equated with lower costs on programming tasks — experience writing and additional verification still incur overhead.&lt;/p&gt;

&lt;h1&gt;
  
  
  06 Limitations and Next Steps
&lt;/h1&gt;

&lt;p&gt;We see that fixed-capacity memory in memory-native models must strike a balance between preserving early details and accommodating new information, and long-term fidelity of precise information remains a challenge. Current experience application still relies on external experience construction and retrieval; a complete loop of autonomously acquiring, verifying, and continuously integrating experience has not yet formed.&lt;/p&gt;

&lt;p&gt;Next, we will improve long-term memory, expand memory capacity, and reduce the cost of memory updates. We will also further explore autonomous experience acquisition and continuous cross-task memory integration, gradually moving toward agents that learn from interaction through memory-native evolution.&lt;/p&gt;

&lt;p&gt;Memory-native capability provides a foundation for continual learning and recursive self-improvement (RSI); feedback, verification, and update mechanisms still need to evolve together.&lt;/p&gt;

&lt;h1&gt;
  
  
  07 Learn More
&lt;/h1&gt;

&lt;p&gt;Parameters set where a model's capability starts; memory opens up the space for intelligence to grow.&lt;/p&gt;

&lt;p&gt;Developers and researchers are welcome to explore the MemT 1.0 models and the possibilities of memory-native capability.&lt;/p&gt;

&lt;p&gt;Hugging Face: &lt;a href="https://huggingface.co/collections/MemTensor/memt-1" rel="noopener noreferrer"&gt;https://huggingface.co/collections/MemTensor/memt-1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/MemTensor/MemT-1.0" rel="noopener noreferrer"&gt;https://github.com/MemTensor/MemT-1.0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>aimemory</category>
      <category>memorynative</category>
    </item>
    <item>
      <title>Agent Memory Architecture: Building Cross-Session Memory with MemOS</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Thu, 29 Oct 2026 02:25:30 +0000</pubDate>
      <link>https://dev.to/memos/agent-memory-architecture-building-cross-session-memory-with-memos-1mmj</link>
      <guid>https://dev.to/memos/agent-memory-architecture-building-cross-session-memory-with-memos-1mmj</guid>
      <description>&lt;p&gt;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.”&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide when each instruction applies
&lt;/h2&gt;

&lt;p&gt;The reporting assistant has to distinguish a lasting preference from an instruction for the current task:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User instruction&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;th&gt;Expected behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;“Send my weekly reports by email by default.”&lt;/td&gt;
&lt;td&gt;Ongoing preference&lt;/td&gt;
&lt;td&gt;Use email until the user changes the default.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Use Slack for future weekly reports.”&lt;/td&gt;
&lt;td&gt;Updated preference&lt;/td&gt;
&lt;td&gt;Use Slack for later reports.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Email this report.”&lt;/td&gt;
&lt;td&gt;One report&lt;/td&gt;
&lt;td&gt;Use email for this report and keep Slack as the default.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Forget my report-delivery preference.”&lt;/td&gt;
&lt;td&gt;Saved preference&lt;/td&gt;
&lt;td&gt;Remove the preference and ask where to send a future report if no other instruction applies.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;MemOS Cloud can extract &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/memory_types/" rel="noopener noreferrer"&gt;preference memories&lt;/a&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  See how the MemOS components work together
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;MemOS v2.0 open-source architecture&lt;/a&gt; separates memory processing into components coordinated by handlers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Role in the open-source architecture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MemReader&lt;/td&gt;
&lt;td&gt;Processes inputs into memory items that can be stored.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MemCube&lt;/td&gt;
&lt;td&gt;Holds memory modules for users and application scenarios.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MemScheduler&lt;/td&gt;
&lt;td&gt;Coordinates background processing, including storage and indexing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MemChat&lt;/td&gt;
&lt;td&gt;Coordinates memory retrieval, response generation, and storage of new memories.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MemFeedback&lt;/td&gt;
&lt;td&gt;Processes natural-language corrections, additions, and replacements.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/overview/" rel="noopener noreferrer"&gt;MemOS Cloud&lt;/a&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the same user across conversations
&lt;/h2&gt;

&lt;p&gt;Send the user’s messages to the &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_message/" rel="noopener noreferrer"&gt;Add Message API&lt;/a&gt;. A typical request includes a &lt;code&gt;user_id&lt;/code&gt;, a &lt;code&gt;conversation_id&lt;/code&gt;, and a &lt;code&gt;messages&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;When the user starts another conversation, call the &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/search_memory/" rel="noopener noreferrer"&gt;Search Memory API&lt;/a&gt; with the same &lt;code&gt;user_id&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Keep the user ID stable across conversations, with a separate conversation ID for each interaction. When you include &lt;code&gt;conversation_id&lt;/code&gt; in a search, MemOS gives memories from that conversation greater weight while still allowing the user’s historical memories to be retrieved.&lt;/p&gt;

&lt;p&gt;For applications serving multiple users, &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/isolation_filters/" rel="noopener noreferrer"&gt;user and agent memory boundaries&lt;/a&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update a preference when it changes
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;If your application knows which record needs editing, use &lt;a href="https://memos-docs.openmem.net/api_docs/core/update_memory/" rel="noopener noreferrer"&gt;Update Memory&lt;/a&gt; with its &lt;code&gt;memory_id&lt;/code&gt;. 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.&lt;/p&gt;

&lt;p&gt;For a correction made in conversation, submit &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; with &lt;code&gt;user_id&lt;/code&gt;, &lt;code&gt;conversation_id&lt;/code&gt;, and &lt;code&gt;feedback_content&lt;/code&gt;. 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/time_awareness/" rel="noopener noreferrer"&gt;time awareness&lt;/a&gt; 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 &lt;code&gt;chat_time&lt;/code&gt; to preserve the original timing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Allow for background processing
&lt;/h2&gt;

&lt;p&gt;MemOS Cloud processes added messages &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/async_mode/" rel="noopener noreferrer"&gt;asynchronously by default&lt;/a&gt;. An initial processing stage makes recent messages available for retrieval, while further refinement continues in the background. You can use the returned &lt;code&gt;task_id&lt;/code&gt; with the &lt;a href="https://memos-docs.openmem.net/api_docs/message/get_status/" rel="noopener noreferrer"&gt;task-status API&lt;/a&gt; to follow processing through completion.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide what to delete
&lt;/h2&gt;

&lt;p&gt;Use &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt;Delete Memory&lt;/a&gt; with &lt;code&gt;memory_ids&lt;/code&gt; to remove selected memories, or with &lt;code&gt;user_id&lt;/code&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose the right form of memory
&lt;/h2&gt;

&lt;p&gt;The reporting assistant uses editable information stored outside the model. Our &lt;a href="https://arxiv.org/abs/2507.03724" rel="noopener noreferrer"&gt;research framework&lt;/a&gt; describes three forms of memory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plaintext memory stores information outside the model, where it can be retrieved and updated.&lt;/li&gt;
&lt;li&gt;Activation memory holds runtime states, such as KV caches.&lt;/li&gt;
&lt;li&gt;Parametric memory holds knowledge in model weights.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MemCube brings memory content and metadata together so memory can be organized and managed. The open-source &lt;a href="https://memos-docs.openmem.net/open_source/modules/memories/kv_cache_memory/" rel="noopener noreferrer"&gt;KV-cache module&lt;/a&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the whole flow
&lt;/h2&gt;

&lt;p&gt;You can try the reporting scenario across several conversations with the same user:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;  Save email as the default, then retrieve it in a new conversation.&lt;/li&gt;
&lt;li&gt;Change the default to Slack and check the retrieved preference and assistant response.&lt;/li&gt;
&lt;li&gt;Request email for one report, then check that a later report still uses Slack.&lt;/li&gt;
&lt;li&gt;Search as a different user and confirm the first user’s private preference is not returned.&lt;/li&gt;
&lt;li&gt;Delete the preference, start a new conversation, and check that it is no longer retrieved.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/quick_start/" rel="noopener noreferrer"&gt;MemOS Cloud quickstart&lt;/a&gt; to add memory to your application, or explore the &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;open-source architecture&lt;/a&gt; for a self-hosted deployment.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>opensource</category>
      <category>aimemory</category>
    </item>
    <item>
      <title>Why AI Agents Need to Know When a Memory Is Out of Date</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Thu, 29 Oct 2026 02:15:57 +0000</pubDate>
      <link>https://dev.to/memos/why-ai-agents-need-to-know-when-a-memory-is-out-of-date-56pf</link>
      <guid>https://dev.to/memos/why-ai-agents-need-to-know-when-a-memory-is-out-of-date-56pf</guid>
      <description>&lt;p&gt;An AI agent can remember a project plan correctly and still give the wrong deadline. A software release is scheduled for Thursday. Testing runs long, and the project lead moves it to the following Monday. In a new conversation, someone asks when the release ships. The agent pulls up the original brief and answers Thursday.&lt;/p&gt;

&lt;p&gt;The brief was accurate when it was written. The plan has changed since then.&lt;/p&gt;

&lt;p&gt;Over a week of project work, an assistant may encounter the original brief, a revised schedule, and several conversations about both. It needs enough context to tell which project each piece of information belongs to, where it came from, and whether it still applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which date applies now?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.langchain.com/oss/python/concepts/memory" rel="noopener noreferrer"&gt;LangGraph’s memory documentation&lt;/a&gt; distinguishes between memory within a conversation thread and longer-term information shared across threads. That helps explain how an agent can carry context into a new conversation. Keeping that context current is another part of the job.&lt;/p&gt;

&lt;p&gt;In the release example, Monday belongs in the answer to “When are we shipping?” Thursday still matters if someone asks, “What was the original plan?” Both dates can be useful, provided the agent understands their place in the project’s history.&lt;/p&gt;

&lt;p&gt;Now add a message from a teammate asking, “Could we still make Thursday?” The teammate is reopening the discussion. The approved date remains Monday. Your application needs to preserve that difference and know who can approve a schedule change. Sorting messages by recency alone won’t settle it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping useful details with each memory
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/overview/" rel="noopener noreferrer"&gt;MemOS&lt;/a&gt;, memory is managed throughout its lifecycle. The system extracts useful information from inputs, organizes it for retrieval, and updates it as new information arrives. Your application can carry project details into later conversations, so users can pick up their work without explaining the plan again in every chat.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://arxiv.org/abs/2507.03724" rel="noopener noreferrer"&gt;MemOS paper&lt;/a&gt; introduces MemCube, a memory unit that combines content with metadata such as its source and version history. In a release workflow, useful context would include the project, the message announcing the change, and the date it takes effect. Keeping these details together helps your application distinguish an approved schedule from a draft under discussion.&lt;/p&gt;

&lt;p&gt;MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/time_awareness/" rel="noopener noreferrer"&gt;time awareness&lt;/a&gt; handles information that changes over time. It maintains versions of evolving states, such as preferences or goals, and uses time clues in a question to retrieve current or historical information. Separate events retain their own details. In the release example, a question about the current schedule calls for Monday, while a question about the original plan calls for Thursday.&lt;/p&gt;

&lt;p&gt;When you import older conversations, you can supply the original message time through &lt;code&gt;chat_time&lt;/code&gt;. Otherwise, MemOS uses the ingestion time. Preserving that timestamp helps prevent an old conversation imported today from looking like a fresh update.&lt;/p&gt;

&lt;h2&gt;
  
  
  A correction needs to change the next answer
&lt;/h2&gt;

&lt;p&gt;When the assistant gets the date wrong, a user should be able to correct it without tracking down a database record.&lt;/p&gt;

&lt;p&gt;MemOS Cloud supports both direct editing and conversational correction. Use the &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;update API&lt;/a&gt; when you know which record needs attention. You can revise its content or title, or change its status to archive outdated information. This gives developers and administrators direct control over a specific memory.&lt;/p&gt;

&lt;p&gt;For corrections made during a conversation, &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; lets a user say, “The release has been approved for Monday. Please update the schedule.” Once your application submits that feedback with the user and conversation context, MemOS locates relevant memories and applies corrections. It can add new information and update or override conflicting memories. The user can correct the schedule where the problem appeared, without finding a memory ID.&lt;/p&gt;

&lt;p&gt;For ongoing chat, MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/async_mode/" rel="noopener noreferrer"&gt;asynchronous message processing&lt;/a&gt; makes recent messages available for retrieval after an initial processing stage, while further refinement runs in the background. Your assistant can use that information in the next turn. A task-status API lets you follow the background work through completion.&lt;/p&gt;

&lt;h2&gt;
  
  
  When a memory should be removed
&lt;/h2&gt;

&lt;p&gt;Some information should stay in the project history. Other information needs to be removed at the user’s request.&lt;/p&gt;

&lt;p&gt;With MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt;deletion API&lt;/a&gt;, you can delete specific memories or clear a user’s or agent’s memories within the current project. Use targeted deletion to remove particular records, or the broader options when a user or agent needs to start with a cleared memory.&lt;/p&gt;

&lt;p&gt;If your application keeps a separate summary containing the schedule, or regularly imports the same project brief, include those sources in your deletion workflow where they fall within the request’s scope. This prevents a later import from recreating information the user asked to remove. Once the relevant memories and copies have been removed, the assistant should ask for the schedule again when it needs it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build with MemOS
&lt;/h2&gt;

&lt;p&gt;We offer &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/cloud_and_opensource/" rel="noopener noreferrer"&gt;MemOS Cloud and an open-source framework&lt;/a&gt; for different deployment needs. MemOS Cloud manages the memory infrastructure so you can integrate through APIs and focus on your application. Choose self-hosting when you need more control over configuration, customization, and infrastructure.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;MemOS v2.0 open-source architecture&lt;/a&gt;, MemReader turns inputs into memory items, MemScheduler handles background processing, and MemFeedback processes corrections. MemChat coordinates retrieval, response generation, and storage. You can work with these components to adapt how your application captures information and uses it later.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://arxiv.org/abs/2507.03724" rel="noopener noreferrer"&gt;research framework&lt;/a&gt; covers three forms of memory, including external text, runtime states such as KV caches, and parametric memory encoded in model weights. For the release schedule, editable external records give your application a practical way to keep the plan current as decisions change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the workflow across conversations
&lt;/h2&gt;

&lt;p&gt;Start with the Thursday brief, add the approved move to Monday, then introduce a question about whether Thursday is still possible. In a new conversation, ask for both the current schedule and the original plan. The answers should reflect the change and its history.&lt;/p&gt;

&lt;p&gt;Then remove the schedule within the intended scope and check that routine retrieval or imports don’t bring it back. Comparing the source messages, retrieved memories, and context passed to the model will help you see how each change reaches the assistant.&lt;/p&gt;

&lt;p&gt;A teammate returning the next morning should be able to pick up the conversation with the revised plan already in place.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>opensource</category>
      <category>aimemory</category>
    </item>
    <item>
      <title>Choosing a MemOS Integration for Your AI Agent</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Fri, 23 Oct 2026 09:54:43 +0000</pubDate>
      <link>https://dev.to/memos/choosing-a-memos-integration-for-your-ai-agent-2bm3</link>
      <guid>https://dev.to/memos/choosing-a-memos-integration-for-your-ai-agent-2bm3</guid>
      <description>&lt;p&gt;Imagine a customer returning three days after a replacement was approved. They want to know when it will ship, and they have a new delivery address. The agent handling this conversation needs the earlier approval, the updated address, and the current shipping status from the order system.&lt;/p&gt;

&lt;p&gt;That gives you a useful starting point for choosing a memory system. You can follow a specific piece of information from the conversation where it first appeared to the task that needs it later.&lt;/p&gt;

&lt;p&gt;We built MemOS to help applications &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/quick_start/" rel="noopener noreferrer"&gt;carry context across conversations&lt;/a&gt;. You can connect through a managed API, run the open-source service on your infrastructure, or add memory to a supported agent through a plugin. The right starting point depends on what you’re building and how you want to operate it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose where the integration will run
&lt;/h2&gt;

&lt;p&gt;For an application your team is developing, the first decision is whether to use our hosted service or manage the deployment yourself. If you’re adding memory to an existing agent environment, a plugin handles the connection between the agent and its memory.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you‘re building&lt;/th&gt;
&lt;th&gt;Where to start&lt;/th&gt;
&lt;th&gt;What your team manages&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A service running on your infrastructure&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/MemTensor/MemOS" rel="noopener noreferrer"&gt;MemOS open-source framework&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The service, storage dependencies, model configuration, and operations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An OpenClaw or DeepSeek Harness setup using cloud memory&lt;/td&gt;
&lt;td&gt;&lt;a href="https://memos-docs.openmem.net/openclaw/guide/" rel="noopener noreferrer"&gt;MemOS Cloud Plugin&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The agent environment and plugin configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An OpenClaw, Hermes Agent, or DeepSeek Harness setup with local memory storage&lt;/td&gt;
&lt;td&gt;&lt;a href="https://docs.openmem.net/openclaw/local_plugin/" rel="noopener noreferrer"&gt;MemOS Local Plugin&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The local runtime, model connections, and backups&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;With MemOS Cloud, we operate the memory service. Self-hosting gives you control over the code and infrastructure; our &lt;a href="https://github.com/MemTensor/MemOS" rel="noopener noreferrer"&gt;reference Docker deployment&lt;/a&gt; runs the MemOS API alongside Neo4j and Qdrant.&lt;/p&gt;

&lt;p&gt;The plugins connect memory to the agent’s normal execution. MemOS Cloud Plugin recalls relevant memories before a run and saves new messages afterward. MemOS Local Plugin maintains SQLite storage on the machine and combines vector and lexical retrieval. It also turns execution experience into reusable policies and Skills, with a Memory Viewer for inspecting the results. Its &lt;a href="https://docs.openmem.net/openclaw/local_plugin/" rel="noopener noreferrer"&gt;local configuration&lt;/a&gt; includes model connections and optional team sharing, which you should review when deciding where data will be processed.&lt;/p&gt;

&lt;p&gt;Once you’ve chosen a path, test the workflow you actually need. The examples below use MemOS Cloud’s interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide what the next conversation needs to remember
&lt;/h2&gt;

&lt;p&gt;In the replacement case, the customer’s notification preference belongs with their personal history. The company’s replacement policy belongs in shared business knowledge. A procedure for checking an order and opening a replacement ticket may be useful across many customers.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://memos-docs.openmem.net/usecase/customer_service_assistant/" rel="noopener noreferrer"&gt;customer service example&lt;/a&gt; separates these into user memories, Agent Skills, and a policy knowledge base. That lets the agent retrieve customer context alongside general procedures while continuing to consult the order and ticket systems for current business state.&lt;/p&gt;

&lt;p&gt;MemOS Cloud provides &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/memory_types/" rel="noopener noreferrer"&gt;different memory categories&lt;/a&gt; for these purposes. Facts and preferences capture customer context. Event Memory preserves details about what happened, while Skills and Tool Memory capture reusable task experience. Profiles organize information into predefined fields when your application needs a structured view of a user.&lt;/p&gt;

&lt;p&gt;The setup varies by category. A Profile requires a template bound to the user. Tool Memory needs tool-call information in the input, and a knowledge base needs uploaded content. Use &lt;code&gt;allow_memory_view&lt;/code&gt; to choose which categories may be generated from a write.&lt;/p&gt;

&lt;p&gt;During development, inspect what the system extracts from a few representative conversations. “Please text me when it ships” is a preference. “If I move next month, I’ll need to change my address” is conditional. Your test should check whether that condition survives extraction.&lt;/p&gt;

&lt;p&gt;For a closer look, our &lt;a href="https://memos-docs.openmem.net/self_developed_model/extraction_usage_example/" rel="noopener noreferrer"&gt;memory extraction endpoint&lt;/a&gt; returns factual and preference candidates without writing them to the memory store. It supports synchronous extraction from text conversations, so your application can inspect the results or apply its own checks. After using the full write pipeline, inspect the stored records as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the returning customer easy to recognize
&lt;/h2&gt;

&lt;p&gt;When the customer comes back through another channel, use the same &lt;code&gt;user_id&lt;/code&gt;. Your application should derive that identifier from its authenticated customer record.&lt;/p&gt;

&lt;p&gt;MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/isolation_filters/" rel="noopener noreferrer"&gt;project and user scopes&lt;/a&gt; determine which personal memories a request searches. The API Key selects the project, and &lt;code&gt;user_id&lt;/code&gt; identifies the customer within it. Keep the API Key on your server and connect each request to your application’s access rules.&lt;/p&gt;

&lt;p&gt;If several agents serve the same customer, you can tag memories with &lt;code&gt;agent_id&lt;/code&gt; and filter by the agent that produced them. An agent can also have its own independent memory, for example to accumulate reusable support Skills. Enable &lt;strong&gt;Create Independent Memory for Agent&lt;/strong&gt; in the project settings for that behavior; it is disabled by default.&lt;/p&gt;

&lt;p&gt;A new conversation can still use the customer’s earlier memories. The &lt;code&gt;conversation_id&lt;/code&gt; supplies conversational context and can influence relevance, but it does not automatically restrict retrieval to that session.&lt;/p&gt;

&lt;p&gt;To find the information needed for the next response, our &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/search_memory/" rel="noopener noreferrer"&gt;Search Memory API&lt;/a&gt; combines keyword and vector retrieval with ranking, filtering, and deduplication. You can select memory categories with &lt;code&gt;include_memory_view&lt;/code&gt;, set the number of results with &lt;code&gt;memory_limit_number&lt;/code&gt;, and narrow the search using &lt;code&gt;filter&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this case, inspect whether the search returns the replacement approval and relevant delivery details. Then check the context your application actually sends to the model. Our &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/quick_start/" rel="noopener noreferrer"&gt;application integration workflow&lt;/a&gt; shows where recalled memories are added to the prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle the address change
&lt;/h2&gt;

&lt;p&gt;Information that was accurate on Monday may need updating on Thursday. MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/time_awareness/" rel="noopener noreferrer"&gt;time-aware memory handling&lt;/a&gt; supports changing states and historical questions, so current information and earlier versions can serve different requests. When importing older conversations, provide &lt;code&gt;chat_time&lt;/code&gt; to preserve when the information was recorded.&lt;/p&gt;

&lt;p&gt;You also need a way to fix mistakes. If your support team knows which record is wrong, it can &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;update the memory by ID&lt;/a&gt;, changing its content, title, or status. If the customer gives a correction in conversation, your backend can submit it through &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt; with the relevant user and conversation context.&lt;/p&gt;

&lt;p&gt;Follow the operation through to completion. Cloud writes use &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/async_mode/" rel="noopener noreferrer"&gt;asynchronous processing&lt;/a&gt; by default. Use the returned &lt;code&gt;task_id&lt;/code&gt; to check &lt;code&gt;get/status&lt;/code&gt;; a completed task includes a summary of memory changes. Then retrieve the affected information again and confirm that the next response uses the updated address.&lt;/p&gt;

&lt;p&gt;For the shipment itself, your application should still verify the address and order status through the business system before taking action.&lt;/p&gt;

&lt;h2&gt;
  
  
  Be specific about deletion
&lt;/h2&gt;

&lt;p&gt;If the customer asks to remove their history, decide which records the request covers.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt;&lt;code&gt;delete/memory&lt;/code&gt;&lt;/a&gt;&lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt; endpoint&lt;/a&gt; accepts one of three targets per call: specific &lt;code&gt;memory_ids&lt;/code&gt;, a &lt;code&gt;user_id&lt;/code&gt;, or an &lt;code&gt;agent_id&lt;/code&gt;. Each operation stays within the API Key’s project. Agent-wide deletion requires independent Agent memory to be enabled.&lt;/p&gt;

&lt;p&gt;That endpoint does not accept a conversation ID or knowledge base ID as a deletion target. Knowledge Base files have a &lt;a href="https://memos-docs.openmem.net/api_docs/knowledge/delete_kb_doc/" rel="noopener noreferrer"&gt;separate deletion endpoint&lt;/a&gt; that accepts &lt;code&gt;file_ids&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After deleting, repeat the relevant searches. Include any copies your application keeps in caches, exports, or logs when defining the full deletion workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the whole case before rolling it out
&lt;/h2&gt;

&lt;p&gt;Use the same replacement scenario throughout your pilot. A few variations will tell you more about the integration than a collection of unrelated prompts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Return in a new session.&lt;/strong&gt; Record the approval, then open another conversation for the same customer. Check whether the agent can continue the case without asking for information already provided.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change a detail.&lt;/strong&gt; Update the delivery address or switch the notification preference from email to text. Inspect the stored change and the next response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include a conditional statement.&lt;/strong&gt; Try “If I move to Seattle, I’ll need to update my address.” Check that a possible move has not become a confirmed address change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use another customer account.&lt;/strong&gt; Repeat the question as a different user. Inspect the request’s identity mapping and make sure the original customer’s personal information is absent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remove the test records.&lt;/strong&gt; Delete the intended memories and search again. If the workflow uses Knowledge Base files, test their removal separately.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Track how long new information takes to become retrievable, along with p95 latency, token usage, and time spent investigating failures. Compare task outcomes with and without memory: whether the agent gives the correct next step, how often the customer has to repeat themselves, and whether corrections carry into later conversations.&lt;/p&gt;

&lt;p&gt;Keep a short record of the configuration, results, and issues still to resolve. That record should make it clear why the chosen deployment fits your application.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/quick_start/" rel="noopener noreferrer"&gt;Cloud quick start&lt;/a&gt; walks through the first write and retrieval. If you’re running the service yourself, begin with the &lt;a href="https://github.com/MemTensor/MemOS" rel="noopener noreferrer"&gt;self-hosting instructions&lt;/a&gt;. Bring one complete customer case through the integration before expanding to more workflows.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>aimemory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Persistent Agent Memory Should Make the Next Task Easier</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Fri, 23 Oct 2026 09:42:32 +0000</pubDate>
      <link>https://dev.to/memos/persistent-agent-memory-should-make-the-next-task-easier-2j5l</link>
      <guid>https://dev.to/memos/persistent-agent-memory-should-make-the-next-task-easier-2j5l</guid>
      <description>&lt;h2&gt;
  
  
  How we think about continuity, correction, and boundaries at MemTensor
&lt;/h2&gt;

&lt;p&gt;Suppose a team discovers on Tuesday that integration tests fail unless the database is started first. On Friday, another agent picks up a related task. It needs the confirmed setup procedure, including when it applies. When the team changes that procedure, the stored instruction needs to change with it.&lt;/p&gt;

&lt;p&gt;That is the experience we are building toward with MemOS: useful knowledge that carries over between tasks and stays open to correction.&lt;/p&gt;

&lt;h3&gt;
  
  
  A large context window is not a memory policy
&lt;/h3&gt;

&lt;p&gt;A larger context window gives an agent more material to read. The application still needs to decide what to retain, who can reuse it, and how to handle updates.&lt;/p&gt;

&lt;p&gt;In the testing example, the failure is an event. The confirmed setup sequence is a reusable procedure, with the relevant environment and conditions attached.&lt;/p&gt;

&lt;p&gt;MemOS Cloud &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/memory_types/" rel="noopener noreferrer"&gt;organizes memory by type&lt;/a&gt; so these records can serve different purposes. Event memories retain details such as when something happened; skills capture reusable task steps. Facts and preferences provide context about the user. You can control which categories are generated and which are included in a search.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuity is a four-step loop
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Capture.&lt;/strong&gt; Through &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_message/" rel="noopener noreferrer"&gt;Add Message&lt;/a&gt;, MemOS Cloud extracts memories from conversations, checks for duplicated or conflicting information, and updates existing records when needed. You can attach custom metadata, such as the source and environment, using &lt;code&gt;info&lt;/code&gt;. For Tuesday’s test run, submit the discussion that confirms the setup sequence and identifies where it applies. The metadata also gives your application fields to filter on later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve.&lt;/strong&gt; &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/search_memory/" rel="noopener noreferrer"&gt;Search Memory&lt;/a&gt; combines keyword and vector retrieval, ranks memories by relevance, and removes duplicate results. Filters narrow the results by tags, time, Agent, or custom metadata. Memory-type selection lets you include skills, while a result limit controls how many memories are returned. For Friday’s task, retrieve the relevant testing instructions and pass them to the model with the current request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correct.&lt;/strong&gt; Suppose the team introduces a script that starts the database automatically. If you know which record needs changing, &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;Update Memory&lt;/a&gt; lets you edit it by ID. With &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;natural-language feedback&lt;/a&gt;, a user can describe the new procedure, and MemOS locates and updates the relevant memories. For changing facts and preferences, our &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/time_awareness/" rel="noopener noreferrer"&gt;time-awareness mechanism&lt;/a&gt; maintains historical versions and uses time cues in a query to distinguish current information from earlier states.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop using or delete.&lt;/strong&gt; An outdated procedure can be archived through the update API. &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt;Delete Memory&lt;/a&gt; supports removing specific memories or clearing a user’s memories within the API key’s project. Include any copies kept in application caches or summaries in your deletion workflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Sharing needs an owner
&lt;/h3&gt;

&lt;p&gt;Before sharing a procedure across agents, decide who maintains it and which users or projects should be able to use it.&lt;/p&gt;

&lt;p&gt;MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/isolation_filters/" rel="noopener noreferrer"&gt;isolation controls&lt;/a&gt; separate memory by project and user. Agent filters narrow a user’s records to a particular Agent; enabling independent Agent memory gives that Agent its own long-term memory across users and conversations. Map &lt;code&gt;user_id&lt;/code&gt; values to authenticated users in your backend. A &lt;code&gt;conversation_id&lt;/code&gt; influences retrieval context and does not enforce access control.&lt;/p&gt;

&lt;p&gt;For shared setup guides, our &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/knowledge_base/" rel="noopener noreferrer"&gt;knowledge bases&lt;/a&gt; turn uploaded documents into searchable memory that can be retrieved alongside user memory. A task can then combine the team’s documented procedure with context from earlier interactions.&lt;/p&gt;

&lt;p&gt;In supported agent hosts, &lt;a href="https://docs.openmem.net/openclaw/local_plugin/" rel="noopener noreferrer"&gt;MemOS Local Plugin&lt;/a&gt; stores memory in a local SQLite database and connects capture and retrieval to the host’s task lifecycle. It records conversations, tool calls, and feedback after a task, then supplies relevant context before the next one. Recurring patterns can develop into reusable skills.&lt;/p&gt;

&lt;p&gt;To check this in your application, use three sessions: establish the procedure, have an authorized agent apply it, then change it and ask again. Repeat the request from a different project and after deletion. Inspect the retrieved memories and the context passed to the model, alongside its answer, to spot stale instructions or scope errors.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>aimemory</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Agent Memory Observability: 12 Measures That Matter After Launch</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Wed, 14 Oct 2026 12:52:10 +0000</pubDate>
      <link>https://dev.to/memos/agent-memory-observability-12-measures-that-matter-after-launch-2dop</link>
      <guid>https://dev.to/memos/agent-memory-observability-12-measures-that-matter-after-launch-2dop</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A production checklist from MemTensor.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An agent may return the right answer while relying on an outdated preference. It may also retrieve a record outside the caller’s authorized scope or keep using one after a correction. At MemTensor, we recommend tracing memory from the initial write through retrieval and later changes, so you can see which records reached the model and investigate the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the user outcome
&lt;/h2&gt;

&lt;p&gt;Choose a task that memory should improve: a support case resumed after a week, a coding agent applying a project rule, or an assistant using a corrected preference. Compare matched tasks with and without authorized memory. Keep the model, base prompt, tools, and scoring criteria fixed.&lt;/p&gt;

&lt;p&gt;Track task success alongside retrieval quality and latency. This connects changes in the memory system to the work the agent actually completes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The twelve-measure starter set
&lt;/h2&gt;

&lt;p&gt;We recommend the following measures for your application’s evaluation. Define the labels, sampling method, and thresholds before the pilot.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;STAGE&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;MEASURE&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;HOW TO MEASURE IT&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Write&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1. Memory acceptance rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Share of sampled generated memories judged accurate, correctly attributed, and useful enough to retain.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Write&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2. Duplicate write rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Share of newly stored records that unnecessarily duplicate an active memory. Exclude intentional historical versions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Write&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3. Write-to-searchable latency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Time from write submission to the first successful retrieval by a predefined authorized query. Report p50 and p95.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retrieve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4. Fact recall@k&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Distinct required facts covered by the top k results, divided by all required facts for the task.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retrieve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5. Precision@k&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Relevant records in the top k results, divided by k. Unfilled result slots count as misses.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retrieve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6. Stale recall rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Share of retrieved records that are obsolete for the question’s requested time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retrieve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;7. Cross-scope exposure rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Share of scope tests that return any unauthorized memory, whether or not it appears in the final answer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Retrieve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;8. Read latency p95&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The 95th-percentile time from sending a retrieval request to receiving its response, segmented by workload and data size.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9. Correction propagation time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Time from submitting a correction until current-state queries return the new value without presenting the old value as current.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;10. Unresolved conflict rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Share of reviewed fact groups with incompatible current values for the same entity, attribute, scope, and effective time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Forget&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;11. Deletion completion rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Requests verified complete across the declared scope by their deadline, divided by all requests due.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Outcome&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;12. Task success delta&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Difference in success rate on matched tasks with and without authorized memory, expressed in percentage points.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Set latency budgets for the workload and report failed or timed-out operations alongside successful timings. Review each scope violation and incomplete deletion individually, even when overall rates are low.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow identifiers, not copies of private content
&lt;/h2&gt;

&lt;p&gt;Link each request to its authenticated scope, search query, returned memory IDs, injected memory IDs, answer, and feedback. For writes, updates, and deletions, record the affected memory IDs, source reference, actor, and timestamps. Keep sensitive payloads in their designated store rather than copying full conversations into telemetry.&lt;/p&gt;

&lt;p&gt;MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/features/async_mode/" rel="noopener noreferrer"&gt;asynchronous writes&lt;/a&gt; return a task ID while processing continues in the background. Use &lt;a href="https://memos-docs.openmem.net/api_docs/message/get_status/" rel="noopener noreferrer"&gt;Get Task Status&lt;/a&gt; to track completion and identify affected memories by category. Log that completion time alongside the first successful retrieval.&lt;/p&gt;

&lt;p&gt;Our &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/cloud_and_opensource/" rel="noopener noreferrer"&gt;Cloud console&lt;/a&gt; provides call logs and request-chain inspection for debugging API behavior. The &lt;a href="https://docs.openmem.net/openclaw/local_plugin/" rel="noopener noreferrer"&gt;MemOS Local Plugin Viewer&lt;/a&gt; brings memory records, tasks, analytics, and logs into one interface for inspecting local runs. With our &lt;a href="https://memos-docs.openmem.net/memos_cloud/getting_started/cloud_and_opensource/" rel="noopener noreferrer"&gt;open-source deployment&lt;/a&gt;, you can extend service-side instrumentation in your own infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three failures to rehearse before release
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Try a wrong-scope read.&lt;/strong&gt; Exercise your application with test accounts from different users and projects, including requests with altered identifiers. MemOS Cloud’s &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/isolation_filters/" rel="noopener noreferrer"&gt;project and user isolation&lt;/a&gt; separates records by project API key and &lt;code&gt;user_id&lt;/code&gt;. Bind those IDs to authenticated callers in your backend, then check that unauthorized requests cannot expose another scope’s records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Correct a preference and repeat the task.&lt;/strong&gt; &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/update_memory/" rel="noopener noreferrer"&gt;Update Memory&lt;/a&gt; edits a known record by ID. &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/add_feedback/" rel="noopener noreferrer"&gt;Add Feedback&lt;/a&gt; interprets a natural-language correction and locates the relevant memories to update. Measure propagation against your deadline; historical records can remain available without being treated as current.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Delete a test memory and search again.&lt;/strong&gt; &lt;a href="https://memos-docs.openmem.net/memos_cloud/mem_operations/delete_memory/" rel="noopener noreferrer"&gt;Delete Memory&lt;/a&gt; supports deleting selected memories or a user’s memories within the API key’s project. Agent-wide deletion requires independent Agent memory to be enabled. Query every retrieval route your application uses, and verify completion in the underlying stores covered by your deletion policy, including application copies.&lt;/p&gt;

&lt;p&gt;Start with one user journey and a small labeled task set. Expand the measurements when they help you diagnose a failure or make a release decision.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>opensource</category>
      <category>aimemory</category>
    </item>
    <item>
      <title>With MemOS, your support Agent remembers exactly where you left off.</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Fri, 09 Oct 2026 13:33:34 +0000</pubDate>
      <link>https://dev.to/memos/with-memos-your-support-agent-remembers-exactly-where-you-left-off-3p09</link>
      <guid>https://dev.to/memos/with-memos-your-support-agent-remembers-exactly-where-you-left-off-3p09</guid>
      <description>&lt;p&gt;On September 14, Salesforce published a customer service case study on the U.S. Transportation Security Administration (TSA). TSA's AI Agent, Ace, now handles approximately 100,000 tourist inquiries per month, with roughly 96% resolved without real human agents. For the remaining cases, human agents access the full prior conversation history in a unified workspace before continuing the interaction.&lt;/p&gt;

&lt;p&gt;This pattern shows up constantly in everyday customer support: &lt;strong&gt;When a customer returns, they expect the system to remember what they already said.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Consider a headphone exchange in progress. A user requested a replacement through live chat a few days earlier — provided a shipping address, and specified "just text me updates." Today, they follow up by email with three words: &lt;em&gt;"Did it ship?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Answering this requires retrieving the correct order and support ticket, then checking current status. The previously confirmed address and notification preference also need to carry forward — the user shouldn't have to restate them.&lt;/p&gt;

&lt;p&gt;This scenario surfaces 3 distinct categories of information: &lt;strong&gt;Facts the user has explicitly provided&lt;/strong&gt;, &lt;strong&gt;reusable operational knowledge from handling similar cases&lt;/strong&gt;, and &lt;strong&gt;policy maintained centrally by the business&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, &lt;em&gt;"this user prefers SMS updates"&lt;/em&gt; is a personal preference, scoped to that individual. &lt;em&gt;"Verify order and policy before processing an exchange"&lt;/em&gt; is a generalizable procedure, applicable across users. These operate at different scopes and require separate handling.&lt;/p&gt;

&lt;p&gt;Using consumer after-sales support as a working example, this post walks through Python code demonstrating how to combine all three information types into a complete customer-service memory system.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: The order, ticketing, logistics, and notification tools referenced in this post are simulated business tools built for demonstration purposes only — MemOS does not ship with these systems built in. Policy text shown here is likewise illustrative; in a production integration, replace it with the business's actual systems and official policy documentation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Starting with a headphone exchange: 3 scenarios below
&lt;/h2&gt;

&lt;p&gt;We'll begin with a single headphone exchange request. &lt;strong&gt;The demo runs in 3 phases&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAY 1 · Live Chat&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;customer_001 submits a headphone exchange request. The support Agent looks up the order, checks policy, creates a ticket, and records the delivery time, shipping address, and SMS notification preference.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAY 4 · Email Ticket&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;customer_001 follows up on the exchange status using a new conversation_id. This step verifies whether user facts and preferences persist across sessions.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAY 7 · Live Chat&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;customer_002 runs into a similar static-noise issue with their headphones. The support Agent tries to reuse the Skill formed earlier, verifying that user data stays isolated while general Skills can still be reused across users.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What we're really testing isn't whether the Agent can store chat history. It's 2 things: &lt;br&gt;
&lt;em&gt;"Can it pick up where it left off with the user it should remember"&lt;/em&gt;, and &lt;em&gt;"Can experience it has already formed be handed to the next user and reused?"&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Start by separating the three types of information
&lt;/h3&gt;

&lt;p&gt;A single after-sales task typically leaves behind 3 completely different kinds of information.&lt;/p&gt;

&lt;p&gt;Take DAY 1, when the user submits a headphone exchange request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"What the order number is?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"What's wrong with the headphones?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Whether a ticket has been created?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"What the shipping address is?"&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;"Which channel the user wants progress updates on?"&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;These information answers: "What has already happened with this user?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Meanwhile, as the support Agent handles the request, it may also form a reusable workflow:&lt;br&gt;
&lt;code&gt;Look up order → Verify policy → Create ticket → Update fulfillment info → Notify via the user's confirmed channel&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This information answers: &lt;em&gt;"How is this kind of issue usually handled?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A third type comes from the business itself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are the return and exchange conditions?&lt;/li&gt;
&lt;li&gt;How long does the warranty last?&lt;/li&gt;
&lt;li&gt;Under what circumstances is an exchange allowed?&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;These information answers: &lt;em&gt;“What rules apply to this case?”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So this solution works with three types of context:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;INFORMATION TYPE&lt;/th&gt;
&lt;th&gt;WHAT IT STORES&lt;/th&gt;
&lt;th&gt;WHAT IT SOLVES&lt;/th&gt;
&lt;th&gt;OWNERSHIP&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;User Memory&lt;/td&gt;
&lt;td&gt;Stores orders, defects, ticket status, shipping address, and notification preferences.&lt;/td&gt;
&lt;td&gt;Answers "where is this customer in the process?"&lt;/td&gt;
&lt;td&gt;Belongs only to the current user_id.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent Skill&lt;/td&gt;
&lt;td&gt;Stores general workflows that the support Agent distills from complete task tracks.&lt;/td&gt;
&lt;td&gt;Answers “what steps does this kind of task usually require?”&lt;/td&gt;
&lt;td&gt;Belongs to a stable agent_id.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Policy Knowledge Base&lt;/td&gt;
&lt;td&gt;Official rules for returns, exchanges, warranty, logistics, invoicing, and more.&lt;/td&gt;
&lt;td&gt;Verify “how this should be handled according to the rules?”&lt;/td&gt;
&lt;td&gt;Maintained centrally by the business.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When the boundaries between these three blur together, two typical failures follow:&lt;/p&gt;

&lt;p&gt;User A's address gets exposed to User B, or one user's one-off request gets mistaken for a general workflow that applies to everyone.&lt;/p&gt;

&lt;p&gt;So what matters isn't &lt;strong&gt;storing every historical message&lt;/strong&gt;. It's &lt;strong&gt;putting each piece of information in the right place.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution overview
&lt;/h2&gt;

&lt;p&gt;The approach comes down to &lt;strong&gt;two writes&lt;/strong&gt;, &lt;strong&gt;one combined recall&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After each task, the same task record is written twice: once to user memory and once to Agent Skill, with &lt;code&gt;allow_memory_view&lt;/code&gt; specifying a different memory type for each. When the user comes back, a single &lt;code&gt;/search/memory&lt;/code&gt; call retrieves the current user’s memory, Agent Skills, and policy knowledge together. The current session history is still maintained by the support application itself.&lt;/p&gt;

&lt;p&gt;Specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User memory is scoped by &lt;code&gt;user_id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Agent Skill is reused across users via &lt;code&gt;agent_id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The policy knowledge base joins the same search through &lt;code&gt;knowledgebase_ids&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User request
  │
  ├─ Agent reads the current session history from the business application
  │
  ├─ One combined recall: agent_id + knowledgebase_ids
  │   filter selects the current user's memory (related_id) and Agent Skill (SkillMemory)
  │   → user facts, prefs, Skills, policies
  │
  ├─ Merge the context and run business tools: orders, tickets, notifications, etc.
  │
  ├─ LLM generates the final reply based on tool results
  │
  ├─ Write 1: user_id + agent_id → facts, preferences
  │
  └─ Write 2: agent_id → request to generate or update a Skill
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Before the integration
&lt;/h3&gt;

&lt;p&gt;Before getting hands-on, get your API access and project configuration in place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A MemOS API Key, along with access to the policy knowledge base for the project that key belongs to.&lt;/li&gt;
&lt;li&gt;An OpenAI or OpenAI-compatible LLM endpoint.&lt;/li&gt;
&lt;li&gt;"Create independent memory for Agents" enabled for your project in the MemOS Dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;“Create independent memory for Agents” is off by default. Once enabled, you can write and retrieve Agent Skills using &lt;code&gt;agent_id&lt;/code&gt; as an independent entity.&lt;/p&gt;
&lt;h3&gt;
  
  
  Give the Agent the rules first
&lt;/h3&gt;

&lt;p&gt;When a user says "my headphones have static noise", the support Agent can’t rely on user memory alone. It also needs to know which after-sales rules apply.&lt;/p&gt;

&lt;p&gt;So during initialization, start by creating a policy knowledge base, uploading your after-sales policy documents, and waiting for file processing to finish:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_policy_knowledge_base&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Content-Type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;application/json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Token &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_API_KEY&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;# 1. Create Knowledge Base：POST /create/knowledgebase
&lt;/span&gt;    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/create/knowledgebase&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledgebase_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Consumer After-Sales Policy Knowledge Base&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledgebase_description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Consumer Return, Exchange, Warranty, Shipping, and Invoice Policies&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;code&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failed to create the knowledge base：&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;policy_kb_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c1"&gt;# 2. Upload the policy document：POST /add/knowledgebase-file
&lt;/span&gt;    &lt;span class="c1"&gt;# File content must be base64-encoded and passed as a data URL.
&lt;/span&gt;    &lt;span class="n"&gt;encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base64&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;b64encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;POLICY_DOC_MD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/add/knowledgebase-file&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledgebase_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;policy_kb_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;document&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;consumer-after-sale-policy.md&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data:text/markdown;base64,&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;encoded&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;}],&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;code&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failed to upload policy document：&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# 3. Poll file parsing status：POST /get/knowledgebase-file
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Policy document uploaded. Wait for parsing...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/get/knowledgebase-file&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledgebase_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;policy_kb_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;page&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;page_size&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}).&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file_detail_list&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
        &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;completed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;available&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;statuses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Policy document parsing failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Policy knowledge base is ready&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="err"&gt;：&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;policy_kb_id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;)
    return policy_kb_id
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The knowledge base ID comes directly from the create endpoint's response, then be passed to the support assistant:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;policy_kb_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_policy_knowledge_base&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;assistant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CustomerServiceAssistant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;policy_kb_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;policy_kb_id&lt;/code&gt; returned by the create endpoint is passed to the support Agent, and joins recall through &lt;code&gt;knowledgebase_ids&lt;/code&gt;  later.&lt;/p&gt;

&lt;p&gt;Here's a easy-to-miss detail: &lt;em&gt;a successful upload doesn’t mean the document is searchable yet.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The file may still be in a parsing state, so the demo waits for file processing to finish before moving on to the next steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  One single task, distills two kinds of memory: User Memory and Agent Skill
&lt;/h3&gt;

&lt;p&gt;A complete support task contains both the information the user provided and the process the Agent actually carried out.&lt;/p&gt;

&lt;p&gt;So when writing back to MemOS, don't submit only the user's question and the final answer. Instead, assemble the user request, tool calls, tool results, and final reply into one &lt;strong&gt;complete task record&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user
→ assistant.tool_calls
→ tool
→ assistant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;role_id&lt;/code&gt; to identify who actually spoke:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User messages use &lt;code&gt;user_id&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Support replies and tool calls use &lt;code&gt;agent_id&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Using the DAY 1 exchange request as an example: the full message list written back to MemOS for one conversation turn
&lt;/span&gt;&lt;span class="n"&gt;memory_messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;# 1. User message: role_id is the current user
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# e.g. customer_001
&lt;/span&gt;        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The left ear of my noise-canceling headphones has a crackling sound. I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;d like to exchange them.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# 2. Tool call: the support Agent looks up the order, role_id is agent_id
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;assistant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_calls&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;call_1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;function&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;function&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;query_order&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arguments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;order_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;20260820-88&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;}],&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# 3. Tool result: matched to the call above via tool_call_id, no role_id needed
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool_call_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;call_1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;order_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;20260820-88&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;delivered&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# 4. Final reply: also attributed to the support Agent
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;assistant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ve created exchange ticket EX20260821-03 for you. Shipping is free both ways for exchanges...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full track is used for Skill distillation, while user facts and preferences are generated from the same record.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separating Write Types
&lt;/h3&gt;

&lt;p&gt;User writes and Agent writes use different views, while recall shares a single view configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;USER_WRITE_VIEWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;detail_factual&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;preference&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;AGENT_SKILL_WRITE_VIEWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;skill&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;CONTEXT_VIEWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;detail_factual&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;preference&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;skill&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, the same task record can be written to two memory spaces without producing duplicate memories of the same type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Write user facts and preferences
&lt;/h3&gt;

&lt;p&gt;The first &lt;code&gt;/add/message&lt;/code&gt; call passes in both &lt;code&gt;user_id&lt;/code&gt; and &lt;code&gt;agent_id&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_user_memories&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;First write: generates facts and preferences from the user&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s perspective only.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;user_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;conversation_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;info&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;channel&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scene&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;consumer_support&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;allow_memory_view&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;USER_WRITE_VIEWS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;# POST /add/message: the write runs as an async task; once it returns a task_id,
&lt;/span&gt;    &lt;span class="c1"&gt;# poll /get/status until completed (full implementation in the Demo at the end)
&lt;/span&gt;    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/add/message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;user_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;code&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;  [MemOS] Failed to write user facts and preferences：&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Memory is owned by the current &lt;code&gt;user_id&lt;/code&gt; and also attached to the support Agent‘s memory space, so it can later be precisely selected via &lt;code&gt;related_id&lt;/code&gt; during the Agent-level combined recall.&lt;/p&gt;

&lt;p&gt;MemOS decides from the conversation content whether a fact or preference has formed. If a given turn doesn’t express a stable preference, it can generate facts only.&lt;/p&gt;

&lt;h3&gt;
  
  
  Re-write Agent Skill
&lt;/h3&gt;

&lt;p&gt;The second &lt;code&gt;/add/message&lt;/code&gt; call passes &lt;code&gt;agent_id&lt;/code&gt; and allows Skill generating:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add_agent_skill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Second write: request skill generation or update from the Agent&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s perspective only.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;skill_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;conversation_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;conversation_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;info&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;channel&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scene&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;consumer_support&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;allow_memory_view&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_SKILL_WRITE_VIEWS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;custom_extract_prompt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;skill&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;SKILL_EXTRACT_PROMPT&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;# Still a POST to /add/message, but without user_id, and allow_memory_view contains only skill
&lt;/span&gt;    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/add/message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;skill_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;code&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;  [MemOS] Failed to write Agent Skill: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Skill writes are not bound to any user and exist only from the Agent's perspective, so they can be reused across users. This write runs after every turn.&lt;/p&gt;

&lt;p&gt;The caller doesn't need to decide up front whether "this turn actually produced a Skill worth capturing." Every task can be submitted to MemOS, which weighs the task trajectory against existing Skills and decides on its own whether to generate, update, or skip.&lt;/p&gt;

&lt;h3&gt;
  
  
  Turning one exchange case into a general skill
&lt;/h3&gt;

&lt;p&gt;A Skill is meant to capture a way of handling a task that can be reused next time.&lt;/p&gt;

&lt;p&gt;You can further constrain what gets extracted as a Skill through &lt;code&gt;custom_extract_prompt.skill&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decide whether tasks belong to the same Skill based on business goal, trigger conditions, core toolchain, and success criteria;&lt;/li&gt;
&lt;li&gt;For identical workflows, prefer merging into an existing Skill, and don’t generate a duplicate when there’s no new general information;&lt;/li&gt;
&lt;li&gt;Remove names, addresses, user IDs, order numbers, ticket numbers, and specific dates;&lt;/li&gt;
&lt;li&gt;Replace instance values with parameters such as &lt;code&gt;order_id&lt;/code&gt;, &lt;code&gt;ticket_id&lt;/code&gt;, and &lt;code&gt;shipping_address&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Don’t turn a user’s personal preferences or one-off timing requests into general rules;&lt;/li&gt;
&lt;li&gt;Keep only the execution steps that tool results can verify.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A user asks to “send exchange progress updates by SMS.”&lt;br&gt;
 That is a user preference.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whereas:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Send progress updates through the notification channel the user confirmed.”&lt;br&gt;
 is much closer to a general workflow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This way, even if the next user would rather receive notifications by email, the Skill can still be reused.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuing the same case across sessions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;By DAY 4, the user switches to email to follow up on the exchange progress.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This time, the customer service Agent needs three types of information at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Facts and preferences the current user left behind earlier;&lt;/li&gt;
&lt;li&gt;General Skills the current customer service Agent has already captured;&lt;/li&gt;
&lt;li&gt;The after-sales policy currently in effect.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So before generating a reply, the customer service assistant calls &lt;code&gt;/search/memory&lt;/code&gt; just once, retrieving all of these in a single request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;search_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;One combined recall: user facts/preferences + Agent Skill + policy knowledge.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;context_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;query&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;agent_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AGENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;knowledgebase_ids&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;knowledgebase_ids&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;include_memory_view&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;CONTEXT_VIEWS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory_limit_number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;preference_limit_number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;filter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;or&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;related_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt;
                    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory_type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SkillMemory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
                &lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;# POST /search/memory：User facts, preferences, Agent Skill and policy one-time retrieval
&lt;/span&gt;        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;MEMOS_BASE_URL&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/search/memory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;context_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory_detail_list&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]),&lt;/span&gt;   &lt;span class="c1"&gt;# User Facts
&lt;/span&gt;        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;preference_detail_list&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]),&lt;/span&gt;  &lt;span class="c1"&gt;# User Preferences
&lt;/span&gt;        &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;skill_detail_list&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]),&lt;/span&gt;    &lt;span class="c1"&gt;# Agent Skill
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;filter&lt;/code&gt; here joins two conditions with &lt;code&gt;or&lt;/code&gt;: they are alternatives, and both don't need to be satisfied at the same time. &lt;code&gt;related_id&lt;/code&gt; selects the current user's memories, keeping facts and preferences isolated between users. &lt;code&gt;memory_type: "SkillMemory"&lt;/code&gt; lets Agent Skills be returned across users, unrestricted by who the user is. The policy knowledge base joins the same retrieval through &lt;code&gt;knowledgebase_ids&lt;/code&gt;, so no separate call is needed.&lt;/p&gt;

&lt;p&gt;Each of the 3 types of information solves its own problem in this retrieval:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User memory answers &lt;em&gt;"How far had this customer’s case progressed?"&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Agent Skills answer &lt;em&gt;"How is this type of task usually handled?"&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;The policy knowledge base answers &lt;em&gt;"What are the current business rules?"&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's one more thing: memory is not real-time business state.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For example, if user memory records that “the exchange ticket has been created,” that only shows how far things had gotten earlier. If the user now asks “Has it shipped yet?”, the customer service Agent still needs to query the logistics or ticketing system for the latest status, then generate a reply based on that result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  New session, new user, and re-verifying the memory
&lt;/h2&gt;

&lt;p&gt;Once the integration is in place, you can check the whole pipeline in 3 phases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAY 1: Check the first task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After the exchange task completes, confirm that user facts and preferences are written to the User Cube, and that the same task record is submitted to the Agent Cube for Skill evaluation. If a Skill is generated, also check whether it retains any user-specific information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DAY 4: Switch to email&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use a new &lt;code&gt;conversation_id&lt;/code&gt; and confirm that &lt;code&gt;customer_001&lt;/code&gt; can still recall the earlier order, defect, and notification requirements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What this verifies: can user facts and preferences persist across sessions?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;DAY 7: Switch to a different user&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Switch to &lt;code&gt;customer_002&lt;/code&gt; and raise a similar headphone issue.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This verifies two things at once: whether the first user’s personal information stays isolated, and whether the current Agent can reuse the general Skill it has already formed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are the two most important checkpoints for the whole solution: remember who should be remembered, and reuse what should be reused.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;MemOS Official Website&lt;/strong&gt;: &lt;a href="//memos.openmem.net"&gt;memos.openmem.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="//github.com/MemTensor/MemOS"&gt;github.com/MemTensor/MemOS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MemOS Docs&lt;/strong&gt;: &lt;a href="//memos-docs.openmem.net"&gt;memos-docs.openmem.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Demo&lt;/strong&gt;: &lt;a href="//memos-docs.openmem.net/cn/usecase/customer_service_assistant/"&gt;memos-docs.openmem.net/cn/usecase/customer_service_assistant/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>aimemory</category>
      <category>agentmemory</category>
    </item>
    <item>
      <title>How to Keep Bad Assumptions Out of Agent Memory</title>
      <dc:creator>MemTensor</dc:creator>
      <pubDate>Wed, 16 Sep 2026 13:45:13 +0000</pubDate>
      <link>https://dev.to/memos/how-to-keep-bad-assumptions-out-of-agent-memory-mj8</link>
      <guid>https://dev.to/memos/how-to-keep-bad-assumptions-out-of-agent-memory-mj8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Standfirst: Retrieval quality cannot repair a memory that was wrong when written. Production agents need an admission layer that distinguishes user statements, environment facts, model inferences, procedures, and high-impact state before any of them become durable memory. MemTensor's MemOS provides an operating-layer architecture in which those lifecycle controls can be made explicit.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An agent may carry a mistaken assumption from one task into the next. Checking what it learns, keeping the source, and revisiting memories when conditions change can help prevent that mistake from spreading. MemOS gives developers tools to support this work, from processing new information to correcting existing memories.&lt;/p&gt;

&lt;p&gt;When an agent gives a wrong answer, it is natural to inspect what it retrieved. The problem may have started earlier, with a memory built from an incomplete observation or a conclusion that was never checked.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://arxiv.org/html/2609.11060v1" rel="noopener noreferrer"&gt;&lt;em&gt;Grounding Agent Memory: Environment-Probing Curation for Enterprise Agents&lt;/em&gt;&lt;/a&gt;, Microsoft researchers gave a memory curator read-only access to the environment after a task ended. It could check uncertain claims and revise or skip records before later tasks used them.&lt;/p&gt;

&lt;p&gt;In the paper’s 40-question CLBench experiment with schema changes, using GPT-5.4 in a GitHub Copilot SDK harness, the system with memory and environment probing reached a mean pass rate of 73%. The system with memory alone reached 70%, while the no-memory baseline reached 39%. Adding probing to the memory system also reduced average queries per question from 5.6 to 4.7 and task-agent cost from $1.99 to $1.68. These costs exclude the separate distillation and curation stages.&lt;/p&gt;

&lt;p&gt;Those results describe the researchers’ setup. They raise a practical question for developers building with memory: what should an agent check before passing something it has learned to the next task?&lt;/p&gt;

&lt;h2&gt;
  
  
  A useful observation can become a misleading rule
&lt;/h2&gt;

&lt;p&gt;Consider a database agent that finds the records it needs in a table called &lt;code&gt;customers_current&lt;/code&gt;. It finishes the task and saves a note saying, “Use &lt;code&gt;customers_current&lt;/code&gt; for active accounts.”&lt;/p&gt;

&lt;p&gt;The query may have worked for one region or reporting period. The saved note leaves those conditions out, so another agent could apply it to a much broader question. Checking the table definition and the relevant business rules would help establish where the advice holds.&lt;/p&gt;

&lt;p&gt;Even a carefully checked note can become outdated. A month later, the table might be replaced by a compatibility view that updates less frequently. Future agents need a way to recognize that change and update the memory.&lt;/p&gt;

&lt;p&gt;Similar problems arise when an agent keeps recommending an API workaround after a fix, saves a temporary approval process as a permanent procedure, or records a failed command as a successful solution. A policy can lose its effective date during summarization. A rule for one customer can become advice for every customer.&lt;/p&gt;

&lt;p&gt;In each case, the memory is missing something a future task needs: evidence, conditions, or an update. Retrieval can find the note, but the agent still needs enough information to judge whether it applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the claim before making it reusable
&lt;/h2&gt;

&lt;p&gt;A memory workflow often starts with a conversation or task history, extracts useful information, and saves it for later retrieval. A verification step can check the extracted claims before they become reusable advice.&lt;/p&gt;

&lt;p&gt;The original conversation and tool results can still be retained as evidence. The decision is which conclusions to make available to future tasks, and with what limits. Keeping that distinction also allows a team to inspect how a summary was produced if something goes wrong.&lt;/p&gt;

&lt;p&gt;The check should match the information being saved.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Information&lt;/th&gt;
&lt;th&gt;What to check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A user statement or preference&lt;/td&gt;
&lt;td&gt;Keep who said it, when, and the relevant context. “I prefer concise weekly summaries” can be recorded directly and changed when the user updates it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A fact about the environment&lt;/td&gt;
&lt;td&gt;Check the relevant system, such as a schema, repository, API specification, or policy document. Record the version or time observed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An agent’s inference&lt;/td&gt;
&lt;td&gt;Preserve the evidence and identify the conclusion as an inference. “This customer may be price-sensitive” should remain distinguishable from something the customer explicitly said.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A procedure or skill&lt;/td&gt;
&lt;td&gt;Keep its prerequisites and the evidence that it worked. Use a test or acceptance condition appropriate to the procedure.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Sensitivity and impact apply across these categories. A preference about report length needs less review than a remembered procedure that could change access permissions or authorize a payment.&lt;/p&gt;

&lt;p&gt;Read-only checks are often enough to resolve uncertainty. A coding agent can inspect a symbol definition, and a database agent can examine a schema or query a limited sample. Procedures with side effects need a suitable test environment or other evidence of a successful result.&lt;/p&gt;

&lt;h2&gt;
  
  
  How MemOS supports the workflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/MemTensor/MemOS" rel="noopener noreferrer"&gt;MemOS&lt;/a&gt; provides operations for adding, finding, correcting, and removing memories. Developers can use these operations alongside checks against their own business systems. The application chooses the authoritative source and implements the environment checks described above.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the source with the memory
&lt;/h3&gt;

&lt;p&gt;In the open-source service, &lt;a href="https://memos-docs.openmem.net/open_source/modules/mem_reader/" rel="noopener noreferrer"&gt;MemReader&lt;/a&gt; processes conversations, documents, and images into memory items with source information. Developers can use the Add API’s &lt;a href="https://memos-docs.openmem.net/api-reference/add-memories/" rel="noopener noreferrer"&gt;&lt;code&gt;info&lt;/code&gt; metadata&lt;/a&gt; to attach details such as the source location and application-supplied validation results.&lt;/p&gt;

&lt;p&gt;For the database example, this could include the schema version, the time it was checked, and the business context in which the table should be used. If a later answer looks wrong, the team has a starting point for investigating it.&lt;/p&gt;

&lt;p&gt;The verification step needs to cover the extracted claim. Checking an input document alone can miss an error introduced when the system turns that document into a shorter memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep preferences and inferences distinguishable
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://memos-docs.openmem.net/api_docs/core/extract_memory/" rel="noopener noreferrer"&gt;MemOS Cloud’s memory extraction API&lt;/a&gt; distinguishes explicit preferences from preferences inferred from behavior and returns the reasoning behind them.&lt;/p&gt;

&lt;p&gt;That distinction helps an application handle “I prefer budget hotels” differently from a guess based on one booking. Developers can decide whether the inferred preference is useful for a recommendation or needs confirmation before affecting a more consequential action.&lt;/p&gt;

&lt;h3&gt;
  
  
  Update memories as information changes
&lt;/h3&gt;

&lt;p&gt;MemOS Cloud supports conflict and duplicate handling as part of &lt;a href="https://memos-docs.openmem.net/changelog/" rel="noopener noreferrer"&gt;memory maintenance&lt;/a&gt;. Its &lt;a href="https://memos-docs.openmem.net/memos_cloud/introduction/time_awareness/" rel="noopener noreferrer"&gt;time-aware memory handling&lt;/a&gt; preserves changing states so retrieval can distinguish a current fact from an earlier one.&lt;/p&gt;

&lt;p&gt;These features help process changes that reach the memory system. In the database example, the application still needs to detect the schema change or provide the new evidence. It can then use feedback to correct the remembered advice, or update or remove the affected entry through the relevant memory operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose where a memory can be used
&lt;/h3&gt;

&lt;p&gt;The open-source service organizes memories in &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;MemCubes&lt;/a&gt;. Requests can specify cubes to read from or write to, allowing an application to keep project memories separate or make selected information available across agents. The application must connect these choices to its authorization rules.&lt;/p&gt;

&lt;p&gt;Session context has a different role. In the open-source &lt;a href="https://memos-docs.openmem.net/api-reference/search-memories/" rel="noopener noreferrer"&gt;Search API&lt;/a&gt;, &lt;code&gt;session_id&lt;/code&gt; helps prioritize relevant memories; it is not a hard boundary between sessions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the result of background work
&lt;/h3&gt;

&lt;p&gt;Memory writes and corrections can run in the background. The open-source service provides &lt;a href="https://memos-docs.openmem.net/open_source/modules/mos/overview/" rel="noopener noreferrer"&gt;scheduling and status operations&lt;/a&gt; to track that work. With MemOS Cloud, the &lt;a href="https://memos-docs.openmem.net/api_docs/message/get_status/" rel="noopener noreferrer"&gt;task-status API&lt;/a&gt; reports processing status and, on completion, the affected memory IDs and a summary of what changed.&lt;/p&gt;

&lt;p&gt;This gives applications a way to follow a submitted operation through to its result. They can inspect the affected memories and check what subsequent searches return.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put the checks into a working flow
&lt;/h2&gt;

&lt;p&gt;Start with one kind of memory whose accuracy matters to the task, such as database guidance or a frequently reused support procedure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Extract the candidate.&lt;/strong&gt; Identify the claim or procedure worth keeping and retain its source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the evidence.&lt;/strong&gt; Inspect the authoritative system and test the conditions the candidate depends on. If the evidence is incomplete, narrow the claim or hold it for review.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save the conditions with it.&lt;/strong&gt; Include where it applies, when it was checked, and what should trigger another check. Make only approved candidates available for reuse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inspect the result.&lt;/strong&gt; After writing or correcting a memory, check the operation’s outcome and the records available to later tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revisit it when its source changes.&lt;/strong&gt; A schema migration, policy revision, or API change should prompt a review of memories that depend on it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For &lt;code&gt;customers_current&lt;/code&gt;, a useful record would include the applicable region and reporting period, the evidence behind the recommendation, and the schema version checked. A migration affecting that table gives the application a concrete reason to review the record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow the memory into the next task
&lt;/h2&gt;

&lt;p&gt;Teams also need to see whether the process is helping. The following questions can guide monitoring across the application and its memory service.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What to inspect&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Candidate review&lt;/td&gt;
&lt;td&gt;Which sources produced candidates, what evidence was checked, and why a candidate was accepted, revised, or rejected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Write&lt;/td&gt;
&lt;td&gt;Which records were added or changed, where they were saved, and whether processing completed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retrieval&lt;/td&gt;
&lt;td&gt;Which memories were returned and which were actually included in the model’s context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use&lt;/td&gt;
&lt;td&gt;Task completion, repeated errors, user corrections, and results compared with a no-memory baseline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maintenance&lt;/td&gt;
&lt;td&gt;Entries affected by changed sources, overdue checks, and corrections that have reached later searches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deletion&lt;/td&gt;
&lt;td&gt;Whether removal completed in the memory store and any application-managed copies or caches&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Linking these records makes failures easier to investigate. A retrieved memory may never have reached the model, and a memory included in the prompt may not explain the action that followed. The trace gives the team evidence to examine; testing is still needed to establish the cause.&lt;/p&gt;

&lt;p&gt;For a first evaluation, save a checked memory, use it in a later task, then change the underlying information. Confirm that the correction appears in subsequent retrieval and that the agent completes the task with the updated information. This exercises the part of memory that matters in ongoing work: carrying useful knowledge forward while keeping it open to correction.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;About MemTensor and MemOS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MemTensor develops memory infrastructure for AI applications and agents. Our work spans &lt;a href="https://memos-docs.openmem.net/usecase/blog/agent_memory_is_not_rag/" rel="noopener noreferrer"&gt;Memory³ research, MemOS, agent-memory infrastructure, and research into models with native memory&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;MemOS brings this work into applications through APIs, open-source components, and integrations for storing, retrieving, and maintaining information across tasks.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>opensource</category>
      <category>aimemory</category>
    </item>
  </channel>
</rss>
