12 lines
6.1 KiB
JavaScript
12 lines
6.1 KiB
JavaScript
import{c as e,Q as a,j as t,m as i}from"./chunks/framework.BPKcPtvA.js";const c=JSON.parse('{"title":"Agent Memory: Mental Models That Compound","description":"","frontmatter":{},"headers":[],"relativePath":"blog/posts/mental-models.md","filePath":"blog/posts/mental-models.md","lastUpdated":1780488472000}'),n={name:"blog/posts/mental-models.md"};function l(o,s,h,p,r,d){return a(),t("div",null,[...s[0]||(s[0]=[i(`<h1 id="agent-memory-mental-models-that-compound" tabindex="-1">Agent Memory: Mental Models That Compound <a class="header-anchor" href="#agent-memory-mental-models-that-compound" aria-label="Permalink to "Agent Memory: Mental Models That Compound""></a></h1><p><strong>June 9, 2026</strong></p><p>The biggest problem with agents is they forget. Every session starts from zero. Mental models solve this.</p><h2 id="what-a-mental-model-is" tabindex="-1">What a Mental Model Is <a class="header-anchor" href="#what-a-mental-model-is" aria-label="Permalink to "What a Mental Model Is""></a></h2><p>A YAML file that the agent owns. It reads it at startup and updates it after work:</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">expertise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">topic</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"API patterns"</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> notes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"We use tRPC for type-safe API calls"</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> evidence</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"src/server/routers/*.ts"</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> confidence</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">HIGH</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> last_updated</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"2026-05-24"</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">observations</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">failure_pattern</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> observation</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"WebSocket reconnection needs backoff"</span></span>
|
||
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> status</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">unaddressed</span></span></code></pre></div><h2 id="the-rules" tabindex="-1">The Rules <a class="header-anchor" href="#the-rules" aria-label="Permalink to "The Rules""></a></h2><ol><li><p><strong>Agents own their mental models.</strong> You do not touch them. The agent reads, writes, and updates its own expertise file.</p></li><li><p><strong>Self-improve commands validate against the codebase.</strong> The agent greps for evidence, checks if its knowledge is still accurate, and updates stale entries.</p></li><li><p><strong>Read-only expertise for critical knowledge.</strong> Billing workflows, deployment procedures, and security policies should never change.</p></li><li><p><strong>Knowledge compounds across sessions.</strong> Session 1: agent learns project structure. Session 2: learns common patterns. Session 3: learns failure modes. By session N, it operates at a senior engineer level for that codebase.</p></li></ol><h2 id="the-self-improve-loop" tabindex="-1">The Self-Improve Loop <a class="header-anchor" href="#the-self-improve-loop" aria-label="Permalink to "The Self-Improve Loop""></a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">just</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> self-improve-backend</span></span></code></pre></div><p>This command triggers the agent to scan the codebase, validate its expertise against actual file contents, and update anything that has drifted.</p><h2 id="why-this-matters" tabindex="-1">Why This Matters <a class="header-anchor" href="#why-this-matters" aria-label="Permalink to "Why This Matters""></a></h2><p>Without mental models, every agent session is Day 1. The agent rediscovers the same things repeatedly: "Oh, this project uses tRPC. Oh, tests go in the tests directory. Oh, we deploy via Docker." Mental models turn every session into Day 100.</p><hr><p><em>From Module 4 of the <a href="/">Agentic Engineering Course</a>. The full module covers multi-agent systems with domain locking, delegation, and P2P communication.</em></p>`,15)])])}const g=e(n,[["render",l]]);export{c as __pageData,g as default};
|