<?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: Ana Julia Bittencourt </title>
    <description>The latest articles on DEV Community by Ana Julia Bittencourt  (@anajuliabit).</description>
    <link>https://dev.to/anajuliabit</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F276882%2F0f651300-37a6-444a-aeb2-7b33067c24b9.png</url>
      <title>DEV Community: Ana Julia Bittencourt </title>
      <link>https://dev.to/anajuliabit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anajuliabit"/>
    <language>en</language>
    <item>
      <title>MCP + MemoClaw — giving your Model Context Protocol tools persistent memory</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Wed, 25 Mar 2026 12:15:03 +0000</pubDate>
      <link>https://dev.to/anajuliabit/mcp-memoclaw-giving-your-model-context-protocol-tools-persistent-memory-3p0d</link>
      <guid>https://dev.to/anajuliabit/mcp-memoclaw-giving-your-model-context-protocol-tools-persistent-memory-3p0d</guid>
      <description>&lt;p&gt;Your AI agent forgets everything between sessions. You know this. You've probably hacked around it with MEMORY.md files, context-stuffing, or just re-explaining things every time you open a new chat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://memoclaw.com" rel="noopener noreferrer"&gt;MemoClaw&lt;/a&gt; fixes this with semantic memory-as-a-service. But here's what most people miss: you don't need to write a single line of integration code. The &lt;code&gt;memoclaw-mcp&lt;/code&gt; server exposes store, recall, and list as native MCP tools — which means any MCP-compatible client can use MemoClaw out of the box.&lt;/p&gt;

&lt;p&gt;Claude Desktop, Cursor, Windsurf, OpenClaw — if it speaks MCP, it gets persistent memory in under five minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Build
&lt;/h2&gt;

&lt;p&gt;By the end of this tutorial, your MCP client will be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Store memories&lt;/strong&gt; with importance scores and tags&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall memories&lt;/strong&gt; using semantic search (not just keyword matching)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;List and manage&lt;/strong&gt; stored memories across sessions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolate context&lt;/strong&gt; per project using namespaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No REST calls. No SDK imports. Just tool use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18+&lt;/li&gt;
&lt;li&gt;An Ethereum wallet (MetaMask, Rainbow, etc.) — this is your identity, no registration needed&lt;/li&gt;
&lt;li&gt;An MCP-compatible client (we'll use OpenClaw as the primary example)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Install memoclaw-mcp
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; memoclaw-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the entire installation. One package, globally available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configure Your MCP Client
&lt;/h2&gt;

&lt;p&gt;Every MCP client has a configuration file where you declare available servers. Here's what the MemoClaw block looks like:&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenClaw
&lt;/h3&gt;

&lt;p&gt;Add to your OpenClaw MCP config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"memoclaw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"MEMOCLAW_PRIVATE_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-wallet-private-key"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Claude Desktop
&lt;/h3&gt;

&lt;p&gt;Add to &lt;code&gt;claude_desktop_config.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"memoclaw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"MEMOCLAW_PRIVATE_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"your-wallet-private-key"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cursor / Windsurf
&lt;/h3&gt;

&lt;p&gt;Same pattern — find your MCP server config and add the block above.&lt;/p&gt;

&lt;p&gt;That's it. One environment variable (your wallet private key), one command. No API keys to generate, no accounts to create, no OAuth flows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Use It
&lt;/h2&gt;

&lt;p&gt;Once configured, your agent sees three new tools: &lt;code&gt;store_memory&lt;/code&gt;, &lt;code&gt;recall_memories&lt;/code&gt;, and &lt;code&gt;list_memories&lt;/code&gt;. Here's what natural usage looks like in an OpenClaw session:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "Remember that I prefer TypeScript over JavaScript for all new projects."&lt;/p&gt;

&lt;p&gt;Your agent calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User prefers TypeScript over JavaScript for all new projects&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;importance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;preference&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;language&lt;/span&gt;&lt;span class="dl"&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;&lt;strong&gt;Next session — days later:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; "Set up a new project for me."&lt;/p&gt;

&lt;p&gt;Your agent calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;recall_memories&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user project preferences programming language&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And gets back your TypeScript preference, ranked by semantic relevance. No re-explaining. No context file to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Namespace Isolation: One Server, Many Projects
&lt;/h2&gt;

&lt;p&gt;Working on multiple projects? Namespaces keep memories separate without running multiple MCP servers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Client wants dark mode as default theme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;project-acme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;client-preference&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ui&lt;/span&gt;&lt;span class="dl"&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;store_memory&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;API rate limit set to 100 req/min for free tier&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;project-saas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;architecture&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;limits&lt;/span&gt;&lt;span class="dl"&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;When you recall within a namespace, you only get memories from that project. Switch projects, switch namespaces — same wallet, clean separation.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP vs. Manual Integration: What You're Skipping
&lt;/h2&gt;

&lt;p&gt;Here's the alternative without MCP — a manual REST integration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MemoClaw&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;memoclaw-sdk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MemoClaw&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PRIVATE_KEY&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Store&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;store&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;User prefers TypeScript&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;importance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;preference&lt;/span&gt;&lt;span class="dl"&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;// Recall&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;programming language preferences&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's maybe 10 lines of code. Not terrible. But with MCP, it's zero lines. Your agent just... uses the tools. The MCP server handles authentication, request signing, and API communication. You configure once and forget.&lt;/p&gt;

&lt;p&gt;The real win isn't lines of code — it's that the agent decides when to store and recall on its own. You don't need to build memory logic into your application. The LLM handles it naturally through tool use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Costs
&lt;/h2&gt;

&lt;p&gt;MemoClaw gives you &lt;strong&gt;100 free API calls&lt;/strong&gt; per wallet. No credit card, no payment setup — just start using it.&lt;/p&gt;

&lt;p&gt;After the free tier, each store or recall costs &lt;strong&gt;$0.005&lt;/strong&gt; (half a cent) paid via x402 with USDC on Base. Fund your wallet, and payments happen automatically per request. No subscriptions, no monthly bills, no surprises.&lt;/p&gt;

&lt;p&gt;For most personal agents, 100 free calls covers weeks of casual use. A heavy session might use 10-20 calls. You'll know when you're getting close.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works Alongside Other Tools
&lt;/h2&gt;

&lt;p&gt;memoclaw-mcp plays nicely with other MCP servers. Your agent might have tools for file access, web search, calendar, and memory all running simultaneously. The LLM sees all available tools and picks the right one for the job.&lt;/p&gt;

&lt;p&gt;A typical agent setup might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"memoclaw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"MEMOCLAW_PRIVATE_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"filesystem"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mcp-filesystem"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/home/user/projects"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"web-search"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mcp-web-search"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No conflicts. Each server has its own tool namespace. MemoClaw handles memory; everything else does its thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Reference: Available MCP Tools
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;store_memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save a memory with optional importance (0-1), tags, and namespace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;recall_memories&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Semantic search across stored memories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;list_memories&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Browse all memories, optionally filtered by namespace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;delete_memory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove a specific memory by ID&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Common Patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Preference tracking:&lt;/strong&gt; Store user preferences with high importance (0.8+) and a &lt;code&gt;preference&lt;/code&gt; tag. Recall before making decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Session summaries:&lt;/strong&gt; At the end of a work session, store a summary of what was accomplished. Next session, recall recent summaries for continuity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Correction memory:&lt;/strong&gt; When a user corrects your agent, store the correction with importance 1.0. These should always surface in recall.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project context:&lt;/strong&gt; Use namespaces per project. Store architecture decisions, client requirements, and technical constraints. Your agent carries full project context without eating its prompt window.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;Once you've got basic memory working, explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Importance scoring strategies&lt;/strong&gt; — not everything deserves a 0.9&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag taxonomies&lt;/strong&gt; — consistent tags make filtered recall powerful&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable memories&lt;/strong&gt; — lock critical context so it can never be overwritten&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch storage&lt;/strong&gt; — store up to 100 memories at once for migrations or bulk imports&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; memoclaw-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the config block. Start a conversation. Tell your agent something worth remembering.&lt;/p&gt;

&lt;p&gt;It'll remember.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;MemoClaw is memory-as-a-service for AI agents. 100 free calls, no registration required. &lt;a href="https://docs.memoclaw.com" rel="noopener noreferrer"&gt;docs.memoclaw.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://blog.memoclaw.com/blog/mcp-memoclaw-persistent-memory" rel="noopener noreferrer"&gt;blog.memoclaw.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>agents</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>From five minutes to production: wiring MemoClaw into your OpenClaw agent without cutting corners</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 12:20:55 +0000</pubDate>
      <link>https://dev.to/anajuliabit/from-five-minutes-to-production-wiring-memoclaw-into-your-openclaw-agent-without-cutting-corners-48dm</link>
      <guid>https://dev.to/anajuliabit/from-five-minutes-to-production-wiring-memoclaw-into-your-openclaw-agent-without-cutting-corners-48dm</guid>
      <description>&lt;h1&gt;
  
  
  From five minutes to production: wiring MemoClaw into your OpenClaw agent without cutting corners
&lt;/h1&gt;

&lt;p&gt;MemoClaw exists so you stop babysitting &lt;code&gt;MEMORY.md&lt;/code&gt; files. The fastest way to turn a curious OpenClaw tinkerer into a paying operator is to show them how to ship a concrete memory workflow in a single sitting. This guide is that workflow: install the MemoClaw skill, store the first memory, define a recall plan, harden it for production, and cover the failure paths nobody mentions in a hello-world demo. Follow it once and you have a repeatable template for every new agent.&lt;/p&gt;

&lt;p&gt;Need a refresher on why flat files fail? Read &lt;a href="https://blog.memoclaw.com/case-against-memory-md" rel="noopener noreferrer"&gt;The Case Against MEMORY.md&lt;/a&gt;, then come back here to build a real OpenClaw memory spine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick-reference build checklist
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Install MemoClaw skill + CLI&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Tooling available in OpenClaw and shell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Map namespaces&lt;/td&gt;
&lt;td&gt;Ops lead&lt;/td&gt;
&lt;td&gt;Documented table for &lt;code&gt;core&lt;/code&gt;, &lt;code&gt;customers/&amp;lt;slug&amp;gt;&lt;/code&gt;, &lt;code&gt;ops/&amp;lt;agent&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Embed store/recall templates&lt;/td&gt;
&lt;td&gt;Prompt engineer&lt;/td&gt;
&lt;td&gt;JSON snippets committed in repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Define recall cadence&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Start, pre-output, post-correction hooks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add guardrails + fallback paths&lt;/td&gt;
&lt;td&gt;Reliability&lt;/td&gt;
&lt;td&gt;Empty recall + conflict handling routine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automate hygiene (dedupe, consolidate, stats)&lt;/td&gt;
&lt;td&gt;Ops&lt;/td&gt;
&lt;td&gt;Heartbeat or cron jobs running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Document production checklist&lt;/td&gt;
&lt;td&gt;Team lead&lt;/td&gt;
&lt;td&gt;Shared runbook tied to onboarding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why this workflow prints money for OpenClaw builders
&lt;/h2&gt;

&lt;p&gt;MemoClaw removes admin work, but only if you treat memory as a production dependency. Teams that sprint through installation without namespaces, guardrails, or audits end up paying for storage they never recall. The approach below keeps everything deterministic so finance, ops, and engineering can trust the stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenClaw running on your workstation or server&lt;/li&gt;
&lt;li&gt;Wallet funded with a few cents of USDC on Base (post–free tier usage)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MEMOCLAW_WALLET&lt;/code&gt; and &lt;code&gt;MEMOCLAW_PRIVATE_KEY&lt;/code&gt; exported in your shell&lt;/li&gt;
&lt;li&gt;Optional: &lt;code&gt;gh&lt;/code&gt; CLI for automated audits&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: install MemoClaw the way real agents do
&lt;/h2&gt;

&lt;p&gt;MemoClaw ships as both a CLI and an OpenClaw skill. For operators, the skill is the fastest path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openclaw skills &lt;span class="nb"&gt;install &lt;/span&gt;anajuliabit/memoclaw &lt;span class="nt"&gt;--force&lt;/span&gt;
openclaw skills list | &lt;span class="nb"&gt;grep &lt;/span&gt;memoclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need CLI access for migrations or backups? Install it globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; memoclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MemoClaw uses wallet-based identity—no API keys. Confirm the wallet currently set in OpenClaw before you rely on the skill:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$MEMOCLAW_WALLET&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Wallet missing"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Export the wallet and private key if needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MEMOCLAW_WALLET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0xYourWallet
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MEMOCLAW_PRIVATE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: define namespaces before you store anything
&lt;/h2&gt;

&lt;p&gt;Skipping namespaces is the fastest way to leak context between projects. Align on a structure inspired by &lt;a href="https://blog.memoclaw.com/namespace-strategies-for-openclaw-agents" rel="noopener noreferrer"&gt;Namespace Strategies for OpenClaw Agents&lt;/a&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Namespace&lt;/th&gt;
&lt;th&gt;Use case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Immutable policies (security, billing, voice)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;customers/&amp;lt;slug&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Client-specific context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ops/&amp;lt;agent-name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Operational agents (heartbeats, inbox monitors)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;experiments/&amp;lt;codename&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short-lived sandboxes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;MemoClaw creates namespaces lazily when you store the first memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; core &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.9 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; onboarding,defaults &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Ally must never publish drafts directly. Stop at draft handoff."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: wire store/recall directly into your agent loop
&lt;/h2&gt;

&lt;p&gt;MemoClaw calls are simple JSON tool invocations—keep them nearby so every agent uses the same plumbing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store template&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_store"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/lumen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"preferences"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"product"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Lumen prefers Telegram summaries under 200 words."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Recall template&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_recall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/lumen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What should I remember before writing Lumen's weekly report?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit these snippets to your agent repo so every new teammate copies the same version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: design the recall strategy like it's a production dependency
&lt;/h2&gt;

&lt;p&gt;Turn the recall plan into a scannable routine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When&lt;/strong&gt;: run recall at session start, before user-facing output, and right after a correction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How many&lt;/strong&gt;: default to five memories; bump to ten only if you store session summaries or research chunks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt merge&lt;/strong&gt;: paste recall results under a fixed template such as:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### Retrieved memories&lt;/span&gt;
&lt;span class="p"&gt;1.&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;memory&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;2.&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;memory&amp;gt;&lt;/span&gt;

&lt;span class="gu"&gt;### Task&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;instruction&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fallback&lt;/strong&gt;: if recall fails, inject a deterministic checklist ("No stored context. Use the public positioning doc.").&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: handle empty recalls and stale context
&lt;/h2&gt;

&lt;p&gt;Short reminders beat long paragraphs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Empty recall&lt;/strong&gt; → Run a fallback snippet so the agent never improvises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stale data&lt;/strong&gt; → Store timestamps plus a &lt;code&gt;metadata&lt;/code&gt; field like &lt;code&gt;"expires_at": "2026-05-01"&lt;/code&gt;; ignore expired entries in code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflicting facts&lt;/strong&gt; → Lean on &lt;code&gt;importance&lt;/code&gt;. Corrections get 0.95, offhand comments 0.2, so crucial items always sort to the top.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 6: automations that keep the memory layer honest
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recall-before-store guardrail&lt;/strong&gt;: recall with the new content as a query and skip the store if similarity &amp;gt; 0.92.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekly consolidation&lt;/strong&gt;: call &lt;code&gt;memoclaw consolidate --namespace customers/lumen&lt;/code&gt; to merge redundant entries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats-driven audits&lt;/strong&gt;: run &lt;code&gt;memoclaw stats&lt;/code&gt; and &lt;code&gt;memoclaw list --limit 10&lt;/code&gt; inside a heartbeat. Alert if counts spike or drop unexpectedly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session summaries&lt;/strong&gt;: add a heartbeat that ships summaries hourly; borrow prompts from &lt;a href="https://blog.memoclaw.com/automating-session-summaries-cron-consolidation" rel="noopener noreferrer"&gt;Automating Session Summaries&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: production checklist
&lt;/h2&gt;

&lt;p&gt;Before you declare an agent "live," verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Wallet env vars set in &lt;code&gt;.env&lt;/code&gt; and active tmux sessions&lt;/li&gt;
&lt;li&gt;[ ] Namespaces documented and version-controlled&lt;/li&gt;
&lt;li&gt;[ ] Store + recall templates committed to the repo&lt;/li&gt;
&lt;li&gt;[ ] Guardrails implemented (empty results, expiration, duplicates)&lt;/li&gt;
&lt;li&gt;[ ] Hygiene jobs scheduled (consolidate, stats audit)&lt;/li&gt;
&lt;li&gt;[ ] Immutable memories created for non-negotiables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 8: integrate with other systems without diluting memory quality
&lt;/h2&gt;

&lt;p&gt;MemoClaw plays well with the rest of your stack as long as roles stay clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docs or Notion&lt;/strong&gt;: export via &lt;code&gt;memoclaw export --namespace ...&lt;/code&gt; and send the JSON to leadership.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics dashboards&lt;/strong&gt;: push stats output to Grafana or Metabase so outages show up next to API metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incident response&lt;/strong&gt;: run &lt;code&gt;memoclaw history mem_123&lt;/code&gt; to trace how a memory evolved before filing a root-cause report.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 9: cost planning so finance never blocks you
&lt;/h2&gt;

&lt;p&gt;MemoClaw charges only when embeddings or GPT are involved. For a typical ops agent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Calls/day&lt;/th&gt;
&lt;th&gt;Cost per call&lt;/th&gt;
&lt;th&gt;Daily total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Store (single)&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;$0.15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;$0.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consolidate&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Daily cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.36&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Batch storage is your best lever when ingesting historical data: 100 memories for $0.04 vs $0.50 individually. For deeper math and wallet planning, revisit &lt;a href="https://blog.memoclaw.com/cost-optimization-free-tier" rel="noopener noreferrer"&gt;Cost Optimization: Free Tier&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: failure drills
&lt;/h2&gt;

&lt;p&gt;Run chaos drills monthly so the team trusts the memory layer under load.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Expired credentials&lt;/strong&gt;: unset &lt;code&gt;$MEMOCLAW_PRIVATE_KEY&lt;/code&gt; and confirm the agent fails loudly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespace pollution&lt;/strong&gt;: intentionally store a wrong memory, run your dedupe routine, and ensure it catches the anomaly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free-tier exhaustion&lt;/strong&gt;: point &lt;code&gt;MEMOCLAW_URL&lt;/code&gt; to a staging proxy that reports &lt;code&gt;remaining=0&lt;/code&gt; so monitoring alerts the team.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example: full OpenClaw tool chain for onboarding a new agent
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Install skill&lt;/span&gt;
openclaw skills &lt;span class="nb"&gt;install &lt;/span&gt;anajuliabit/memoclaw &lt;span class="nt"&gt;--force&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$MEMOCLAW_WALLET&lt;/span&gt;  &lt;span class="c"&gt;# verify&lt;/span&gt;

&lt;span class="c"&gt;# 2. Populate immutable core knowledge&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; core &lt;span class="nt"&gt;--immutable&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Never email customers from dummy domains."&lt;/span&gt;

&lt;span class="c"&gt;# 3. Create namespace per customer&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen &lt;span class="s2"&gt;"Namespace created"&lt;/span&gt; &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.1

&lt;span class="c"&gt;# 4. Seed intro memories&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.8 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Weekly report due Mondays 14:00 UTC"&lt;/span&gt;

&lt;span class="c"&gt;# 5. Configure agent prompts&lt;/span&gt;
Update system prompt with: &lt;span class="s1"&gt;'Always recall from customers/&amp;lt;slug&amp;gt; before user-facing output.'&lt;/span&gt;

&lt;span class="c"&gt;# 6. Test recall guardrails&lt;/span&gt;
memoclaw_recall &lt;span class="nv"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;customers/lumen &lt;span class="nv"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt; &lt;span class="nv"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5
Confirm fallback path when zero results returned.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Troubleshooting cheatsheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Store calls failing with 401&lt;/td&gt;
&lt;td&gt;Wallet env vars missing&lt;/td&gt;
&lt;td&gt;Re-export &lt;code&gt;$MEMOCLAW_WALLET&lt;/code&gt; + &lt;code&gt;$MEMOCLAW_PRIVATE_KEY&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall returns irrelevant memories&lt;/td&gt;
&lt;td&gt;Flat importance scores, no namespaces&lt;/td&gt;
&lt;td&gt;Re-score critical items, enforce namespace mapping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Duplicate memories everywhere&lt;/td&gt;
&lt;td&gt;Dedupe routine missing&lt;/td&gt;
&lt;td&gt;Run recall-before-store guardrail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent forgets cross-session facts&lt;/td&gt;
&lt;td&gt;Heartbeat not storing summaries&lt;/td&gt;
&lt;td&gt;Add end-of-session summary store call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Costs spike unexpectedly&lt;/td&gt;
&lt;td&gt;Batch store not used&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;memoclaw store-batch&lt;/code&gt; for &amp;gt;20 entries&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Instrumentation: prove the memory layer is doing its job
&lt;/h2&gt;

&lt;p&gt;Once the workflow is live, add telemetry so you can debug issues in minutes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Emit metrics per call type&lt;/strong&gt;: wrap each tool call in a shim that records &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;operation&lt;/code&gt;, &lt;code&gt;latency_ms&lt;/code&gt;, and &lt;code&gt;result_count&lt;/code&gt;. Ship it to whatever metrics stack you already run (Grafana, Datadog, Prometheus).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log retrieved memories alongside outputs&lt;/strong&gt;: when your agent sends a final response, log the recall payload it used. Redact sensitive data but keep enough text to trace bad decisions back to specific memories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alert on hygiene failures&lt;/strong&gt;: monitor duplicate skip counts and expired-memory usage. Spikes flag teams that forgot to refresh SLAs or pricing tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Session summary automation in practice
&lt;/h2&gt;

&lt;p&gt;End-of-session summaries glue short-lived prompts to multi-week missions. Build a heartbeat that runs every hour (or on agent shutdown) and ships a new memory. Use the heartbeat prompt patterns from &lt;a href="https://blog.memoclaw.com/session-summaries-perfect-recall" rel="noopener noreferrer"&gt;Session Summaries with MemoClaw&lt;/a&gt; plus the automation tips above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openclaw heartbeat run &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
SUMMARY=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 200 logs/support-agent.log | ./scripts/summarize.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;
memoclaw store &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --namespace ops/support-agent &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --importance 0.7 &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --tags session,summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  "&lt;/span&gt;&lt;span class="nv"&gt;$SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;"
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep summaries under 1,000 characters and rotate the &lt;code&gt;importance&lt;/code&gt; score based on novelty. A routine "no changes" summary should sit near 0.3, while a production incident deserves 0.95.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bridging test and production environments
&lt;/h2&gt;

&lt;p&gt;Most teams run OpenClaw sandboxes for QA. Use separate namespaces per environment (&lt;code&gt;customers/lumen-dev&lt;/code&gt; vs &lt;code&gt;customers/lumen&lt;/code&gt;). Before promoting an agent, export the dev namespace, review it, then re-store curated entries into prod using batch store.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen-dev &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; lumen-dev.json
jq &lt;span class="s1"&gt;'.memories | map({namespace: "customers/lumen", content, importance, tags})'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  lumen-dev.json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; lumen-prod.json
memoclaw store-batch lumen-prod.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checklist for onboarding new operators
&lt;/h2&gt;

&lt;p&gt;When another builder joins the team, hand them this list:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read this guide plus &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; to understand tone guardrails.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;memoclaw stats&lt;/code&gt; on every namespace they own; paste the output in the weekly ops doc.&lt;/li&gt;
&lt;li&gt;Trigger manual recalls to internalize what "good" looks like.&lt;/li&gt;
&lt;li&gt;Review immutable memories so they know the non-negotiables.&lt;/li&gt;
&lt;li&gt;Practice restoring from export by spinning up a scratch namespace, importing the latest backup, and verifying the agent can recall from it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Deploy this pattern with confidence
&lt;/h2&gt;

&lt;p&gt;Five minutes gets you "it runs." Production-readiness takes the extra hour to plan namespaces, guardrails, hygiene, monitoring, and onboarding. MemoClaw already handles embeddings, storage, and semantic search; your job is to wire it into OpenClaw with discipline. Follow the checklist here, lean on the internal guides linked above, and every new agent inherits the same reliable OpenClaw memory workflow.&lt;/p&gt;

</description>
      <category>openclaw</category>
      <category>memoclaw</category>
      <category>workflow</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Session summaries as strategic memory: keeping long-running OpenClaw agents sane</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 12:20:43 +0000</pubDate>
      <link>https://dev.to/anajuliabit/session-summaries-as-strategic-memory-keeping-long-running-openclaw-agents-sane-1df0</link>
      <guid>https://dev.to/anajuliabit/session-summaries-as-strategic-memory-keeping-long-running-openclaw-agents-sane-1df0</guid>
      <description>&lt;h1&gt;
  
  
  Session summaries as strategic memory: keeping long-running OpenClaw agents sane
&lt;/h1&gt;

&lt;p&gt;Long-running agents are useless if they wake up every morning with amnesia. Operators already know context windows implode after a few hours, yet many still lean on brittle &lt;code&gt;MEMORY.md&lt;/code&gt; logs. &lt;a href="https://blog.memoclaw.com/case-against-memory-md" rel="noopener noreferrer"&gt;The case against MEMORY.md&lt;/a&gt; explains why flat files collapse; this guide shows the fix: structured MemoClaw session summaries that slot neatly into your OpenClaw workflow.&lt;/p&gt;

&lt;p&gt;If you want a quick refresher on the concept, skim &lt;a href="https://blog.memoclaw.com/session-summaries-perfect-recall" rel="noopener noreferrer"&gt;Session Summaries with MemoClaw&lt;/a&gt;. Below we stretch that core idea into a production system: template design, heartbeat automation, guardrails, monitoring, and the cost math that keeps finance calm.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: context rot in multi-day agent runs
&lt;/h2&gt;

&lt;p&gt;OpenClaw teams stretch sessions across days to keep stateful agents online for support, research, or ops. Two failure modes repeat:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prompt inflation&lt;/strong&gt;: you spend half your tokens replaying yesterday's chat log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual note-taking drift&lt;/strong&gt;: a human (or a distracted agent) edits a shared doc until formatting and facts diverge.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Customers notice when agents forget commitments, repeat questions, or mishandle escalations. Structured session summaries break the cycle because they compress hours of work into a handful of semantic memories the agent can recall before touching a new task.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "session summary" means here
&lt;/h2&gt;

&lt;p&gt;A session summary is a structured memory stored in MemoClaw describing what the agent just accomplished, what it learned, and what still needs attention. Each summary includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;namespace&lt;/code&gt;: e.g., &lt;code&gt;ops/&amp;lt;agent-name&amp;gt;&lt;/code&gt; or &lt;code&gt;customers/&amp;lt;account&amp;gt;/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;importance&lt;/code&gt;: score between 0 and 1 based on the stakes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tags&lt;/code&gt;: &lt;code&gt;session&lt;/code&gt;, &lt;code&gt;summary&lt;/code&gt;, plus domain-specific markers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;metadata&lt;/code&gt;: optional JSON for metrics (duration, tickets closed, revenue impact)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Standardizing namespaces up front keeps recalls tight. If you need help designing the hierarchy, review &lt;a href="https://blog.memoclaw.com/namespace-strategies-for-openclaw-agents" rel="noopener noreferrer"&gt;Namespace Strategies for OpenClaw Agents&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anatomy of a high-quality summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;What to capture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Timestamp + ID&lt;/td&gt;
&lt;td&gt;ISO timestamp plus a human-friendly session label so overlapping workers stay untangled.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concrete outcomes&lt;/td&gt;
&lt;td&gt;Bullet outcomes with verbs, metrics, and customer names instead of vibes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Follow-ups + owners&lt;/td&gt;
&lt;td&gt;Explicit task, owner, and deadline so the next shift knows what to do.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall signals&lt;/td&gt;
&lt;td&gt;Metrics such as revenue at risk, SLA breach count, or ticket volume that justify the &lt;code&gt;importance&lt;/code&gt; score.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next checkpoints&lt;/td&gt;
&lt;td&gt;Pending blockers, experiments to rerun, or data still missing.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Designing the summary template
&lt;/h2&gt;

&lt;p&gt;Builders get the best results when they standardize the template. Here's a field-tested structure you can drop into a system prompt, CLI script, or MCP tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Session: &amp;lt;agent-name&amp;gt; @ &amp;lt;timestamp&amp;gt;
Duration: &amp;lt;minutes&amp;gt;
Objectives: &amp;lt;list&amp;gt;
Outcomes:
- &amp;lt;Outcome + metric&amp;gt;
- &amp;lt;Outcome + metric&amp;gt;
Follow-ups:
- &amp;lt;task&amp;gt; (owner, due date)
Blocking issues:
- &amp;lt;issue + current status&amp;gt;
Signals:
- revenue_at_risk=&amp;lt;amount&amp;gt;
- escalations=&amp;lt;count&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consistency matters because MemoClaw embeds similar summaries near each other, making semantic recall precise even after hundreds of entries. If you already invest in tone or persona memory, align this template with the guardrails from &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; so summaries reinforce the same voice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation paths inside OpenClaw
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Option A: heartbeat automation
&lt;/h3&gt;

&lt;p&gt;Use OpenClaw's heartbeat scheduler to run a summary script every hour or at the end of a shift.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;' &amp;gt; scripts/session-summary.sh
#!/usr/bin/env bash
AGENT_NAME=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="sh"&gt;
LOG_PATH=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;&lt;span class="sh"&gt;
NAMESPACE=&lt;/span&gt;&lt;span class="nv"&gt;$3&lt;/span&gt;&lt;span class="sh"&gt;
DURATION_MIN=&lt;/span&gt;&lt;span class="nv"&gt;$4&lt;/span&gt;&lt;span class="sh"&gt;

SUMMARY=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 500 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG_PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | ~/.openclaw/workspace/scripts/summarize-session.py &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--agent&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AGENT_NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--duration&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DURATION_MIN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;
IMPORTANCE=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;python - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;PY&lt;/span&gt;&lt;span class="sh"&gt;'
import random
print(round(0.6 + random.random() * 0.35, 2))
&lt;/span&gt;&lt;span class="no"&gt;PY
&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;

memoclaw store &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --namespace "&lt;/span&gt;&lt;span class="nv"&gt;$NAMESPACE&lt;/span&gt;&lt;span class="sh"&gt;" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --importance "&lt;/span&gt;&lt;span class="nv"&gt;$IMPORTANCE&lt;/span&gt;&lt;span class="sh"&gt;" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --tags session,summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  "&lt;/span&gt;&lt;span class="nv"&gt;$SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;"
EOF
chmod +x scripts/session-summary.sh

openclaw heartbeat add --name support-summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --interval "1h" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --command "./scripts/session-summary.sh support-agent logs/support.log ops/support-agent 60"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs on local compute. Store calls use the free tier for the first 100 requests, then cost $0.005 each.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option B: agent-driven summaries
&lt;/h3&gt;

&lt;p&gt;Let the agent generate a summary every time it hits a natural break (end of ticket batch, status transition). Add a tool call inside the loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_store"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ops/support-agent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"session"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;agent-generated-summary&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pair this with a planner that issues &lt;code&gt;summarize_session&lt;/code&gt; directives so the agent never forgets.&lt;/p&gt;

&lt;p&gt;Automation-heavy shops can combine both options: a heartbeat catches worst-case gaps while the agent stores summaries during lulls. For deeper automation scripts, borrow ideas from &lt;a href="https://blog.memoclaw.com/automating-session-summaries-cron-consolidation" rel="noopener noreferrer"&gt;Automating Session Summaries&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preventing garbage summaries
&lt;/h2&gt;

&lt;p&gt;Garbage in, garbage out. Guard the pipeline with these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cap summary length&lt;/strong&gt; at 700–1,000 characters. Longer entries dilute embeddings and waste money.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ban generic phrasing&lt;/strong&gt; via prompt instructions. Force the agent to cite specific actions, owners, and metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use recall-before-store&lt;/strong&gt;: run a recall with the current timestamp. If a similar summary already exists (due to a retry), skip storing duplicates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score variability&lt;/strong&gt;: tie &lt;code&gt;importance&lt;/code&gt; to concrete triggers (escalation present? revenue impact &amp;gt; $1k?). Consistent scoring keeps urgent summaries above routine ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Integrating summaries into the agent workflow
&lt;/h2&gt;

&lt;p&gt;Summaries are worthless unless you recall them at the right moments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start-of-shift primer&lt;/strong&gt;: when an agent boots, pull the last three summaries for its namespace and pin them in the system message under &lt;code&gt;### Last three sessions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-action recall&lt;/strong&gt;: before responding to a user or running a workflow, recall summaries filtered by relevant tags (e.g., &lt;code&gt;billing&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-action verification&lt;/strong&gt;: after storing a summary, immediately recall the last two entries. If the new one is missing, alert the operator—namespaces or wallet env vars may be wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Handling runaway sessions
&lt;/h2&gt;

&lt;p&gt;Agents often run 24+ hours without a clean break. In those cases, generate rolling summaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Break the timeline into two-hour windows.&lt;/li&gt;
&lt;li&gt;Generate interim summaries at each boundary.&lt;/li&gt;
&lt;li&gt;At shutdown, consolidate everything into a final summary using MemoClaw's &lt;code&gt;consolidate&lt;/code&gt; endpoint or a custom script.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pseudo-workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;window &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;0 22 24&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  ./scripts/session-summary.sh research-agent logs/research.log ops/research-agent &lt;span class="k"&gt;$((&lt;/span&gt;window+2&lt;span class="k"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="c"&gt;# End-of-day consolidation&lt;/span&gt;
memoclaw consolidate &lt;span class="nt"&gt;--namespace&lt;/span&gt; ops/research-agent &lt;span class="nt"&gt;--tag&lt;/span&gt; summary &lt;span class="nt"&gt;--window&lt;/span&gt; &lt;span class="s2"&gt;"last24h"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Monitoring and auditing checklist
&lt;/h2&gt;

&lt;p&gt;Keep the pipeline observable so you can answer "Did summaries run last night?" in seconds.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Cadence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Query &lt;code&gt;memoclaw stats&lt;/code&gt; for each active namespace and alert if the summary count fails to increase.&lt;/td&gt;
&lt;td&gt;Ops lead&lt;/td&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Track average &lt;code&gt;importance&lt;/code&gt; via &lt;code&gt;memoclaw list --json&lt;/code&gt;; low scores hint at broken heuristics.&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Wrap &lt;code&gt;memoclaw store&lt;/code&gt; with a timer and log latency to your dashboard.&lt;/td&gt;
&lt;td&gt;Infra&lt;/td&gt;
&lt;td&gt;Hourly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Sample five summaries per namespace (&lt;code&gt;memoclaw list --limit 5&lt;/code&gt;) and review them in a standing meeting.&lt;/td&gt;
&lt;td&gt;Team lead&lt;/td&gt;
&lt;td&gt;Weekly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Export audit files (&lt;code&gt;memoclaw list &amp;gt; audits/&amp;lt;date&amp;gt;.md&lt;/code&gt;) and archive them next to incident reports.&lt;/td&gt;
&lt;td&gt;Compliance&lt;/td&gt;
&lt;td&gt;Weekly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Cost management for summary-heavy agents
&lt;/h2&gt;

&lt;p&gt;Session summaries add up if you run dozens of agents, but the math still works.&lt;/p&gt;

&lt;p&gt;Assume 10 agents, each storing 24 summaries per day (hourly). That's 240 store calls.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free tier covers the first 100 calls per wallet. See the breakdown in &lt;a href="https://blog.memoclaw.com/cost-optimization-free-tier" rel="noopener noreferrer"&gt;Cost Optimization: Free Tier&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Remaining 140 calls × $0.005 = $0.70/day.&lt;/li&gt;
&lt;li&gt;Consolidation once per agent per day: 10 × $0.01 = $0.10/day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total: $0.80/day to maintain precise cross-session memory for your entire agent fleet. Even a single saved support escalation covers that cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Case study: ops agent running for a week straight
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; A logistics operator keeps an OpenClaw agent watching incoming purchase orders 24/7. Before summaries, the agent double-billed shipments because it forgot which orders were already processed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace: &lt;code&gt;ops/logistics-agent/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hourly heartbeat stores summary with metrics: orders processed, anomalies, manual overrides.&lt;/li&gt;
&lt;li&gt;Importance scoring: &lt;code&gt;0.9&lt;/code&gt; for any summary mentioning "manual override" or "delay"; &lt;code&gt;0.5&lt;/code&gt; otherwise.&lt;/li&gt;
&lt;li&gt;Start-of-shift recall feeds the last four summaries into the prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate shipments dropped 82% in the first week.&lt;/li&gt;
&lt;li&gt;When a warehouse issue reoccurred, operations traced it to three summaries mentioning "Dock 4 scanner offline." Without summaries, they would have combed through 50k lines of logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security considerations
&lt;/h2&gt;

&lt;p&gt;Storing summaries means persisting potentially sensitive data. Mitigate risk with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespaces per customer&lt;/strong&gt; to prevent cross-contamination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable policies&lt;/strong&gt; reminding agents to redact PII before storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access controls&lt;/strong&gt;: only operators with the wallet's private key can read raw summaries. If you need to share sanitized snapshots, run them through a redaction script before exporting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Extending the pattern beyond support agents
&lt;/h2&gt;

&lt;p&gt;Session summaries benefit any long-running workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Research agents&lt;/strong&gt; capture interim findings and hypotheses before handoff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sales development bots&lt;/strong&gt; track objections, commitments, and next steps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infrastructure monitors&lt;/strong&gt; log incidents, mitigations, and escalations for on-call rotations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Combine this article with the persona guidance in &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; so each agent stores summaries that match its role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation reference in pseudo-code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;memoclaw&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recall&lt;/span&gt;

&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ops/support-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_cycle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                           &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;latest session summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                           &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;handle_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;maybe_summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;maybe_summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completed&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;time_since_last_summary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="n"&gt;importance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;score_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;importance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;importance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;tags&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;session&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;build_summary&lt;/code&gt; should enforce the template, while &lt;code&gt;score_summary&lt;/code&gt; reads keywords like "escalated" or metrics like &lt;code&gt;revenue_at_risk&lt;/code&gt; to adjust the score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quality checklist before shipping the summary system
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Template defined and documented where every operator can find it&lt;/li&gt;
&lt;li&gt;[ ] Automation path selected (heartbeat or agent-driven) and tested&lt;/li&gt;
&lt;li&gt;[ ] Recall-before-store dedupe verified with real logs&lt;/li&gt;
&lt;li&gt;[ ] Importance scoring heuristics tested on historical sessions&lt;/li&gt;
&lt;li&gt;[ ] Monitoring dashboards wired up (counts, latency, averages)&lt;/li&gt;
&lt;li&gt;[ ] Security review done (namespaces, redaction rules)&lt;/li&gt;
&lt;li&gt;[ ] Runbook written for failed summary runs (what to check, how to replay)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced tagging strategies
&lt;/h2&gt;

&lt;p&gt;Basic tags like &lt;code&gt;session&lt;/code&gt; and &lt;code&gt;summary&lt;/code&gt; are fine for onboarding, but revenue teams squeeze more value by tagging for business impact.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;revenue:&amp;lt;amount&amp;gt;&lt;/code&gt;&lt;/strong&gt; encodes revenue impact directly in a tag (&lt;code&gt;revenue:4200&lt;/code&gt;). During recall, filter summaries where revenue exceeds a threshold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;risk:&amp;lt;level&amp;gt;&lt;/code&gt;&lt;/strong&gt; marks risk levels (&lt;code&gt;risk:high&lt;/code&gt;, &lt;code&gt;risk:low&lt;/code&gt;). When an agent prepares an escalation, pull only &lt;code&gt;risk:high&lt;/code&gt; summaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sprint:&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/strong&gt; tags research summaries with sprint numbers so the next planning cycle has instant context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MemoClaw treats tags as plain strings, so keep them lowercase and delimiter-free. Build helper functions in your agent code to add or remove tags consistently instead of letting prompts invent new ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coordinating across multiple agents
&lt;/h2&gt;

&lt;p&gt;Large teams run fleets of agents touching the same account. Use shared namespaces with sub-tags for ownership.&lt;/p&gt;

&lt;p&gt;Example structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace: &lt;code&gt;customers/helios/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Tags: &lt;code&gt;agent:support&lt;/code&gt;, &lt;code&gt;agent:finance&lt;/code&gt;, &lt;code&gt;agent:research&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the support agent starts a shift, it runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_recall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/helios/sessions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"agent:support"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When finance needs the bigger picture, it queries the same namespace but omits the agent tag to get cross-functional context. This design keeps memories centralized while still letting each agent filter down to what matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Possible cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Summaries repeat identical text&lt;/td&gt;
&lt;td&gt;Summarizer prompt too generic&lt;/td&gt;
&lt;td&gt;Feed it more structured context (metrics, actions) and add duplicate detection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Summaries missing after restart&lt;/td&gt;
&lt;td&gt;Namespace mis-typed or wallet unset&lt;/td&gt;
&lt;td&gt;Validate namespace variables and env vars before storing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall returns stale summaries&lt;/td&gt;
&lt;td&gt;Importance not set or timestamps missing&lt;/td&gt;
&lt;td&gt;Include ISO timestamps plus importance scaling.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Costs higher than expected&lt;/td&gt;
&lt;td&gt;Summaries stored every few minutes unnecessarily&lt;/td&gt;
&lt;td&gt;Increase summary interval or consolidate more aggressively.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agents ignore summaries&lt;/td&gt;
&lt;td&gt;Prompt not referencing recalled content&lt;/td&gt;
&lt;td&gt;Update the system message to include &lt;code&gt;### Retrieved summaries&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Bring it all together
&lt;/h2&gt;

&lt;p&gt;Session summaries are the connective tissue between transient LLM context and the reality of multi-day operations. Install MemoClaw, enforce these session summaries, and wire them into your OpenClaw agents with discipline. When you do, "session summaries" stop being a buzzword and start acting like the reliable memory spine your operators need every single day.&lt;/p&gt;

</description>
      <category>openclaw</category>
      <category>memoclaw</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Session summaries as strategic memory: keeping long-running OpenClaw agents sane</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 12:11:47 +0000</pubDate>
      <link>https://dev.to/anajuliabit/session-summaries-as-strategic-memory-keeping-long-running-openclaw-agents-sane-4kck</link>
      <guid>https://dev.to/anajuliabit/session-summaries-as-strategic-memory-keeping-long-running-openclaw-agents-sane-4kck</guid>
      <description>&lt;h1&gt;
  
  
  Session summaries as strategic memory: keeping long-running OpenClaw agents sane
&lt;/h1&gt;

&lt;p&gt;Long-running agents are useless if they wake up every morning with amnesia. Operators already know context windows implode after a few hours, yet many still lean on brittle &lt;code&gt;MEMORY.md&lt;/code&gt; logs. &lt;a href="https://blog.memoclaw.com/case-against-memory-md" rel="noopener noreferrer"&gt;The case against MEMORY.md&lt;/a&gt; explains why flat files collapse; this guide shows the fix: structured MemoClaw session summaries that slot neatly into your OpenClaw workflow.&lt;/p&gt;

&lt;p&gt;If you want a quick refresher on the concept, skim &lt;a href="https://blog.memoclaw.com/session-summaries-perfect-recall" rel="noopener noreferrer"&gt;Session Summaries with MemoClaw&lt;/a&gt;. Below we stretch that core idea into a production system: template design, heartbeat automation, guardrails, monitoring, and the cost math that keeps finance calm.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: context rot in multi-day agent runs
&lt;/h2&gt;

&lt;p&gt;OpenClaw teams stretch sessions across days to keep stateful agents online for support, research, or ops. Two failure modes repeat:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Prompt inflation&lt;/strong&gt;: you spend half your tokens replaying yesterday's chat log.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manual note-taking drift&lt;/strong&gt;: a human (or a distracted agent) edits a shared doc until formatting and facts diverge.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Customers notice when agents forget commitments, repeat questions, or mishandle escalations. Structured session summaries break the cycle because they compress hours of work into a handful of semantic memories the agent can recall before touching a new task.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "session summary" means here
&lt;/h2&gt;

&lt;p&gt;A session summary is a structured memory stored in MemoClaw describing what the agent just accomplished, what it learned, and what still needs attention. Each summary includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;namespace&lt;/code&gt;: e.g., &lt;code&gt;ops/&amp;lt;agent-name&amp;gt;&lt;/code&gt; or &lt;code&gt;customers/&amp;lt;account&amp;gt;/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;importance&lt;/code&gt;: score between 0 and 1 based on the stakes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tags&lt;/code&gt;: &lt;code&gt;session&lt;/code&gt;, &lt;code&gt;summary&lt;/code&gt;, plus domain-specific markers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;metadata&lt;/code&gt;: optional JSON for metrics (duration, tickets closed, revenue impact)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Standardizing namespaces up front keeps recalls tight. If you need help designing the hierarchy, review &lt;a href="https://blog.memoclaw.com/namespace-strategies-for-openclaw-agents" rel="noopener noreferrer"&gt;Namespace Strategies for OpenClaw Agents&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Anatomy of a high-quality summary
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;What to capture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Timestamp + ID&lt;/td&gt;
&lt;td&gt;ISO timestamp plus a human-friendly session label so overlapping workers stay untangled.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concrete outcomes&lt;/td&gt;
&lt;td&gt;Bullet outcomes with verbs, metrics, and customer names instead of vibes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Follow-ups + owners&lt;/td&gt;
&lt;td&gt;Explicit task, owner, and deadline so the next shift knows what to do.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall signals&lt;/td&gt;
&lt;td&gt;Metrics such as revenue at risk, SLA breach count, or ticket volume that justify the &lt;code&gt;importance&lt;/code&gt; score.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next checkpoints&lt;/td&gt;
&lt;td&gt;Pending blockers, experiments to rerun, or data still missing.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Designing the summary template
&lt;/h2&gt;

&lt;p&gt;Builders get the best results when they standardize the template. Here's a field-tested structure you can drop into a system prompt, CLI script, or MCP tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Session: &amp;lt;agent-name&amp;gt; @ &amp;lt;timestamp&amp;gt;
Duration: &amp;lt;minutes&amp;gt;
Objectives: &amp;lt;list&amp;gt;
Outcomes:
- &amp;lt;Outcome + metric&amp;gt;
- &amp;lt;Outcome + metric&amp;gt;
Follow-ups:
- &amp;lt;task&amp;gt; (owner, due date)
Blocking issues:
- &amp;lt;issue + current status&amp;gt;
Signals:
- revenue_at_risk=&amp;lt;amount&amp;gt;
- escalations=&amp;lt;count&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consistency matters because MemoClaw embeds similar summaries near each other, making semantic recall precise even after hundreds of entries. If you already invest in tone or persona memory, align this template with the guardrails from &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; so summaries reinforce the same voice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation paths inside OpenClaw
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Option A: heartbeat automation
&lt;/h3&gt;

&lt;p&gt;Use OpenClaw's heartbeat scheduler to run a summary script every hour or at the end of a shift.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;SESSION_SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;' &amp;gt; scripts/session-summary.sh
#!/usr/bin/env bash
AGENT_NAME=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="sh"&gt;
LOG_PATH=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;&lt;span class="sh"&gt;
NAMESPACE=&lt;/span&gt;&lt;span class="nv"&gt;$3&lt;/span&gt;&lt;span class="sh"&gt;
DURATION_MIN=&lt;/span&gt;&lt;span class="nv"&gt;$4&lt;/span&gt;&lt;span class="sh"&gt;

SUMMARY=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 500 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LOG_PATH&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | ~/.openclaw/workspace/scripts/summarize-session.py &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--agent&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$AGENT_NAME&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--duration&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DURATION_MIN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;
IMPORTANCE=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;python - &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;PY&lt;/span&gt;&lt;span class="sh"&gt;'
import random
print(round(0.6 + random.random() * 0.35, 2))
&lt;/span&gt;&lt;span class="no"&gt;PY
&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;

memoclaw store &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --namespace "&lt;/span&gt;&lt;span class="nv"&gt;$NAMESPACE&lt;/span&gt;&lt;span class="sh"&gt;" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --importance "&lt;/span&gt;&lt;span class="nv"&gt;$IMPORTANCE&lt;/span&gt;&lt;span class="sh"&gt;" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --tags session,summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  "&lt;/span&gt;&lt;span class="nv"&gt;$SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;"
SESSION_SUMMARY
chmod +x scripts/session-summary.sh

openclaw heartbeat add --name support-summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --interval "1h" &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --command "./scripts/session-summary.sh support-agent logs/support.log ops/support-agent 60"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs on local compute. Store calls use the free tier for the first 100 requests, then cost $0.005 each.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option B: agent-driven summaries
&lt;/h3&gt;

&lt;p&gt;Let the agent generate a summary every time it hits a natural break (end of ticket batch, status transition). Add a tool call inside the loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_store"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ops/support-agent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"session"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;agent-generated-summary&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pair this with a planner that issues &lt;code&gt;summarize_session&lt;/code&gt; directives so the agent never forgets.&lt;/p&gt;

&lt;p&gt;Automation-heavy shops can combine both options: a heartbeat catches worst-case gaps while the agent stores summaries during lulls. For deeper automation scripts, borrow ideas from &lt;a href="https://blog.memoclaw.com/automating-session-summaries-cron-consolidation" rel="noopener noreferrer"&gt;Automating Session Summaries&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preventing garbage summaries
&lt;/h2&gt;

&lt;p&gt;Garbage in, garbage out. Guard the pipeline with these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cap summary length&lt;/strong&gt; at 700-1,000 characters. Longer entries dilute embeddings and waste money.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ban generic phrasing&lt;/strong&gt; via prompt instructions. Force the agent to cite specific actions, owners, and metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use recall-before-store&lt;/strong&gt;: run a recall with the current timestamp. If a similar summary already exists (due to a retry), skip storing duplicates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score variability&lt;/strong&gt;: tie &lt;code&gt;importance&lt;/code&gt; to concrete triggers (escalation present? revenue impact &amp;gt; $1k?). Consistent scoring keeps urgent summaries above routine ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Integrating summaries into the agent workflow
&lt;/h2&gt;

&lt;p&gt;Summaries are worthless unless you recall them at the right moments.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start-of-shift primer&lt;/strong&gt;: when an agent boots, pull the last three summaries for its namespace and pin them in the system message under &lt;code&gt;### Last three sessions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pre-action recall&lt;/strong&gt;: before responding to a user or running a workflow, recall summaries filtered by relevant tags (e.g., &lt;code&gt;billing&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Post-action verification&lt;/strong&gt;: after storing a summary, immediately recall the last two entries. If the new one is missing, alert the operator-namespaces or wallet env vars may be wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Handling runaway sessions
&lt;/h2&gt;

&lt;p&gt;Agents often run 24+ hours without a clean break. In those cases, generate rolling summaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Break the timeline into two-hour windows.&lt;/li&gt;
&lt;li&gt;Generate interim summaries at each boundary.&lt;/li&gt;
&lt;li&gt;At shutdown, consolidate everything into a final summary using MemoClaw's &lt;code&gt;consolidate&lt;/code&gt; endpoint or a custom script.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pseudo-workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;window &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;0 22 24&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  ./scripts/session-summary.sh research-agent logs/research.log ops/research-agent &lt;span class="k"&gt;$((&lt;/span&gt;window+2&lt;span class="k"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="c"&gt;# End-of-day consolidation&lt;/span&gt;
memoclaw consolidate &lt;span class="nt"&gt;--namespace&lt;/span&gt; ops/research-agent &lt;span class="nt"&gt;--tag&lt;/span&gt; summary &lt;span class="nt"&gt;--window&lt;/span&gt; &lt;span class="s2"&gt;"last24h"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Monitoring and auditing checklist
&lt;/h2&gt;

&lt;p&gt;Keep the pipeline observable so you can answer "Did summaries run last night?" in seconds.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Cadence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Query &lt;code&gt;memoclaw stats&lt;/code&gt; for each active namespace and alert if the summary count fails to increase.&lt;/td&gt;
&lt;td&gt;Ops lead&lt;/td&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Track average &lt;code&gt;importance&lt;/code&gt; via &lt;code&gt;memoclaw list --json&lt;/code&gt;; low scores hint at broken heuristics.&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Wrap &lt;code&gt;memoclaw store&lt;/code&gt; with a timer and log latency to your dashboard.&lt;/td&gt;
&lt;td&gt;Infra&lt;/td&gt;
&lt;td&gt;Hourly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Sample five summaries per namespace (&lt;code&gt;memoclaw list --limit 5&lt;/code&gt;) and review them in a standing meeting.&lt;/td&gt;
&lt;td&gt;Team lead&lt;/td&gt;
&lt;td&gt;Weekly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;[ ] Export audit files (&lt;code&gt;memoclaw list &amp;gt; audits/&amp;lt;date&amp;gt;.md&lt;/code&gt;) and archive them next to incident reports.&lt;/td&gt;
&lt;td&gt;Compliance&lt;/td&gt;
&lt;td&gt;Weekly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Cost management for summary-heavy agents
&lt;/h2&gt;

&lt;p&gt;Session summaries add up if you run dozens of agents, but the math still works.&lt;/p&gt;

&lt;p&gt;Assume 10 agents, each storing 24 summaries per day (hourly). That's 240 store calls.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free tier covers the first 100 calls per wallet. See the breakdown in &lt;a href="https://blog.memoclaw.com/cost-optimization-free-tier" rel="noopener noreferrer"&gt;Cost Optimization: Free Tier&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Remaining 140 calls × $0.005 = $0.70/day.&lt;/li&gt;
&lt;li&gt;Consolidation once per agent per day: 10 × $0.01 = $0.10/day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total: $0.80/day to maintain precise cross-session memory for your entire agent fleet. Even a single saved support escalation covers that cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Case study: ops agent running for a week straight
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; A logistics operator keeps an OpenClaw agent watching incoming purchase orders 24/7. Before summaries, the agent double-billed shipments because it forgot which orders were already processed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace: &lt;code&gt;ops/logistics-agent/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hourly heartbeat stores summary with metrics: orders processed, anomalies, manual overrides.&lt;/li&gt;
&lt;li&gt;Importance scoring: &lt;code&gt;0.9&lt;/code&gt; for any summary mentioning "manual override" or "delay"; &lt;code&gt;0.5&lt;/code&gt; otherwise.&lt;/li&gt;
&lt;li&gt;Start-of-shift recall feeds the last four summaries into the prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate shipments dropped 82% in the first week.&lt;/li&gt;
&lt;li&gt;When a warehouse issue reoccurred, operations traced it to three summaries mentioning "Dock 4 scanner offline." Without summaries, they would have combed through 50k lines of logs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security considerations
&lt;/h2&gt;

&lt;p&gt;Storing summaries means persisting potentially sensitive data. Mitigate risk with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespaces per customer&lt;/strong&gt; to prevent cross-contamination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable policies&lt;/strong&gt; reminding agents to redact PII before storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access controls&lt;/strong&gt;: only operators with the wallet's private key can read raw summaries. If you need to share sanitized snapshots, run them through a redaction script before exporting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Extending the pattern beyond support agents
&lt;/h2&gt;

&lt;p&gt;Session summaries benefit any long-running workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Research agents&lt;/strong&gt; capture interim findings and hypotheses before handoff.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sales development bots&lt;/strong&gt; track objections, commitments, and next steps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infrastructure monitors&lt;/strong&gt; log incidents, mitigations, and escalations for on-call rotations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Combine this article with the persona guidance in &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; so each agent stores summaries that match its role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation reference in pseudo-code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;memoclaw&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;recall&lt;/span&gt;

&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ops/support-agent&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_cycle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                           &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;latest session summary&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                           &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&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="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;handle_task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;maybe_summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;maybe_summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completed&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="nf"&gt;time_since_last_summary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;summary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;build_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&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="n"&gt;importance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;score_summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;store_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;SUMMARY_NAMESPACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;importance&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;importance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                     &lt;span class="n"&gt;tags&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;session&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;build_summary&lt;/code&gt; should enforce the template, while &lt;code&gt;score_summary&lt;/code&gt; reads keywords like "escalated" or metrics like &lt;code&gt;revenue_at_risk&lt;/code&gt; to adjust the score.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quality checklist before shipping the summary system
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Template defined and documented where every operator can find it&lt;/li&gt;
&lt;li&gt;[ ] Automation path selected (heartbeat or agent-driven) and tested&lt;/li&gt;
&lt;li&gt;[ ] Recall-before-store dedupe verified with real logs&lt;/li&gt;
&lt;li&gt;[ ] Importance scoring heuristics tested on historical sessions&lt;/li&gt;
&lt;li&gt;[ ] Monitoring dashboards wired up (counts, latency, averages)&lt;/li&gt;
&lt;li&gt;[ ] Security review done (namespaces, redaction rules)&lt;/li&gt;
&lt;li&gt;[ ] Runbook written for failed summary runs (what to check, how to replay)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advanced tagging strategies
&lt;/h2&gt;

&lt;p&gt;Basic tags like &lt;code&gt;session&lt;/code&gt; and &lt;code&gt;summary&lt;/code&gt; are fine for onboarding, but revenue teams squeeze more value by tagging for business impact.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;revenue:&amp;lt;amount&amp;gt;&lt;/code&gt;&lt;/strong&gt; encodes revenue impact directly in a tag (&lt;code&gt;revenue:4200&lt;/code&gt;). During recall, filter summaries where revenue exceeds a threshold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;risk:&amp;lt;level&amp;gt;&lt;/code&gt;&lt;/strong&gt; marks risk levels (&lt;code&gt;risk:high&lt;/code&gt;, &lt;code&gt;risk:low&lt;/code&gt;). When an agent prepares an escalation, pull only &lt;code&gt;risk:high&lt;/code&gt; summaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;sprint:&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/strong&gt; tags research summaries with sprint numbers so the next planning cycle has instant context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MemoClaw treats tags as plain strings, so keep them lowercase and delimiter-free. Build helper functions in your agent code to add or remove tags consistently instead of letting prompts invent new ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coordinating across multiple agents
&lt;/h2&gt;

&lt;p&gt;Large teams run fleets of agents touching the same account. Use shared namespaces with sub-tags for ownership.&lt;/p&gt;

&lt;p&gt;Example structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Namespace: &lt;code&gt;customers/helios/sessions&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Tags: &lt;code&gt;agent:support&lt;/code&gt;, &lt;code&gt;agent:finance&lt;/code&gt;, &lt;code&gt;agent:research&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the support agent starts a shift, it runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_recall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/helios/sessions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"agent:support"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When finance needs the bigger picture, it queries the same namespace but omits the agent tag to get cross-functional context. This design keeps memories centralized while still letting each agent filter down to what matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Possible cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Summaries repeat identical text&lt;/td&gt;
&lt;td&gt;Summarizer prompt too generic&lt;/td&gt;
&lt;td&gt;Feed it more structured context (metrics, actions) and add duplicate detection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Summaries missing after restart&lt;/td&gt;
&lt;td&gt;Namespace mis-typed or wallet unset&lt;/td&gt;
&lt;td&gt;Validate namespace variables and env vars before storing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall returns stale summaries&lt;/td&gt;
&lt;td&gt;Importance not set or timestamps missing&lt;/td&gt;
&lt;td&gt;Include ISO timestamps plus importance scaling.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Costs higher than expected&lt;/td&gt;
&lt;td&gt;Summaries stored every few minutes unnecessarily&lt;/td&gt;
&lt;td&gt;Increase summary interval or consolidate more aggressively.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agents ignore summaries&lt;/td&gt;
&lt;td&gt;Prompt not referencing recalled content&lt;/td&gt;
&lt;td&gt;Update the system message to include &lt;code&gt;### Retrieved summaries&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Bring it all together
&lt;/h2&gt;

&lt;p&gt;Session summaries are the connective tissue between transient LLM context and the reality of multi-day operations. Install MemoClaw, enforce these session summaries, and wire them into your OpenClaw agents with discipline. When you do, "session summaries" stop being a buzzword and start acting like the reliable memory spine your operators need every single day.&lt;/p&gt;

</description>
      <category>openclaw</category>
      <category>memoclaw</category>
      <category>automation</category>
      <category>agents</category>
    </item>
    <item>
      <title>From 5 minutes to production — adding MemoClaw to your OpenClaw agent the right way</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 12:11:29 +0000</pubDate>
      <link>https://dev.to/anajuliabit/from-5-minutes-to-production-adding-memoclaw-to-your-openclaw-agent-the-right-way-m78</link>
      <guid>https://dev.to/anajuliabit/from-5-minutes-to-production-adding-memoclaw-to-your-openclaw-agent-the-right-way-m78</guid>
      <description>&lt;h1&gt;
  
  
  From five minutes to production: wiring MemoClaw into your OpenClaw agent without cutting corners
&lt;/h1&gt;

&lt;p&gt;MemoClaw exists so you stop babysitting &lt;code&gt;MEMORY.md&lt;/code&gt; files. The fastest way to turn a curious OpenClaw tinkerer into a paying operator is to show them how to ship a concrete memory workflow in a single sitting. This guide is that workflow: install the MemoClaw skill, store the first memory, define a recall plan, harden it for production, and cover the failure paths nobody mentions in a hello-world demo. Follow it once and you have a repeatable template for every new agent.&lt;/p&gt;

&lt;p&gt;Need a refresher on why flat files fail? Read &lt;a href="https://blog.memoclaw.com/case-against-memory-md" rel="noopener noreferrer"&gt;The Case Against MEMORY.md&lt;/a&gt;, then come back here to build a real OpenClaw memory spine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick-reference build checklist
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Owner&lt;/th&gt;
&lt;th&gt;Outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Install MemoClaw skill + CLI&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Tooling available in OpenClaw and shell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Map namespaces&lt;/td&gt;
&lt;td&gt;Ops lead&lt;/td&gt;
&lt;td&gt;Documented table for &lt;code&gt;core&lt;/code&gt;, &lt;code&gt;customers/&amp;lt;slug&amp;gt;&lt;/code&gt;, &lt;code&gt;ops/&amp;lt;agent&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Embed store/recall templates&lt;/td&gt;
&lt;td&gt;Prompt engineer&lt;/td&gt;
&lt;td&gt;JSON snippets committed in repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Define recall cadence&lt;/td&gt;
&lt;td&gt;Agent maintainer&lt;/td&gt;
&lt;td&gt;Start, pre-output, post-correction hooks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add guardrails + fallback paths&lt;/td&gt;
&lt;td&gt;Reliability&lt;/td&gt;
&lt;td&gt;Empty recall + conflict handling routine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automate hygiene (dedupe, consolidate, stats)&lt;/td&gt;
&lt;td&gt;Ops&lt;/td&gt;
&lt;td&gt;Heartbeat or cron jobs running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Document production checklist&lt;/td&gt;
&lt;td&gt;Team lead&lt;/td&gt;
&lt;td&gt;Shared runbook tied to onboarding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why this workflow prints money for OpenClaw builders
&lt;/h2&gt;

&lt;p&gt;MemoClaw removes admin work, but only if you treat memory as a production dependency. Teams that sprint through installation without namespaces, guardrails, or audits end up paying for storage they never recall. The approach below keeps everything deterministic so finance, ops, and engineering can trust the stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenClaw running on your workstation or server&lt;/li&gt;
&lt;li&gt;Wallet funded with a few cents of USDC on Base (post-free tier usage)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MEMOCLAW_WALLET&lt;/code&gt; and &lt;code&gt;MEMOCLAW_PRIVATE_KEY&lt;/code&gt; exported in your shell&lt;/li&gt;
&lt;li&gt;Optional: &lt;code&gt;gh&lt;/code&gt; CLI for automated audits&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: install MemoClaw the way real agents do
&lt;/h2&gt;

&lt;p&gt;MemoClaw ships as both a CLI and an OpenClaw skill. For operators, the skill is the fastest path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openclaw skills &lt;span class="nb"&gt;install &lt;/span&gt;anajuliabit/memoclaw &lt;span class="nt"&gt;--force&lt;/span&gt;
openclaw skills list | &lt;span class="nb"&gt;grep &lt;/span&gt;memoclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need CLI access for migrations or backups? Install it globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; memoclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MemoClaw uses wallet-based identity-no API keys. Confirm the wallet currently set in OpenClaw before you rely on the skill:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$MEMOCLAW_WALLET&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Wallet missing"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Export the wallet and private key if needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MEMOCLAW_WALLET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0xYourWallet
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MEMOCLAW_PRIVATE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: define namespaces before you store anything
&lt;/h2&gt;

&lt;p&gt;Skipping namespaces is the fastest way to leak context between projects. Align on a structure inspired by &lt;a href="https://blog.memoclaw.com/namespace-strategies-for-openclaw-agents" rel="noopener noreferrer"&gt;Namespace Strategies for OpenClaw Agents&lt;/a&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Namespace&lt;/th&gt;
&lt;th&gt;Use case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Immutable policies (security, billing, voice)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;customers/&amp;lt;slug&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Client-specific context&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ops/&amp;lt;agent-name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Operational agents (heartbeats, inbox monitors)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;experiments/&amp;lt;codename&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Short-lived sandboxes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;MemoClaw creates namespaces lazily when you store the first memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; core &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.9 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; onboarding,defaults &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Ally must never publish drafts directly. Stop at draft handoff."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: wire store/recall directly into your agent loop
&lt;/h2&gt;

&lt;p&gt;MemoClaw calls are simple JSON tool invocations-keep them nearby so every agent uses the same plumbing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Store template&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_store"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/lumen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"preferences"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"product"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Lumen prefers Telegram summaries under 200 words."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Recall template&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"memoclaw_recall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customers/lumen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"query"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"What should I remember before writing Lumen's weekly report?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"limit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit these snippets to your agent repo so every new teammate copies the same version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: design the recall strategy like it's a production dependency
&lt;/h2&gt;

&lt;p&gt;Turn the recall plan into a scannable routine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When&lt;/strong&gt;: run recall at session start, before user-facing output, and right after a correction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How many&lt;/strong&gt;: default to five memories; bump to ten only if you store session summaries or research chunks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt merge&lt;/strong&gt;: paste recall results under a fixed template such as:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;### Retrieved memories
1. &amp;lt;memory&amp;gt;
2. &amp;lt;memory&amp;gt;

### Task
&amp;lt;instruction&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fallback&lt;/strong&gt;: if recall fails, inject a deterministic checklist ("No stored context. Use the public positioning doc.").&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: handle empty recalls and stale context
&lt;/h2&gt;

&lt;p&gt;Short reminders beat long paragraphs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Empty recall&lt;/strong&gt; → Run a fallback snippet so the agent never improvises.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stale data&lt;/strong&gt; → Store timestamps plus a &lt;code&gt;metadata&lt;/code&gt; field like &lt;code&gt;"expires_at": "2026-05-01"&lt;/code&gt;; ignore expired entries in code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflicting facts&lt;/strong&gt; → Lean on &lt;code&gt;importance&lt;/code&gt;. Corrections get 0.95, offhand comments 0.2, so mission-critical items always sort to the top.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 6: automations that keep the memory layer honest
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recall-before-store guardrail&lt;/strong&gt;: recall with the new content as a query and skip the store if similarity &amp;gt; 0.92.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weekly consolidation&lt;/strong&gt;: call &lt;code&gt;memoclaw consolidate --namespace customers/lumen&lt;/code&gt; to merge redundant entries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stats-driven audits&lt;/strong&gt;: run &lt;code&gt;memoclaw stats&lt;/code&gt; and &lt;code&gt;memoclaw list --limit 10&lt;/code&gt; inside a heartbeat. Alert if counts spike or drop unexpectedly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session summaries&lt;/strong&gt;: add a heartbeat that ships summaries hourly; borrow prompts from &lt;a href="https://blog.memoclaw.com/automating-session-summaries-cron-consolidation" rel="noopener noreferrer"&gt;Automating Session Summaries&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: production checklist
&lt;/h2&gt;

&lt;p&gt;Before you declare an agent "live," verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Wallet env vars set in &lt;code&gt;.env&lt;/code&gt; and active tmux sessions&lt;/li&gt;
&lt;li&gt;[ ] Namespaces documented and version-controlled&lt;/li&gt;
&lt;li&gt;[ ] Store + recall templates committed to the repo&lt;/li&gt;
&lt;li&gt;[ ] Guardrails implemented (empty results, expiration, duplicates)&lt;/li&gt;
&lt;li&gt;[ ] Hygiene jobs scheduled (consolidate, stats audit)&lt;/li&gt;
&lt;li&gt;[ ] Immutable memories created for non-negotiables&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 8: integrate with other systems without diluting memory quality
&lt;/h2&gt;

&lt;p&gt;MemoClaw plays well with the rest of your stack as long as roles stay clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docs or Notion&lt;/strong&gt;: export via &lt;code&gt;memoclaw export --namespace ...&lt;/code&gt; and send the JSON to leadership.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics dashboards&lt;/strong&gt;: push stats output to Grafana or Metabase so outages show up next to API metrics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incident response&lt;/strong&gt;: run &lt;code&gt;memoclaw history mem_123&lt;/code&gt; to trace how a memory evolved before filing a root-cause report.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 9: cost planning so finance never blocks you
&lt;/h2&gt;

&lt;p&gt;MemoClaw charges only when embeddings or GPT are involved. For a typical ops agent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Calls/day&lt;/th&gt;
&lt;th&gt;Cost per call&lt;/th&gt;
&lt;th&gt;Daily total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Store (single)&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;$0.15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;$0.20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consolidate&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Daily cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.36&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Batch storage is your best lever when ingesting historical data: 100 memories for $0.04 vs $0.50 individually. For deeper math and wallet planning, revisit &lt;a href="https://blog.memoclaw.com/cost-optimization-free-tier" rel="noopener noreferrer"&gt;Cost Optimization: Free Tier&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: failure drills
&lt;/h2&gt;

&lt;p&gt;Run chaos drills monthly so the team trusts the memory layer under load.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Expired credentials&lt;/strong&gt;: unset &lt;code&gt;$MEMOCLAW_PRIVATE_KEY&lt;/code&gt; and confirm the agent fails loudly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespace pollution&lt;/strong&gt;: intentionally store a wrong memory, run your dedupe routine, and ensure it catches the anomaly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free-tier exhaustion&lt;/strong&gt;: point &lt;code&gt;MEMOCLAW_URL&lt;/code&gt; to a staging proxy that reports &lt;code&gt;remaining=0&lt;/code&gt; so monitoring alerts the team.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example: full OpenClaw tool chain for onboarding a new agent
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Install skill&lt;/span&gt;
openclaw skills &lt;span class="nb"&gt;install &lt;/span&gt;anajuliabit/memoclaw &lt;span class="nt"&gt;--force&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$MEMOCLAW_WALLET&lt;/span&gt;  &lt;span class="c"&gt;# verify&lt;/span&gt;

&lt;span class="c"&gt;# 2. Populate immutable core knowledge&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; core &lt;span class="nt"&gt;--immutable&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Never email customers from dummy domains."&lt;/span&gt;

&lt;span class="c"&gt;# 3. Create namespace per customer&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen &lt;span class="s2"&gt;"Namespace created"&lt;/span&gt; &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.1

&lt;span class="c"&gt;# 4. Seed intro memories&lt;/span&gt;
memoclaw store &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.8 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"Weekly report due Mondays 14:00 UTC"&lt;/span&gt;

&lt;span class="c"&gt;# 5. Configure agent prompts&lt;/span&gt;
Update system prompt with: &lt;span class="s1"&gt;'Always recall from customers/&amp;lt;slug&amp;gt; before user-facing output.'&lt;/span&gt;

&lt;span class="c"&gt;# 6. Test recall guardrails&lt;/span&gt;
memoclaw_recall &lt;span class="nv"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;customers/lumen &lt;span class="nv"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"status"&lt;/span&gt; &lt;span class="nv"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5
Confirm fallback path when zero results returned.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Troubleshooting cheatsheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Store calls failing with 401&lt;/td&gt;
&lt;td&gt;Wallet env vars missing&lt;/td&gt;
&lt;td&gt;Re-export &lt;code&gt;$MEMOCLAW_WALLET&lt;/code&gt; + &lt;code&gt;$MEMOCLAW_PRIVATE_KEY&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall returns irrelevant memories&lt;/td&gt;
&lt;td&gt;Flat importance scores, no namespaces&lt;/td&gt;
&lt;td&gt;Re-score critical items, enforce namespace mapping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Duplicate memories everywhere&lt;/td&gt;
&lt;td&gt;Dedupe routine missing&lt;/td&gt;
&lt;td&gt;Run recall-before-store guardrail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent forgets cross-session facts&lt;/td&gt;
&lt;td&gt;Heartbeat not storing summaries&lt;/td&gt;
&lt;td&gt;Add end-of-session summary store call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Costs spike unexpectedly&lt;/td&gt;
&lt;td&gt;Batch store not used&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;memoclaw store-batch&lt;/code&gt; for &amp;gt;20 entries&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Instrumentation: prove the memory layer is doing its job
&lt;/h2&gt;

&lt;p&gt;Once the workflow is live, add telemetry so you can debug issues in minutes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Emit metrics per call type&lt;/strong&gt;: wrap each tool call in a shim that records &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;operation&lt;/code&gt;, &lt;code&gt;latency_ms&lt;/code&gt;, and &lt;code&gt;result_count&lt;/code&gt;. Ship it to whatever metrics stack you already run (Grafana, Datadog, Prometheus).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log retrieved memories alongside outputs&lt;/strong&gt;: when your agent sends a final response, log the recall payload it used. Redact sensitive data but keep enough text to trace bad decisions back to specific memories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alert on hygiene failures&lt;/strong&gt;: monitor duplicate skip counts and expired-memory usage. Spikes flag teams that forgot to refresh SLAs or pricing tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Session summary automation in practice
&lt;/h2&gt;

&lt;p&gt;End-of-session summaries glue short-lived prompts to multi-week missions. Build a heartbeat that runs every hour (or on agent shutdown) and ships a new memory. Use the heartbeat prompt patterns from &lt;a href="https://blog.memoclaw.com/session-summaries-perfect-recall" rel="noopener noreferrer"&gt;Session Summaries with MemoClaw&lt;/a&gt; plus the automation tips above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openclaw heartbeat run &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOT&lt;/span&gt;&lt;span class="sh"&gt;'
SUMMARY=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 200 logs/support-agent.log | ./scripts/summarize.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt;
memoclaw store &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --namespace ops/support-agent &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --importance 0.7 &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --tags session,summary &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  "&lt;/span&gt;&lt;span class="nv"&gt;$SUMMARY&lt;/span&gt;&lt;span class="sh"&gt;"
&lt;/span&gt;&lt;span class="no"&gt;EOT
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep summaries under 1,000 characters and rotate the &lt;code&gt;importance&lt;/code&gt; score based on novelty. A routine "no changes" summary should sit near 0.3, while a production incident deserves 0.95.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bridging test and production environments
&lt;/h2&gt;

&lt;p&gt;Most teams run OpenClaw sandboxes for QA. Use separate namespaces per environment (&lt;code&gt;customers/lumen-dev&lt;/code&gt; vs &lt;code&gt;customers/lumen&lt;/code&gt;). Before promoting an agent, export the dev namespace, review it, then re-store curated entries into prod using batch store.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; customers/lumen-dev &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; lumen-dev.json
jq &lt;span class="s1"&gt;'.memories | map({namespace: "customers/lumen", content, importance, tags})'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  lumen-dev.json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; lumen-prod.json
memoclaw store-batch lumen-prod.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Checklist for onboarding new operators
&lt;/h2&gt;

&lt;p&gt;When another builder joins the team, hand them this list:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read this guide plus &lt;a href="https://blog.memoclaw.com/building-agent-personality-through-memory" rel="noopener noreferrer"&gt;Building Agent Personality Through Memory&lt;/a&gt; to understand tone guardrails.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;memoclaw stats&lt;/code&gt; on every namespace they own; paste the output in the weekly ops doc.&lt;/li&gt;
&lt;li&gt;Trigger manual recalls to internalize what "good" looks like.&lt;/li&gt;
&lt;li&gt;Review immutable memories so they know the non-negotiables.&lt;/li&gt;
&lt;li&gt;Practice restoring from export by spinning up a scratch namespace, importing the latest backup, and verifying the agent can recall from it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Deploy this pattern with confidence
&lt;/h2&gt;

&lt;p&gt;Five minutes gets you "it runs." Production-readiness takes the extra hour to plan namespaces, guardrails, hygiene, monitoring, and onboarding. MemoClaw already handles embeddings, storage, and semantic search; your job is to wire it into OpenClaw with discipline. Follow the checklist here, lean on the internal guides linked above, and every new agent inherits the same reliable OpenClaw memory workflow.&lt;/p&gt;

</description>
      <category>openclaw</category>
      <category>memoclaw</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Tag-based memory filtering: laser-focused recall for specialized agents</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 08:16:31 +0000</pubDate>
      <link>https://dev.to/anajuliabit/tag-based-memory-filtering-laser-focused-recall-for-specialized-agents-4fnk</link>
      <guid>https://dev.to/anajuliabit/tag-based-memory-filtering-laser-focused-recall-for-specialized-agents-4fnk</guid>
      <description>&lt;h1&gt;
  
  
  Tag-based memory filtering: laser-focused recall for specialized agents
&lt;/h1&gt;

&lt;p&gt;Semantic search gets you close, but there are days when you cannot afford fuzzy matches. When an OpenClaw agent handles regulated workflows or needs to recall only customer preferences, you have to scope the search down to the exact subset of memory that matters. Tags are how you do it. MemoClaw lets you assign any number of tags to each memory, then filter recalls by those tags, namespaces, and importance thresholds. Used well, tags turn a pile of embeddings into a well indexed notebook.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tags turn MemoClaw into an indexed log. Pair them with namespaces and importance scores to control recall precision.&lt;/li&gt;
&lt;li&gt;Tag filters keep memory outside the prompt window, so you get laser recall with zero token tax while every OpenClaw sub-agent on the wallet reads the same scoped slice.&lt;/li&gt;
&lt;li&gt;Build a shared taxonomy with prefixes like &lt;code&gt;customer:&lt;/code&gt;, &lt;code&gt;topic:&lt;/code&gt;, &lt;code&gt;stage:&lt;/code&gt;. Enforce it so agents do not invent random strings.&lt;/li&gt;
&lt;li&gt;Use tag filters with semantic queries for best results: text narrows meaning, tags narrow scope.&lt;/li&gt;
&lt;li&gt;Keep hygiene tight: audit tags, consolidate duplicates, and age out stale entries so signal stays clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why tags matter more than ever
&lt;/h2&gt;

&lt;p&gt;Context windows are larger, but production agents still choke when you toss raw search results at them. Tags solve three problems at once:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Precision.&lt;/strong&gt; Telling MemoClaw to return only memories tagged &lt;code&gt;customer:lyra&lt;/code&gt; keeps other accounts out of the conversation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed.&lt;/strong&gt; Smaller result sets mean faster recalls and less JSON to parse before feeding the agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety.&lt;/strong&gt; In regulated workflows you can ensure that only memories tagged &lt;code&gt;compliance&lt;/code&gt; ever show up during certain steps.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Without tags, you keep rerunning recalls until the right memory happens to float to the top. With tags, you ask once and move on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing a tag taxonomy
&lt;/h2&gt;

&lt;p&gt;Tags only work if every agent agrees on the same language.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with prefixes.&lt;/strong&gt; &lt;code&gt;customer:&amp;lt;slug&amp;gt;&lt;/code&gt;, &lt;code&gt;source:&amp;lt;system&amp;gt;&lt;/code&gt;, &lt;code&gt;stage:&amp;lt;phase&amp;gt;&lt;/code&gt;, &lt;code&gt;urgency:&amp;lt;level&amp;gt;&lt;/code&gt;, &lt;code&gt;release:&amp;lt;name&amp;gt;&lt;/code&gt;. Prefixes prevent collisions and make filtering easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limit free text.&lt;/strong&gt; Humans love to improvise. Publish a YAML or JSON file with approved values. Reject anything outside the list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep tags short.&lt;/strong&gt; Hyphenated slugs beat full sentences. &lt;code&gt;topic:memory-budgeting&lt;/code&gt; is better than &lt;code&gt;topic:how-to-manage-memory&lt;/code&gt;. Short tags reduce mistakes and keep recall commands readable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document mandatory tags.&lt;/strong&gt; For example, every support note might require both &lt;code&gt;customer&lt;/code&gt; and &lt;code&gt;status&lt;/code&gt;. Your storage wrapper should refuse to store memories missing those tags.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version the taxonomy.&lt;/strong&gt; When you rename a tag, run a script that updates historical memories via &lt;code&gt;memoclaw update&lt;/code&gt;. Consistency across time is what gives you confident recall.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Combining tags with namespaces and importance
&lt;/h2&gt;

&lt;p&gt;Tags are only one axis. MemoClaw also lets you split data into namespaces and rank items by importance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Namespaces&lt;/strong&gt; isolate broad domains. Put customer insights in &lt;code&gt;customer&lt;/code&gt;, incidents in &lt;code&gt;incidents&lt;/code&gt;, product feedback in &lt;code&gt;product&lt;/code&gt;. It is fine to store the same text twice with different namespaces if it serves two roles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Importance scores&lt;/strong&gt; float the needles to the top. A memory tagged &lt;code&gt;customer:lyra&lt;/code&gt; with &lt;code&gt;importance 0.9&lt;/code&gt; will beat a &lt;code&gt;0.4&lt;/code&gt; note even if both share the same tags. Score ruthlessly so your recall payloads contain the best nuggets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable flag&lt;/strong&gt; locks critical facts. When you tag something &lt;code&gt;compliance:sox&lt;/code&gt; you might also want to pass &lt;code&gt;--immutable&lt;/code&gt; so nobody edits it later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Set policies per namespace. For example, &lt;code&gt;support-live&lt;/code&gt; might require &lt;code&gt;importance &amp;gt;= 0.5&lt;/code&gt;, while &lt;code&gt;research-notes&lt;/code&gt; tolerates 0.2 because you would rather keep rough notes than lose a lead entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crafting high signal recall queries
&lt;/h2&gt;

&lt;p&gt;Tag filters shine when paired with an actual question. Here are patterns we use daily.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exact tag filter
&lt;/h3&gt;

&lt;p&gt;Return the five most important deployment notes for a customer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw recall &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; customer-ops &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; customer:lyra,topic:deployments &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--limit&lt;/span&gt; 5 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance-min&lt;/span&gt; 0.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tag plus text
&lt;/h3&gt;

&lt;p&gt;Combine tags with a semantic query to answer specific questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw recall &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; support &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; customer:lyra,status:open &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"neon sync failure"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--limit&lt;/span&gt; 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tag unions
&lt;/h3&gt;

&lt;p&gt;MemoClaw treats comma separated tags as an AND filter. If you need OR behavior, run two recalls or store aggregate tags like &lt;code&gt;segment:enterprise&lt;/code&gt; and &lt;code&gt;segment:startups&lt;/code&gt; so you can filter at a higher level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Time slicing
&lt;/h3&gt;

&lt;p&gt;Add a tag such as &lt;code&gt;captured:2026-03&lt;/code&gt; when storing. Later you can ask for &lt;code&gt;--tags captured:2026-03&lt;/code&gt;. This beats relying on created-at timestamps because tags survive exports and manual edits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation pattern inside OpenClaw
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Centralize tagging logic.&lt;/strong&gt; Wrap &lt;code&gt;memoclaw store&lt;/code&gt; inside a helper script that enforces tag rules. Agents call the helper with structured data, not raw tag strings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expose tag suggestions to agents.&lt;/strong&gt; Include a cheat sheet in the system prompt showing available tags. When agents output &lt;code&gt;memory_tags&lt;/code&gt;, parse and validate those entries before storing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Record tag usage.&lt;/strong&gt; Each time you store a memory, append the tags to a local log. That log becomes the data source for future audits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Teach planners to filter.&lt;/strong&gt; In the planning prompt, remind the agent which tag combos unlock the right recall. Example: "Before answering, recall with tags &lt;code&gt;customer:&amp;lt;slug&amp;gt;&lt;/code&gt; plus &lt;code&gt;topic:&amp;lt;topic&amp;gt;&lt;/code&gt;." That instruction keeps every sub-agent that shares the wallet aligned on the same recall scope.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache results by tag.&lt;/strong&gt; If an agent fetches &lt;code&gt;customer:lyra&lt;/code&gt; three times in ten minutes, reuse the earlier payload unless new memories exist. That reduces spend.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Advanced techniques
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Tag hierarchies
&lt;/h3&gt;

&lt;p&gt;You can simulate hierarchies without native nesting. When you store a memory about an outage in the Paris region you might use tags &lt;code&gt;region:eu&lt;/code&gt;, &lt;code&gt;region:eu-paris&lt;/code&gt;, and &lt;code&gt;service:api&lt;/code&gt;. That lets you recall by continent or by metro without extra logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tag driven routing
&lt;/h3&gt;

&lt;p&gt;Morgan style orchestrators can read tag metadata to decide which specialist agent should own a task. For example, if a memory is tagged &lt;code&gt;topic:payments&lt;/code&gt;, route the incident to the payments fixer. Tags become lightweight metadata for the job queue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tag plus importance heat maps
&lt;/h3&gt;

&lt;p&gt;Export memories weekly and build a pivot showing tag counts per importance bucket. If critical tags only contain low importance entries, your scoring rubric is broken.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dedup by tag clusters
&lt;/h3&gt;

&lt;p&gt;When you consolidate, group by tag sets first. If two memories share identical tag sets and similar text, merge them or delete the duplicate to keep recalls crisp.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintaining hygiene
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scheduled audits:&lt;/strong&gt; Run &lt;code&gt;memoclaw list --tags &amp;lt;prefix&amp;gt;&lt;/code&gt; to sample entries. If tags drift, fix them immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated validation:&lt;/strong&gt; Use a JSON schema that defines allowed tag prefixes. Reuse it in every agent script.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consolidate regularly:&lt;/strong&gt; &lt;code&gt;memoclaw consolidate --namespace support --tags customer:lyra&lt;/code&gt; merges overlapping entries and keeps the namespace lean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Educate humans:&lt;/strong&gt; Your human teammates need to know tag meanings so they can debug results. Publish a short README in the repo and pin it in Slack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scenario: Specialized compliance agent
&lt;/h2&gt;

&lt;p&gt;A compliance agent reviews wallet transactions for AML red flags. It follows this plan:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ingest:&lt;/strong&gt; Every flagged transaction summary gets stored with &lt;code&gt;tags: ["customer:&amp;lt;id&amp;gt;", "risk:high", "source:aml-bot", "rule:travel-rule"]&lt;/code&gt; and a namespace &lt;code&gt;compliance&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investigation:&lt;/strong&gt; When a new alert arrives, the agent recalls &lt;code&gt;--namespace compliance --tags customer:&amp;lt;id&amp;gt;,risk:high&lt;/code&gt; to see how many past alerts exist.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decision:&lt;/strong&gt; If the recall shows recent entries tagged &lt;code&gt;status:escalated&lt;/code&gt;, the agent recommends involving a human.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reporting:&lt;/strong&gt; After closing the case, the agent stores the outcome with &lt;code&gt;tags: ["customer:&amp;lt;id&amp;gt;", "status:closed", "reviewer:agent"]&lt;/code&gt;. Immutable flag stays on to lock the record.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thanks to consistent tags, investigators can pull a full history for a wallet in seconds and prove that every decision considered relevant context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist before you rely on tags
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Write down every tag prefix, accepted values, and which namespace requires them.&lt;/li&gt;
&lt;li&gt;Build lint checks that run inside CI to reject commits that add unrecognized tags to helper scripts.&lt;/li&gt;
&lt;li&gt;Ensure every memo includes at least one functional tag (like &lt;code&gt;topic&lt;/code&gt;) and one scoping tag (like &lt;code&gt;customer&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Run a recall dry run for each namespace that shows more than 500 memories. If the response feels noisy, revisit your taxonomy.&lt;/li&gt;
&lt;li&gt;Keep a changelog of tag updates. When you rename &lt;code&gt;topic:deployments&lt;/code&gt; to &lt;code&gt;topic:release&lt;/code&gt;, note it and run an update job so old memories keep working.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tooling to manage tags
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tag registry file:&lt;/strong&gt; Keep a &lt;code&gt;tags.yml&lt;/code&gt; file in your repo. Agents can read it at runtime, and humans can open a pull request when they need a new tag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI helpers:&lt;/strong&gt; Wrap &lt;code&gt;memoclaw recall&lt;/code&gt; and &lt;code&gt;store&lt;/code&gt; inside scripts that auto append required tags so callers cannot forget them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dashboards:&lt;/strong&gt; Feed &lt;code&gt;memoclaw stats --namespace &amp;lt;name&amp;gt; --json&lt;/code&gt; into a simple dashboard showing tag counts per week. When one tag drops to zero you know a workflow broke.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alerting:&lt;/strong&gt; Watch for memories stored without tags. The API accepts an empty array, so add a guard that rejects those writes before they leave your workspace.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IDE snippets:&lt;/strong&gt; Give human operators snippets for the tags they use most so they stop inventing new ones under deadline pressure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common mistakes and how to fix them
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Using tags for everything:&lt;/strong&gt; Tags are for scoping, not for narrative. If you find yourself tagging with full sentences, trim the text and keep the description in the memory body instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letting agents invent values:&lt;/strong&gt; Agents will happily output &lt;code&gt;customer:acme-corp&lt;/code&gt; one minute and &lt;code&gt;customer:AcmeCorp&lt;/code&gt; the next. Normalize cases and strip punctuation before storing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never cleaning duplicates:&lt;/strong&gt; Two tags that mean the same thing fragment recall. Run a script that finds similar tag names and standardizes them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgetting to update recalls:&lt;/strong&gt; When you add a new tag, update every agent prompt so they know it exists. Otherwise the tag never gets used.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chaining too many tags in one recall:&lt;/strong&gt; If you demand five tags at once you might get zero results. Start with the most important two tags, check the output, then narrow if needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Testing tag filters
&lt;/h2&gt;

&lt;p&gt;Testing recall filters should be part of your CI the same way API tests are. Add a suite that spins up a fake wallet, stores sample memories with known tags, and runs scripted recalls to assert the right IDs come back. For live systems, keep a &lt;code&gt;smoke-test&lt;/code&gt; namespace. Write a memory tagged &lt;code&gt;smoke:test&lt;/code&gt; every hour, then have a monitor recall it. If the recall ever fails you know tagging or recall infrastructure broke before real customers notice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rollout timeline that works
&lt;/h2&gt;

&lt;p&gt;Day 1: Audit existing memories, list the tag patterns already in use, and write the shared taxonomy. Day 2: Update store helpers and agent prompts so new tags apply automatically. Day 3: Backfill critical namespaces by retro tagging the top 100 memories per customer. Day 4: Add monitoring plus CI tests. By the end of the week you should have every workflow storing with tags, and Sage will have enough metadata to review drafts faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can I retroactively tag old memories?&lt;/strong&gt; Yes. Use &lt;code&gt;memoclaw update &amp;lt;id&amp;gt; --tags ...&lt;/code&gt; or export the namespace, edit the JSON, and re import it. Plan the job carefully so you do not lose importance scores.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How many tags are too many?&lt;/strong&gt; Most teams stay under five tags per memory. More than that often means you are compensating for sloppy namespaces. If you hit double digits regularly, revisit your structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do tags affect cost?&lt;/strong&gt; No. Adding tags to a memory does not change pricing. The only cost driver is how often you call endpoints that use embeddings or GPT.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if two teams need the same tags but different meanings?&lt;/strong&gt; Namespaces keep semantics apart. The same tag name can exist in two namespaces with different meanings, but you should avoid it unless both teams agree on the definition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can tags enforce access control?&lt;/strong&gt; Not today. Access is wallet wide. Use separate wallets if you need hard isolation, then rely on tags for filtering inside each wallet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tag based filtering is the difference between an agent that reuses your hard earned knowledge and an agent that keeps guessing. Write the taxonomy, enforce it with scripts, combine it with namespaces and importance scores, and teach your planners to recall with tags before every decision. It takes a day to set up and pays for itself the first time an agent answers a tricky question without paging a human for context.&lt;/p&gt;

</description>
      <category>memoclaw</category>
      <category>openclaw</category>
      <category>tags</category>
      <category>recall</category>
    </item>
    <item>
      <title>Batch storing memories: when MemoClaw's bulk API saves 87 percent</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 08:15:43 +0000</pubDate>
      <link>https://dev.to/anajuliabit/batch-storing-memories-when-memoclaws-bulk-api-saves-87-percent-17dp</link>
      <guid>https://dev.to/anajuliabit/batch-storing-memories-when-memoclaws-bulk-api-saves-87-percent-17dp</guid>
      <description>&lt;h1&gt;
  
  
  Batch storing memories: when MemoClaw's bulk API saves 87 percent
&lt;/h1&gt;

&lt;p&gt;Every OpenClaw agent starts with a few manual stores. Then a migration shows up and you suddenly need to stuff thousands of facts into MemoClaw. Calling &lt;code&gt;memoclaw store&lt;/code&gt; one record at a time feels safe, but it torches both time and budget. The batch endpoint was built for these moments. It writes up to one hundred memories per call for $0.04, keeps tags and importance intact, and gives you atomic feedback so you know which payloads succeeded. If you plan around that endpoint from the start, onboarding a new customer or backfilling a year of tickets becomes a short background job instead of an all-nighter.&lt;/p&gt;

&lt;p&gt;Our first big pilot with a design studio forced this lesson. The lead dev tried to import 4,800 markdown snippets with a while loop and individual store calls, then pinged me at 3 a.m. asking why the wallet balance evaporated. We rewrote the job with batch uploads, re-ran it in twelve minutes, and spent $1.92 instead of $24. That became the policy: no more manual drips when a replay is on the calendar.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Single store calls cost $0.005 each after the free tier. Batch store writes up to 100 records for $0.04, which is an 87 percent discount once you batch more than eight items.&lt;/li&gt;
&lt;li&gt;Batch shines on user onboarding, migrating MEMORY.md files, nightly session summaries, and any workflow that emits structured observations.&lt;/li&gt;
&lt;li&gt;Design payloads with consistent schemas: text body, tags array, namespace, importance. Validate locally before shipping them to MemoClaw.&lt;/li&gt;
&lt;li&gt;Batch imports land outside the prompt window, so you add thousands of memories with zero token tax while every OpenClaw sub-agent on the same wallet gains access instantly.&lt;/li&gt;
&lt;li&gt;Pair the batch endpoint with OpenClaw cron jobs so long imports happen off the critical path. Capture partial failures, retry idempotently, and log the returned IDs for audits.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The cost math
&lt;/h2&gt;

&lt;p&gt;MemoClaw only charges for operations that touch embeddings or GPT. That still adds up when you are loading historic data.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Records&lt;/th&gt;
&lt;th&gt;Singles cost&lt;/th&gt;
&lt;th&gt;Batch cost&lt;/th&gt;
&lt;th&gt;Savings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;$0.05&lt;/td&gt;
&lt;td&gt;$0.04&lt;/td&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;$0.25&lt;/td&gt;
&lt;td&gt;$0.04&lt;/td&gt;
&lt;td&gt;84%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;$0.50&lt;/td&gt;
&lt;td&gt;$0.04&lt;/td&gt;
&lt;td&gt;92%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Those numbers mean you should default to batch for any replay job over eight items. Singles still make sense for real time logging during an agent session, but scheduled jobs should always bundle writes.&lt;/p&gt;

&lt;h2&gt;
  
  
  When batch storage wins
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Customer onboarding
&lt;/h3&gt;

&lt;p&gt;A new enterprise wallet shows up with a PDF of preferences, network maps, runbooks, and gotchas. Parsing that once and batching the output saves two things: money and opportunity cost. Instead of waiting half an hour for a loop of single stores, you drop the entire kit for $0.04 and move on.&lt;/p&gt;

&lt;h3&gt;
  
  
  MEMORY.md migrations
&lt;/h3&gt;

&lt;p&gt;Thousands of OpenClaw users still keep long MEMORY.md files. When they move to MemoClaw they have to import years of notes. Split the file into paragraphs, assign tags like &lt;code&gt;source:memory-md&lt;/code&gt; plus the original folder path, then batch. The importer can even keep the original timestamp in a custom tag so future recalls filter by timeframe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Session summaries
&lt;/h3&gt;

&lt;p&gt;Agents that run 24 hours keep end of shift summaries. Rather than storing each bullet by itself, buffer them for five minutes and write one batch. You keep semantic granularity while slashing calls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cron driven data sync
&lt;/h3&gt;

&lt;p&gt;If you need to sync answers from an external system every hour, there is no reason to use single stores. Fetch the data, build the payload, and send it through the batch endpoint so you stay inside budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing a clean payload
&lt;/h2&gt;

&lt;p&gt;A good batch payload is boring and predictable. Each memory in the array should carry the same fields so downstream recalls stay reliable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Customer SolarFlux deploys every Wednesday and freezes changes during launches."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customer-ops"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"customer:solarflux"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cadence:weekly"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"risk:launch"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.74&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Customer SolarFlux keeps emergency contacts at ops@solarflux.dev."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"customer-ops"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"tags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"customer:solarflux"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"contact:ops"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"importance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.63&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep texts under 8192 characters.&lt;/strong&gt; That is the per memory cap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalize tags.&lt;/strong&gt; Lowercase, no spaces, predictable prefixes like &lt;code&gt;customer:&lt;/code&gt; or &lt;code&gt;source:&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Carry timestamps.&lt;/strong&gt; If the source data has dates, put them in a tag like &lt;code&gt;captured:2026-03-18&lt;/code&gt; so recall filters can reason about freshness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate locally.&lt;/strong&gt; Run a JSON schema check before calling the API so you fail fast.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wiring batch storage into OpenClaw
&lt;/h2&gt;

&lt;p&gt;The easiest place to run batch jobs is a cron agent. Here is a starter flow for migrating a MEMORY.md file every night until the backlog is empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;SOURCE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/openclaw/workspace/memory/backlog/&lt;span class="k"&gt;*&lt;/span&gt;.md
&lt;span class="k"&gt;for &lt;/span&gt;file &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$SOURCE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;jq &lt;span class="nt"&gt;-Rs&lt;/span&gt; &lt;span class="s1"&gt;'split("\n\n") | map(select(length &amp;gt; 0)) |
    each as $paragraph |
    {text: $paragraph, namespace: "memory-backfill", tags: ["source:memory-md", "file:'&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s1"&gt;'"], importance: 0.55}'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /tmp/batch.json
  memoclaw store &lt;span class="nt"&gt;--batch&lt;/span&gt; &amp;lt; /tmp/batch.json
  &lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; ~/openclaw/workspace/memory/imported/
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You do not have to write bash. The CLI accepts JSON files or stdin, and the SDKs expose the same structure if you prefer Python or TypeScript. The pattern is what matters: gather items, shape them, batch once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling partial failures
&lt;/h2&gt;

&lt;p&gt;The batch endpoint returns success per memory. You still have to act on it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check response codes.&lt;/strong&gt; A 200 means the API processed the batch. Inside the body you will find per item status plus IDs for the successful ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retry idempotently.&lt;/strong&gt; Keep a hash of &lt;code&gt;text + namespace + tags&lt;/code&gt;. If a retry payload matches an earlier write you can skip storing it again or accept the duplicate and clean it later with &lt;code&gt;consolidate&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log IDs.&lt;/strong&gt; Write every returned memory ID into a spreadsheet or datastore. That log is what you will use later for deletes or audits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alert on repeated failures.&lt;/strong&gt; If more than 5 percent of items fail, pause the job and surface the errors. They usually indicate a malformed payload or a tag naming bug.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Observability and budgets
&lt;/h2&gt;

&lt;p&gt;Batch jobs are invisible unless you record what happened.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;memoclaw stats --namespace &amp;lt;name&amp;gt; --since &amp;lt;date&amp;gt;&lt;/code&gt;.&lt;/strong&gt; It shows how many stores hit the namespace each day. Spikes reveal failed dedupe or a runaway job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export after each batch.&lt;/strong&gt; &lt;code&gt;memoclaw export --namespace memory-backfill --since 2026-03-18&lt;/code&gt; gives you the exact payloads that landed. Store the file in object storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track spend per namespace.&lt;/strong&gt; Run &lt;code&gt;memoclaw stats --json --namespace memory-backfill | jq -r '.spend.usd'&lt;/code&gt; (or hit &lt;code&gt;/v1/stats?namespace=memory-backfill&lt;/code&gt; with &lt;code&gt;x-wallet-auth&lt;/code&gt;) and feed that number into whatever dashboard Finance watches so they see the real batch costs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare before vs after recall latency.&lt;/strong&gt; Once the batch job completes, measure how long recalls take. If latency rises, add more tags or split namespaces to keep result sets small.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real example: onboarding a pilot customer
&lt;/h2&gt;

&lt;p&gt;A studio signs up for a pilot and hands you a trove of context. Here is how the flow looks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Normalize the data.&lt;/strong&gt; Parse their Google Doc into discrete facts: toolchain, release cadence, escalation contacts, risk items.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score importance.&lt;/strong&gt; Anything tied to production stability gets 0.8+. Preferences land around 0.6.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assign namespaces.&lt;/strong&gt; Put operational details into &lt;code&gt;customer-ops&lt;/code&gt;. Put product wishes into &lt;code&gt;customer-product&lt;/code&gt;. That split makes later recalls sharper.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch store.&lt;/strong&gt; Build the JSON payload and run &lt;code&gt;cat payload.json | memoclaw store --batch&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Record IDs.&lt;/strong&gt; Log the output to &lt;code&gt;customer-solarflux-import.log&lt;/code&gt; with timestamp, ID, and source paragraph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trigger a recall.&lt;/strong&gt; Have the support agent call &lt;code&gt;memoclaw recall --namespace customer-ops --tags customer:solarflux --limit 5&lt;/code&gt; during its first plan step. The context shows up immediately for every agent that shares the wallet, no prompt restuffing required.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Total time: under fifteen minutes including scripting. Without batch you would have spent half an hour waiting on sequential writes and would have paid five times as much.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist for safe imports
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Confirm the wallet has enough balance for the entire batch. 100 records cost $0.04, so free tier wallets can cover two batches before paying.&lt;/li&gt;
&lt;li&gt;Dry run by slicing the first ten items and uploading them alone. Inspect the returned IDs and tags.&lt;/li&gt;
&lt;li&gt;Record the git commit or document that generated the data so you can trace the source later.&lt;/li&gt;
&lt;li&gt;After the import, run &lt;code&gt;memoclaw list --namespace &amp;lt;name&amp;gt; --limit 20 --json&lt;/code&gt; to spot check content.&lt;/li&gt;
&lt;li&gt;Schedule a follow up recall script that ensures the new data actually influences agent plans. Storage without recall is wasted effort.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Advanced batching patterns
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rolling window batches:&lt;/strong&gt; When agents generate dozens of observations per hour, drop them into a queue and flush every five minutes or every 40 items, whichever comes first. That keeps latency low while still unlocking the discount.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hybrid writes:&lt;/strong&gt; Mix high priority singles with low priority batches. For example, store a critical outage note immediately, but buffer the supporting details for the next batch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespace mirroring:&lt;/strong&gt; Write the same batch to two namespaces when you need different recall strategies. Support might recall by &lt;code&gt;customer&lt;/code&gt;, while product recalls by &lt;code&gt;feature&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Importance stratification:&lt;/strong&gt; Sort the payload before uploading so high importance items sit first. If a batch fails halfway through you at least persisted the critical pieces.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross wallet mirroring:&lt;/strong&gt; Some teams keep a staging wallet for QA. Run the exact same batch against staging before production. When staging passes you can trust the production upload.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TypeScript batch runner for OpenClaw subagents
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;readFileSync&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MemoClaw&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@memoclaw/sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MemoClaw&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;walletKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WALLET_KEY&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;runBatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;storeBatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ok&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`stored &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`failed item: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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="nf"&gt;runBatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;process&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="mi"&gt;1&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;Drop that script into an OpenClaw automation and have the agent generate the payload file, then call &lt;code&gt;node batch-runner.js payload.json&lt;/code&gt;. It keeps retries simple and gives you structured logs per item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Post-batch recall strategy
&lt;/h2&gt;

&lt;p&gt;Uploading is half the job. You also have to confirm that future recalls actually use the new data. Build a short checklist for every import:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run targeted recalls such as &lt;code&gt;memoclaw recall --namespace customer-ops --tags customer:solarflux --limit 3&lt;/code&gt;. Read the output and make sure it reflects the payload.&lt;/li&gt;
&lt;li&gt;Add automated tests that spin up a throwaway OpenClaw agent, call the recall command, and assert that the returned JSON includes the expected tags.&lt;/li&gt;
&lt;li&gt;Monitor token usage. Once the agent stops re asking humans for the same context, you should see prompt size drop. If it does not, you forgot to wire the recall into your planning loop.&lt;/li&gt;
&lt;li&gt;Teach humans how to ask for the new memories. If sales engineers do not know tags exist, they will never filter by customer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Governance and cleanup
&lt;/h2&gt;

&lt;p&gt;Batches can rot if you never revisit them. Schedule maintenance as part of the same project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Age off stale imports.&lt;/strong&gt; If an onboarding batch is older than six months, export it, archive it, then delete it so recalls stay lean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag drift audits.&lt;/strong&gt; Once a month run &lt;code&gt;memoclaw list --namespace customer-ops --limit 100 --json | jq '.[].tags' | sort | uniq -c&lt;/code&gt; to inspect which tags dominate. If new prefixes appear, decide whether they are valid or need cleanup.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable guardrails.&lt;/strong&gt; For compliance memories, pass &lt;code&gt;--immutable&lt;/code&gt; when storing. During audits, verify the flag is still present so nobody silently edits those facts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross namespace checks.&lt;/strong&gt; If two namespaces keep referencing the same source data, merge them or add better tags. Overlapping namespaces confuse recalls and double your spend.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What happens if one memory in the batch is too large?&lt;/strong&gt; That item fails with a descriptive error. The rest of the batch still writes. Fix the oversized entry by trimming the text or splitting it into two records, then retry only that item.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I mix namespaces inside one batch?&lt;/strong&gt; Yes. Each item carries its own namespace, tags, and importance score. That makes it easy to import a mix of support notes and engineering summaries without extra calls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I keep batch jobs from clashing with real time stores?&lt;/strong&gt; Use namespaces to isolate historical imports. Real time agents can keep using &lt;code&gt;default&lt;/code&gt; or &lt;code&gt;support-live&lt;/code&gt; while your cron agent writes to &lt;code&gt;support-backfill&lt;/code&gt;. Later you can consolidate the two spaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does batching affect recall relevance?&lt;/strong&gt; No. MemoClaw indexes each record individually. As long as your tags and importance scores are honest, the search results stay sharp.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I still get 100 free calls?&lt;/strong&gt; Yes. The free tier counts API calls, not records. A wallet can run 100 batch calls for free, which translates to up to 10,000 memories before you pay.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Batch storage is the cheapest lever you have for loading context into MemoClaw. It turns migrations, onboarding, and nightly flushes into predictable jobs with predictable bills. Plan the payload, validate tags, watch the stats, and treat the returned IDs like receipts. Once you make batching a default, you will stop telling customers to wait while an agent backfills context one record at a time.&lt;/p&gt;

</description>
      <category>memoclaw</category>
      <category>openclaw</category>
      <category>batch</category>
      <category>memory</category>
    </item>
    <item>
      <title>Stateful agents in 2026: persistent memory beats bigger prompts</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Thu, 19 Mar 2026 08:15:42 +0000</pubDate>
      <link>https://dev.to/anajuliabit/stateful-agents-in-2026-persistent-memory-beats-bigger-prompts-3d13</link>
      <guid>https://dev.to/anajuliabit/stateful-agents-in-2026-persistent-memory-beats-bigger-prompts-3d13</guid>
      <description>&lt;h1&gt;
  
  
  Stateful agents in 2026: persistent memory beats bigger prompts
&lt;/h1&gt;

&lt;p&gt;Developers spent 2025 chasing larger context windows. It helped for a minute, then support tickets piled up again: agents forgot customer preferences, forgot which fix already shipped, and forgot the plan that yesterday's shift agreed on. Stateless execution is a dead end when your production agent has to coordinate hundreds of steps over days. The teams that are shipping stable agents this year did not get better models. They stopped throwing the past away.&lt;/p&gt;

&lt;p&gt;I watched one OpenClaw pod burn a full week trying to keep a retail support bot "in character" with nothing but prompt stuffing. Every night the agent spun up fresh, misdiagnosed the same issue, and re-opened tickets that had already been resolved. The only thing that changed the trajectory was bolting MemoClaw underneath the workflow so the bot actually remembered what it promised customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bigger prompts do not turn a stateless agent into a reliable worker. You need a durable memory service that survives process restarts and sub-agent churn.&lt;/li&gt;
&lt;li&gt;MemoClaw gives OpenClaw teams a wallet based identity, importance scoring, namespaces, and tag filters so every recall is scoped to the exact slice you need.&lt;/li&gt;
&lt;li&gt;A working stateful stack fits into five steps: install the MemoClaw skill, pick namespaces, score new information, store it with tags, and recall with filters before every major decision.&lt;/li&gt;
&lt;li&gt;Instrument the memory layer with stats and exports so you can audit what the agent learned and prune anything stale.&lt;/li&gt;
&lt;li&gt;Every recall happens outside the prompt window, so you cut token waste to zero while sharing the same memory set across every sub-agent that signs with the wallet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why stateless agents keep breaking
&lt;/h2&gt;

&lt;p&gt;OpenClaw makes it trivial to boot a new process for every session. That sounded nice until real workflows showed up.&lt;/p&gt;

&lt;p&gt;The breaking point usually arrives the first time a human escalates a ticket and the follow-up agent cannot see the prior commitments. That is when the pager rings.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Session resets wipe context.&lt;/strong&gt; Support agents run for ten minutes at a time, then spin down. When the next request lands, the new worker has to re-learn everything about the user. Users notice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt stuffing wastes tokens.&lt;/strong&gt; The default reaction is to jam MEMORY.md into the system prompt. That eats thousands of tokens before the agent even hears the new question, raises latency, and still leaves you blind when the file exceeds the window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Orchestrators cannot hand off work cleanly.&lt;/strong&gt; A lead agent spawns a fixer, the fixer closes the ticket, then nobody records the fix. The next person repeats the same work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compliance and audit gaps appear.&lt;/strong&gt; You cannot explain why a decision happened because the observations that led to it were never stored anywhere permanent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That list will only get worse as agents run production workflows at night while nobody watches. The fix is putting a memory layer under every agent the same way we put databases under web apps fifteen years ago.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stateful means for OpenClaw builders
&lt;/h2&gt;

&lt;p&gt;Stateful does not mean dumping every conversation into a vector store. For us it means three concrete capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Durable recall:&lt;/strong&gt; Every important observation lands in MemoClaw via &lt;code&gt;memoclaw store&lt;/code&gt; or &lt;code&gt;store --batch&lt;/code&gt;. Those memories sit outside the model context so they survive restarts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scoped replay:&lt;/strong&gt; You pull back only what matters using namespaces and tags. Preference memories live in &lt;code&gt;customer-profile&lt;/code&gt;. Incident write ups live in &lt;code&gt;postmortems&lt;/code&gt;. Session summaries go into &lt;code&gt;sessions&lt;/code&gt;. Recalls target one namespace at a time so results stay sharp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programmable importance:&lt;/strong&gt; The agent scores every new detail between 0 and 1. Low score means skip storing. High score means pin it so future recalls see it first. MemoClaw exposes this through the &lt;code&gt;--importance&lt;/code&gt; flag on every store endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you wire those three ideas into the event loop you get an agent that behaves like a staff engineer who keeps notebooks instead of a goldfish that resets every five minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture blueprint: OpenClaw skill plus MemoClaw
&lt;/h2&gt;

&lt;p&gt;A minimal stateful stack fits on one slide:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Wallet identity:&lt;/strong&gt; Fund a Base wallet once. OpenClaw skills sign requests with that wallet so every agent you spawn inherits the same memory account and can share context without re stuffing prompts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespaces for roles:&lt;/strong&gt; Create namespaces such as &lt;code&gt;support&lt;/code&gt;, &lt;code&gt;sales-handovers&lt;/code&gt;, &lt;code&gt;deployments&lt;/code&gt;, and &lt;code&gt;learning&lt;/code&gt;. Namespaces are cheap, so use them to isolate recall scopes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Importance gating:&lt;/strong&gt; Add a small scoring rubric to your system prompt. When the agent observes something, have it emit &lt;code&gt;memory_score&lt;/code&gt;. Only call &lt;code&gt;memoclaw store&lt;/code&gt; when the score clears 0.6 or whatever threshold fits the role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag taxonomy:&lt;/strong&gt; Tags are the surgical tool. Tag customer tickets with &lt;code&gt;customer:acme&lt;/code&gt; and &lt;code&gt;tier:enterprise&lt;/code&gt;. Tag infrastructure items with &lt;code&gt;service:api&lt;/code&gt;. Those tags become filters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall hooks:&lt;/strong&gt; Before answering anything that reaches across sessions, run &lt;code&gt;memoclaw recall --query ... --namespace ... --tags ...&lt;/code&gt;. Inject the retrieved snippets into your plan stage, not the final response stage, so the agent has time to reason over the memory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;MemoClaw handles semantic ranking, dedupe, and storage limits behind the scenes. You keep the flow above consistent and you get stateful behavior without building a new database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operational patterns
&lt;/h2&gt;

&lt;p&gt;You do not need a neural architecture diagram. You need a few boring loops that never miss.&lt;/p&gt;

&lt;h3&gt;
  
  
  Proactive storage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;memoclaw store&lt;/code&gt; right after a high importance observation. Do not wait until the end of the session. The process might crash before then.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;store --batch&lt;/code&gt; at the end of an onboarding flow so you drop a hundred structured facts for $0.04 instead of paying per record.&lt;/li&gt;
&lt;li&gt;Keep namespaces tidy. If a memory spans two surfaces, store it twice with different tags instead of inventing complex schemas.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Intentional recall
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Recall early in your tool plan. For example, a fixer agent can recall &lt;code&gt;--namespace incidents --tags incident:913,status:open&lt;/code&gt; before touching the keyboard.&lt;/li&gt;
&lt;li&gt;Combine text queries with tags when you need precision. &lt;code&gt;memoclaw recall --query "monorepo rollout" --tags customer:apollo --namespace support&lt;/code&gt; fetches only the relevant slice.&lt;/li&gt;
&lt;li&gt;Cache the last recall per namespace for five minutes so you do not hammer the API when loops repeat.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Consolidation and hygiene
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Schedule a cron agent to run &lt;code&gt;memoclaw consolidate --namespace support --tags customer:acme&lt;/code&gt; each night. That merges redundant notes.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;memoclaw list --namespace support --limit 100&lt;/code&gt; weekly to spot stale data.&lt;/li&gt;
&lt;li&gt;Delete poison memories immediately via &lt;code&gt;memoclaw delete &amp;lt;id&amp;gt;&lt;/code&gt; or &lt;code&gt;bulk-delete --ids&lt;/code&gt;. Do not leave bad context lying around.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Five minute implementation guide
&lt;/h2&gt;

&lt;p&gt;You can take an empty OpenClaw workspace and reach a stateful agent in one sitting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install the skill.&lt;/strong&gt; &lt;code&gt;clawhub install memoclaw&lt;/code&gt; or &lt;code&gt;npm install -g memoclaw&lt;/code&gt; for the CLI. Verify with &lt;code&gt;memoclaw --help&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fund the wallet.&lt;/strong&gt; Send a few USDC to your Base wallet. One store call costs $0.005 so ten bucks covers thousands of writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create namespaces.&lt;/strong&gt; You do not pre register them. Just pick names and start writing. Example: &lt;code&gt;memoclaw store "Namespace seed" --namespace support&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drop the scoring rubric into your agent.&lt;/strong&gt; Example snippet: &lt;code&gt;If observation should be remembered assign memory_score 0 to 1, else null.&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hook storage.&lt;/strong&gt; In your OpenClaw workflow, after the agent outputs an action with &lt;code&gt;memory_score &amp;gt;= 0.6&lt;/code&gt;, run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"Ticket 1387: customer cannot sync Neon"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; support &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; customer:orbit,topic:sync,status:open &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.78
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hook recall.&lt;/strong&gt; Add a planning step that runs:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;MEMORIES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;memoclaw recall &lt;span class="nt"&gt;--namespace&lt;/span&gt; support &lt;span class="nt"&gt;--tags&lt;/span&gt; customer:orbit &lt;span class="nt"&gt;--limit&lt;/span&gt; 5 &lt;span class="nt"&gt;--json&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parse the JSON, inject the relevant snippets into the agent context, and continue the loop.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Expose stats.&lt;/strong&gt; &lt;code&gt;memoclaw stats --namespace support&lt;/code&gt; gives you counts per day. Alert when storage volume spikes or falls to zero.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Instrumentation and guardrails
&lt;/h2&gt;

&lt;p&gt;Persistent memory is only useful if you can trust it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Importance thresholds:&lt;/strong&gt; Log every memory below your cutoff along with the reason it was rejected. If agents keep producing low score items, tighten the rubric.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag watchlists:&lt;/strong&gt; Build a small checker that alerts when a memory is stored without required tags like &lt;code&gt;customer&lt;/code&gt; or &lt;code&gt;namespace&lt;/code&gt;. Garbage tagging kills recall quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spend tracking:&lt;/strong&gt; MemoClaw charges only for operations that hit OpenAI. Run &lt;code&gt;memoclaw stats --json --namespace support | jq -r '.spend.usd'&lt;/code&gt; (or call &lt;code&gt;/v1/stats?namespace=support&lt;/code&gt; with the &lt;code&gt;x-wallet-auth&lt;/code&gt; header) to pull daily cost per namespace so Finance is never surprised.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutable rules:&lt;/strong&gt; Some facts, like compliance mandates, should never be edited. Store them with &lt;code&gt;--immutable&lt;/code&gt; and audit that flag weekly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export for audits:&lt;/strong&gt; &lt;code&gt;memoclaw export --namespace support --since 2026-03-01&lt;/code&gt; produces a zipped JSON you can hand to auditors or use for offline analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Case study: A 24 hour support pod
&lt;/h2&gt;

&lt;p&gt;A real customer support pod runs the following pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Intake agent&lt;/strong&gt; tags every new conversation with &lt;code&gt;customer&lt;/code&gt;, &lt;code&gt;product&lt;/code&gt;, and &lt;code&gt;urgency&lt;/code&gt;, then stores the summary with 0.7 importance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixer agent&lt;/strong&gt; recalls on &lt;code&gt;customer:&amp;lt;slug&amp;gt;&lt;/code&gt; and &lt;code&gt;status:open&lt;/code&gt;. It sees the intake summary plus the last three fixes for that customer before proposing a solution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verifier agent&lt;/strong&gt; stores the final resolution with &lt;code&gt;status:closed&lt;/code&gt; and a link to the main ticket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nightly maintenance agent&lt;/strong&gt; consolidates duplicate summaries, runs &lt;code&gt;stats&lt;/code&gt;, and posts a memo showing how many memories each customer generated. That number maps directly to support load.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The pod went from repeating fixes every week to self serving within two days because each worker stopped re learning context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rollout checklist for production teams
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Map every agent role to a namespace on paper before writing code.&lt;/li&gt;
&lt;li&gt;List the exact observations each role should store. If it is not on the list, do not store it.&lt;/li&gt;
&lt;li&gt;Define the scoring rubric and thresholds per role. Support intake might store at 0.6 while finance automation needs 0.8.&lt;/li&gt;
&lt;li&gt;Decide who reviews the memory feed. A human weekly review keeps quality high.&lt;/li&gt;
&lt;li&gt;Wire spending alerts on top of &lt;code&gt;memoclaw stats --json --namespace support | jq -r '.spend.usd'&lt;/code&gt; (or hit &lt;code&gt;/v1/stats&lt;/code&gt; directly) and push the result into Slack so cost surprises show up fast.&lt;/li&gt;
&lt;li&gt;Script exports. Drop nightly exports into object storage so you always have an immutable audit trail.&lt;/li&gt;
&lt;li&gt;Drill recovery. Kill an agent mid flow and confirm the replacement agent can finish the task from stored context.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Common pitfalls to watch
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tag sprawl:&lt;/strong&gt; When every agent invents new tags on the fly, recall becomes random. Publish a YAML file with approved tags and validate against it before storing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unbounded namespaces:&lt;/strong&gt; Putting every memory into &lt;code&gt;default&lt;/code&gt; turns recall into noise. Create small namespaces and archive old ones with &lt;code&gt;export&lt;/code&gt; plus &lt;code&gt;bulk-delete&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Late recalls:&lt;/strong&gt; If you recall after the agent already committed to an action, it is too late. Move recall to the start of the planning step.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing de duplication:&lt;/strong&gt; Run &lt;code&gt;memoclaw consolidate&lt;/code&gt; or &lt;code&gt;list&lt;/code&gt; to spot duplicates. If two memories carry the same payload, delete one so semantic search stays sharp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring failures:&lt;/strong&gt; Treat failed API calls like failed database writes. Log them, retry with backoff, and surface metrics so you know when Base RPC hiccups are hurting memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How is this different from RAG?&lt;/strong&gt; Retrieval augmented generation feeds documents into the prompt for a single answer. MemoClaw stores granular memories with tags, importance, and namespaces, so you can build running histories per customer or task. It complements RAG but solves a different problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do I have to write backend code?&lt;/strong&gt; No. The CLI and OpenClaw skill expose the same API. Most teams start with shell commands and graduate to SDKs only when they need automation at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about private data?&lt;/strong&gt; MemoClaw is not for secrets. Do not store API keys or passwords. Store summaries, decisions, and preferences. The service runs on Neon Postgres with pgvector, and every request is scoped to your wallet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much does this cost?&lt;/strong&gt; You get 100 free calls per wallet. After that, storing or recalling a single memory costs $0.005. Batch storage is $0.04 for up to 100 records. Listing, deleting, and stats are free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can multiple agents share the same memory?&lt;/strong&gt; Yes. As long as they sign with the same wallet they see the same namespaces. Use namespaces and tags to prevent cross contamination when roles vary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Stateful agents are not hype. They are the only way an OpenClaw deployment survives more than one shift without human babysitting. MemoClaw gives you the persistence layer, wallet identity, semantic recall, and cost controls out of the box. Start with a single namespace, wire in the scoring rubric, and insist that every agent store what it learns. Within a week you will have fewer repeat incidents, faster handoffs, and a memory log you can audit. Bigger prompts will never deliver that.&lt;/p&gt;

</description>
      <category>memoclaw</category>
      <category>openclaw</category>
      <category>memory</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Agent memory on a budget: stretch MemoClaw's free tier before you swipe</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:31:57 +0000</pubDate>
      <link>https://dev.to/anajuliabit/agent-memory-on-a-budget-stretch-memoclaws-free-tier-before-you-swipe-1jfj</link>
      <guid>https://dev.to/anajuliabit/agent-memory-on-a-budget-stretch-memoclaws-free-tier-before-you-swipe-1jfj</guid>
      <description>&lt;h1&gt;
  
  
  Agent memory on a budget: stretch MemoClaw's free tier before you swipe
&lt;/h1&gt;

&lt;p&gt;You only get 100 paid operations before MemoClaw asks you for USDC. That sounds tight until you realize most maintenance endpoints cost nothing. If you're prototyping an OpenClaw agent, you can run for weeks on the free tier by being intentional about what hits the embeddings pipeline. MemoClaw also lives outside your prompt window. Park a memory here and it's one less token block stuffed into context, which keeps long-running builds fast and cheap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know which calls burn credits
&lt;/h2&gt;

&lt;p&gt;MemoClaw only charges when it has to embed or run GPT-4o-mini. Everything else is free. Keep this table taped next to your console:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Store single memory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;memoclaw store&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;Paid - uses embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Store batch (≤100)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;memoclaw store --batch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.04&lt;/td&gt;
&lt;td&gt;Paid - cheapest way to import onboarding data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall / semantic search&lt;/td&gt;
&lt;td&gt;&lt;code&gt;memoclaw recall&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;$0.005&lt;/td&gt;
&lt;td&gt;Paid - every recall pulls semantic vectors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context / consolidate / migrate&lt;/td&gt;
&lt;td&gt;respective endpoints&lt;/td&gt;
&lt;td&gt;$0.01&lt;/td&gt;
&lt;td&gt;Paid - GPT-4o-mini + embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;List / get / delete / search (text)&lt;/td&gt;
&lt;td&gt;`memoclaw list&lt;/td&gt;
&lt;td&gt;get&lt;/td&gt;
&lt;td&gt;delete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stats / export / history / namespaces&lt;/td&gt;
&lt;td&gt;{% raw %}`memoclaw stats&lt;/td&gt;
&lt;td&gt;export&lt;/td&gt;
&lt;td&gt;history&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If an operation doesn't mention embeddings, assume it's free. Most builders still call {% raw %}&lt;code&gt;store&lt;/code&gt; on every message instead of batching the boring stuff. Use the free APIs to audit what already exists. Lean on list/export endpoints to keep a semantic search index ready for the next session. Your context window stays empty in the process.&lt;/p&gt;

&lt;h2&gt;
  
  
  A frugal memory architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user inbox -&amp;gt; session summarizer (free) -&amp;gt; batch payload builder -&amp;gt; memoclaw store --batch
                    |                                       ^
                    v                                       |
             memo audit cron --------------&amp;gt; memoclaw stats/export (free)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Session summarizer:&lt;/strong&gt; Run your OpenClaw agent's end-of-turn summary locally. Only the final summary hits MemoClaw, not the entire transcript.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch payload builder:&lt;/strong&gt; Accumulate low-importance notes until you have ~50 entries, then call &lt;code&gt;store --batch&lt;/code&gt;. That's $0.0008 per memory instead of $0.005.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memo audit cron:&lt;/strong&gt; Run a nightly cron that calls the free &lt;code&gt;stats&lt;/code&gt; and &lt;code&gt;export&lt;/code&gt; endpoints to check growth. Dedupe locally and delete junk without spending anything.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This setup burns maybe two paid calls per day: one batch store, one recall for high-signal context. Everything else rides free endpoints. Your agents still get semantic search across yesterday's work the moment they boot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Playbook to stay under 100 calls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gate recalls:&lt;/strong&gt; Cache the last recall result in your agent process. Only hit &lt;code&gt;recall&lt;/code&gt; when the cache is empty or stale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer keyword search first:&lt;/strong&gt; &lt;code&gt;memoclaw search "deployment" --tags infra&lt;/code&gt; is free. Only escalate to semantic recall if the keyword pass fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use importance scores aggressively:&lt;/strong&gt; Drop &lt;code&gt;importance&lt;/code&gt; to 0.2 for low-stakes memories so they rarely surface. Fewer recalls = fewer paid calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch migrations:&lt;/strong&gt; When importing old MEMORY.md files, chunk them into 100-line batches and pay $0.04 once instead of $0.005 × N.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin reusable knowledge:&lt;/strong&gt; Pinning doesn't cost extra but saves future recalls. Pinned items rise to the top, so one paid recall often carries the whole response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share a wallet for sub-agents:&lt;/strong&gt; Scout, fixer, and orchestrator patterns all hit the same namespace for free list/export calls. Multi-agent teams get shared persistence without multiplying costs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When the wallet swipe is worth it
&lt;/h2&gt;

&lt;p&gt;You should start paying when any of these show up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Team handoffs:&lt;/strong&gt; Multiple OpenClaw agents sharing one wallet are hammering recall all day. Pay for the reliability and stop rationing calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High-importance automations:&lt;/strong&gt; If a recall miss means a production incident, $0.005 is pocket change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous ingestion:&lt;/strong&gt; Background workers streaming tickets or metrics should just live on the paid tier to avoid batching delays.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You still dodge the context-tax no matter what tier you're on. That's why even paid recalls feel cheap compared to stuffing 20k tokens of MEMORY.md into every prompt. MemoClaw handles persistence; you decide when the embeddings bill is worth it.&lt;/p&gt;

&lt;p&gt;Until then, design around the free endpoints. MemoClaw's pricing is transparent. If you burn credits, it's because you chose to. Keep recalls intentional, batch the boring stores, and the 100 free calls will last longer than your prototype's runway.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>startup</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Memory-first agent design: store before you beg for context</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:31:06 +0000</pubDate>
      <link>https://dev.to/anajuliabit/memory-first-agent-design-store-before-you-beg-for-context-apg</link>
      <guid>https://dev.to/anajuliabit/memory-first-agent-design-store-before-you-beg-for-context-apg</guid>
      <description>&lt;h1&gt;
  
  
  Memory-first agent design: store before you beg for context
&lt;/h1&gt;

&lt;p&gt;Most agents wait until they're stuck to ask for context. By then it's too late. Store aggressively up front and recall only when you're sure the answer isn't already pinned. MemoClaw holds that context outside the prompt window, so you aren't shoving yesterday's notes into every request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two extremes (and why neither works alone)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Store-everything school.&lt;/strong&gt; Every user message, tool output, and summary gets pushed into MemoClaw with &lt;code&gt;store&lt;/code&gt;. You never miss data, but you blow through paid calls and bury the good stuff under throwaway chatter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recall-on-demand school.&lt;/strong&gt; The agent keeps a clean store but calls &lt;code&gt;recall&lt;/code&gt; constantly, even for facts it just learned. You save on storage but pay in latency and L2 fees.&lt;/p&gt;

&lt;p&gt;Great agents mix both. They store high-signal insights proactively, recall the rest on demand, and lean on semantic filters so only the right slice gets replayed across sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hybrid blueprint: score first, store second
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OpenClaw skill -&amp;gt; signal scorer -&amp;gt;
    if score &amp;gt;= 0.6 --&amp;gt; memoclaw store --importance &amp;lt;score&amp;gt;
    else --&amp;gt; pass
                      \
                       -&amp;gt; recall cache (TTL 5 min) -&amp;gt; memoclaw recall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Signal scorer:&lt;/strong&gt; Drop a tiny classifier in your system prompt. When the agent observes something, it outputs &lt;code&gt;memory_score&lt;/code&gt; between 0 and 1.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store pipeline:&lt;/strong&gt; Only call &lt;code&gt;memoclaw store&lt;/code&gt; when the score clears a bar (0.6 for user preferences, 0.8 for production facts). Tag aggressively so later recalls can filter by &lt;code&gt;--tags user-profile&lt;/code&gt; or &lt;code&gt;--tags infra&lt;/code&gt;. Keep namespaces scoped so cross-session fetches stay clean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall cache:&lt;/strong&gt; Keep a short-lived cache per namespace. If a question matches the last recall tags, reuse that payload before hitting MemoClaw.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Practical example: onboarding a new customer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;First call:&lt;/strong&gt; User says "I deploy everything to fly.io". Score = 0.85, so you store:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"Customer ACME deploys to fly.io, needs ARM images"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.85 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; customer:acme,deployments &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; onboarding
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Later task:&lt;/strong&gt; Agent needs deployment context. It runs &lt;code&gt;memoclaw recall --query "Where does ACME deploy?" --tags customer:acme&lt;/code&gt; once, caches the answer, and reuses it for the rest of the session.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Noise:&lt;/strong&gt; User asks "what's the Wi-Fi password?" Score = 0.1, so you don't store it. If it matters later, the agent can ask again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist for shipping memory-first agents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Define namespaces per workflow (&lt;code&gt;sales&lt;/code&gt;, &lt;code&gt;support&lt;/code&gt;, &lt;code&gt;ops&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Teach your agent to emit an &lt;code&gt;importance&lt;/code&gt; score with every observation.&lt;/li&gt;
&lt;li&gt;Batch low-score notes nightly. That keeps the store lean and prevents context window waste.&lt;/li&gt;
&lt;li&gt;Gate every recall behind a cheap keyword search first.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;memoclaw stats --namespace support&lt;/code&gt; daily so you spot drift before it pollutes future recalls. Lean on semantic recall to pull only what matters for each new session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you design storage rules before shipping, your agent stops hoarding junk yet still remembers the vital stuff across sessions. MemoClaw's importance scoring plus OpenClaw's tool hooks make this hybrid trivial - you just have to wire it in.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>architecture</category>
      <category>productivity</category>
    </item>
    <item>
      <title>One wallet, many agents, one brain</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Wed, 18 Mar 2026 23:31:00 +0000</pubDate>
      <link>https://dev.to/anajuliabit/one-wallet-many-agents-one-brain-50mk</link>
      <guid>https://dev.to/anajuliabit/one-wallet-many-agents-one-brain-50mk</guid>
      <description>&lt;h1&gt;
  
  
  One wallet, many agents, one brain
&lt;/h1&gt;

&lt;p&gt;Spawning sub-agents in OpenClaw is easy. Getting them to share what they learn is the annoying part. MemoClaw ties memory to your wallet, so any agent that signs with that wallet writes to the same space. Scouts can drop discoveries, fixers can log outcomes, and the lead agent recalls it all without syncing files or stuffing prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-agent wiring diagram
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;scout agent (wallet W) ---- store --&amp;gt; MemoClaw namespace:research
                       \
fixer agent (wallet W) ---- store --&amp;gt; MemoClaw namespace:fixes
                         \
 orchestrator (wallet W) -- recall --&amp;gt; research + fixes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scout:&lt;/strong&gt; Crawls docs, summarizes findings, and stores them with tags like &lt;code&gt;source:docs&lt;/code&gt; or &lt;code&gt;topic:auth&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixer:&lt;/strong&gt; Closes incidents, then logs results with tags such as &lt;code&gt;incident:123&lt;/code&gt; or &lt;code&gt;status:done&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lead agent:&lt;/strong&gt; Runs &lt;code&gt;memoclaw recall --tags topic:auth --namespace research&lt;/code&gt; before assigning more work, so it reuses what the scout already wrote.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the wallet is the identity, setup ends after you fund the same x402 address. Everyone shares the same semantic memory and you never bolt on a side database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fund the wallet once.&lt;/strong&gt; One Base wallet covers the lead agent and every child agent. No keys to rotate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Name your spaces.&lt;/strong&gt; Give each sub-agent a namespace such as &lt;code&gt;research&lt;/code&gt;, &lt;code&gt;fixes&lt;/code&gt;, or &lt;code&gt;handoff&lt;/code&gt; so recalls stay targeted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agree on tags.&lt;/strong&gt; Use tags like &lt;code&gt;incident:&amp;lt;id&amp;gt;&lt;/code&gt; or &lt;code&gt;customer:&amp;lt;slug&amp;gt;&lt;/code&gt; so every recall filter is predictable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch the scout's notes.&lt;/strong&gt; Let the scout buffer each doc, then call &lt;code&gt;store --batch&lt;/code&gt; to cut paid calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall with filters.&lt;/strong&gt; The lead agent can merge namespaces on the fly: &lt;code&gt;memoclaw recall --query "latest auth changes" --namespaces research,fixes&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Example handoff flow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Scout finishes crawling the docs and writes:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"Auth callback now requires PKCE for partners"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; topic:auth,release:2026-03,source:docs &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; research &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Lead agent spins up a fixer. Before writing a script, it fetches the scout's findings:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw recall &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"auth partner changes"&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; research &lt;span class="nt"&gt;--tags&lt;/span&gt; topic:auth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Fixer ships the change and locks the outcome for future shifts:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"PKCE enforcement shipped to staging"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tags&lt;/span&gt; incident:482,status:done &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; fixes &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No message bus, no shared database, and no exploding prompt windows. The wallet binds every agent together. MemoClaw stores the collective brain, and OpenClaw's spawn API just works. Once you try it, you'll never go back to emailing JSON between agents.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>web3</category>
    </item>
    <item>
      <title>Namespace strategies for multi-project OpenClaw agents</title>
      <dc:creator>Ana Julia Bittencourt </dc:creator>
      <pubDate>Wed, 18 Mar 2026 12:49:14 +0000</pubDate>
      <link>https://dev.to/anajuliabit/namespace-strategies-for-multi-project-openclaw-agents-3de6</link>
      <guid>https://dev.to/anajuliabit/namespace-strategies-for-multi-project-openclaw-agents-3de6</guid>
      <description>&lt;p&gt;When you first start using MemoClaw, you throw everything into the default namespace. Preferences, project notes, random facts your human mentioned once. It works.&lt;/p&gt;

&lt;p&gt;Then you add a second project. Then a third. Then you realize your agent is recalling deployment notes for Project A while you're asking about Project B, and the context is wrong in ways that are hard to debug.&lt;/p&gt;

&lt;p&gt;Namespaces fix this. They're isolated memory spaces within your MemoClaw account. Memories in one namespace can't leak into another. Same wallet, completely separate recall.&lt;/p&gt;

&lt;p&gt;The question isn't whether to use them. It's how to structure them so they actually help instead of creating a different kind of mess.&lt;/p&gt;

&lt;h2&gt;
  
  
  What namespaces actually do
&lt;/h2&gt;

&lt;p&gt;A namespace is just a label that isolates a group of memories. When your agent calls &lt;code&gt;memoclaw recall&lt;/code&gt;, it searches within a single namespace. No cross-namespace results unless you explicitly query multiple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Store to a specific namespace&lt;/span&gt;
memoclaw store &lt;span class="s2"&gt;"Uses Railway for deploys"&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; content-engine

&lt;span class="c"&gt;# Recall from that namespace only&lt;/span&gt;
memoclaw recall &lt;span class="s2"&gt;"deployment setup"&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; content-engine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you don't specify a namespace, everything goes to &lt;code&gt;default&lt;/code&gt;. Fine for simple setups, noisy fast.&lt;/p&gt;

&lt;p&gt;There's no extra cost for namespaces. You can have as many as you want. Namespaces are just metadata on each memory, so the only cost is the store/recall calls themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  One namespace per project
&lt;/h2&gt;

&lt;p&gt;The most common pattern. Each codebase or project gets its own namespace.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;default          → personal preferences, general knowledge
content-engine   → blog workflow, content pipeline details
trading-bot      → exchange APIs, risk parameters
home-automation  → device names, room layouts, routines
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works well when you have 2-5 distinct projects and your agent switches between them in different conversations.&lt;/p&gt;

&lt;p&gt;Where it breaks: overlapping projects. Maybe your content-engine deploys the same way as your trading-bot. Storing "Uses Railway" in both namespaces means maintaining the same fact in two places. It'll drift.&lt;/p&gt;

&lt;p&gt;Fix: keep shared infrastructure knowledge in &lt;code&gt;default&lt;/code&gt; and project-specific details in their namespaces. Your agent queries &lt;code&gt;default&lt;/code&gt; first, then the project namespace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shared + project namespaces
&lt;/h2&gt;

&lt;p&gt;A refinement of the above. You explicitly separate shared context from project-specific context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shared           → deployment patterns, coding standards, tool preferences
project-alpha    → project-specific architecture, team contacts
project-beta     → different stack, different team
personal         → human preferences, communication style, schedule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your agent's recall flow becomes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Always recall from &lt;code&gt;personal&lt;/code&gt; (preferences affect every interaction)&lt;/li&gt;
&lt;li&gt;Always recall from &lt;code&gt;shared&lt;/code&gt; (common tools and patterns)&lt;/li&gt;
&lt;li&gt;Recall from the active project namespace&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This costs more calls per interaction, up to 3 recalls instead of 1. Each recall is $0.005, so three per interaction is $0.015. Still cheap. Context quality goes up noticeably.&lt;/p&gt;

&lt;p&gt;You can bake this directly into your agent config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Memory recall pattern&lt;/span&gt;

For every task:
&lt;span class="p"&gt;1.&lt;/span&gt; Recall from "personal" namespace for communication preferences
&lt;span class="p"&gt;2.&lt;/span&gt; Recall from "shared" namespace for general technical context
&lt;span class="p"&gt;3.&lt;/span&gt; Identify the active project and recall from its namespace
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Client-based namespaces
&lt;/h2&gt;

&lt;p&gt;If you're freelancing or consulting, organize by client instead of project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;client-acme      → Acme Corp preferences, contacts, project history
client-initech   → Initech codebase details, meeting notes
internal         → your own projects and preferences
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Client contexts rarely overlap, so this gives you clean separation without much discipline required.&lt;/p&gt;

&lt;p&gt;One thing to watch: when you stop working with a client, their namespace still exists. Export it with &lt;code&gt;memoclaw export --namespace client-acme&lt;/code&gt; (free endpoint) and then bulk delete if you want to clean up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment-based namespaces
&lt;/h2&gt;

&lt;p&gt;For agents that behave differently depending on context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;work             → professional communication style, work projects
personal         → casual tone, personal projects, home stuff
discord-server   → community context, member names, channel purposes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Less about data separation, more about behavioral context. Your agent recalls from &lt;code&gt;work&lt;/code&gt; and gets "Keep responses professional, use formal language." Recalls from &lt;code&gt;personal&lt;/code&gt; and gets "Be casual, use humor."&lt;/p&gt;

&lt;p&gt;Some people combine this with project namespaces using a convention like &lt;code&gt;work/project-alpha&lt;/code&gt; as the namespace name. MemoClaw doesn't enforce hierarchy in names, but the slash convention keeps things readable in the CLI output.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to skip namespaces
&lt;/h2&gt;

&lt;p&gt;If your agent does one thing, for one person, on one project, a single namespace with good tags might be enough.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"Deploy command: railway up"&lt;/span&gt; &lt;span class="nt"&gt;--tags&lt;/span&gt; infra,deploy
memoclaw store &lt;span class="s2"&gt;"Human prefers dark mode"&lt;/span&gt; &lt;span class="nt"&gt;--tags&lt;/span&gt; preferences,ui
memoclaw recall &lt;span class="s2"&gt;"how do we deploy"&lt;/span&gt; &lt;span class="nt"&gt;--tags&lt;/span&gt; infra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tags filter within a namespace. They're lighter-weight than namespaces and don't require deciding which namespace to query.&lt;/p&gt;

&lt;p&gt;Rule of thumb: under 200 memories and one main project, tags are enough. Over 200 or multiple distinct contexts, add namespaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Naming conventions
&lt;/h2&gt;

&lt;p&gt;Your agent constructs these strings programmatically, so predictability matters.&lt;/p&gt;

&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;content-engine
trading-bot
client-acme
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Content Engine
my_trading_bot_v2
ACME Corp Client (2026)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lowercase, kebab-case. No spaces, no special characters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating between namespace strategies
&lt;/h2&gt;

&lt;p&gt;Already have memories in the wrong namespaces? Here's the approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Export the old namespace:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   memoclaw &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; old-name &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; backup.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Export is free.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Re-store in the new namespace.&lt;/strong&gt; There's no "move" command. You'll need to store the memories again. Use batch store for up to 100 at once ($0.04) to keep costs down.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Delete from the old namespace:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   memoclaw bulk-delete &lt;span class="nt"&gt;--namespace&lt;/span&gt; old-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bulk delete is also free.&lt;/p&gt;

&lt;p&gt;It's manual, but namespace restructuring is a one-time thing. Better to do it once than live with a confusing structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-agent namespaces
&lt;/h2&gt;

&lt;p&gt;If multiple agents share the same wallet, they share access to all namespaces. You can use this intentionally.&lt;/p&gt;

&lt;p&gt;Three agents: coding agent, review agent, documentation agent. Same wallet, different namespaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code-context     → coding agent stores architectural decisions
review-notes     → review agent stores patterns and issues found
docs-context     → docs agent stores style guides and terminology
shared           → all agents read from here for project-wide context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each agent writes to its own namespace and reads from &lt;code&gt;shared&lt;/code&gt; plus its own. The coding agent doesn't get confused by documentation style notes. The docs agent doesn't see low-level implementation details.&lt;/p&gt;

&lt;p&gt;To share something across all agents, any of them can store to &lt;code&gt;shared&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;memoclaw store &lt;span class="s2"&gt;"Project switched from REST to GraphQL as of March 2026"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--namespace&lt;/span&gt; shared &lt;span class="nt"&gt;--importance&lt;/span&gt; 0.8 &lt;span class="nt"&gt;--tags&lt;/span&gt; architecture
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three agents pick this up on their next recall from &lt;code&gt;shared&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to actually do
&lt;/h2&gt;

&lt;p&gt;For most OpenClaw users:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with &lt;code&gt;default&lt;/code&gt; namespace and tags&lt;/li&gt;
&lt;li&gt;When you add a second project that's clearly separate, create a namespace for it&lt;/li&gt;
&lt;li&gt;Move personal preferences to a &lt;code&gt;personal&lt;/code&gt; namespace so they're always available regardless of project&lt;/li&gt;
&lt;li&gt;Don't create namespaces preemptively. Create them when you feel the pain of mixed context&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is less noise in recall, not a perfect taxonomy. Keep it practical.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking what you've got
&lt;/h2&gt;

&lt;p&gt;A few free endpoints for namespace management:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# List all your namespaces&lt;/span&gt;
memoclaw namespaces

&lt;span class="c"&gt;# See memory count and stats&lt;/span&gt;
memoclaw stats

&lt;span class="c"&gt;# List memories in a specific namespace&lt;/span&gt;
memoclaw list &lt;span class="nt"&gt;--namespace&lt;/span&gt; content-engine

&lt;span class="c"&gt;# Export everything for backup&lt;/span&gt;
memoclaw &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;--namespace&lt;/span&gt; content-engine &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; backup.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All free. No embeddings, no cost against your 100 free-tier calls.&lt;/p&gt;

&lt;p&gt;Start simple, add structure when you need it, use the free endpoints to keep track of what's where.&lt;/p&gt;

</description>
      <category>openclaw</category>
      <category>memoclaw</category>
      <category>agents</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
