<?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>Forem: musecl</title>
    <description>The latest articles on Forem by musecl (@musecl_0bae2b19be982f944b).</description>
    <link>https://forem.com/musecl_0bae2b19be982f944b</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%2F3772041%2F5485f94c-01c0-4b2a-869a-06d0caa86f44.png</url>
      <title>Forem: musecl</title>
      <link>https://forem.com/musecl_0bae2b19be982f944b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/musecl_0bae2b19be982f944b"/>
    <language>en</language>
    <item>
      <title>The package.json Pattern for AI Agent Memory</title>
      <dc:creator>musecl</dc:creator>
      <pubDate>Tue, 17 Feb 2026 14:23:43 +0000</pubDate>
      <link>https://forem.com/musecl_0bae2b19be982f944b/the-packagejson-pattern-for-ai-agent-memory-470k</link>
      <guid>https://forem.com/musecl_0bae2b19be982f944b/the-packagejson-pattern-for-ai-agent-memory-470k</guid>
      <description>&lt;p&gt;Your agent learned 500 things last month. Then the disk died.&lt;/p&gt;

&lt;p&gt;This isn't hypothetical — it happened to me. Months of accumulated corrections, preferences, and domain expertise, gone because I treated agent memory like disposable state instead of valuable data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Portability Gap
&lt;/h2&gt;

&lt;p&gt;If you're running AI agents that learn over time, you've probably noticed a gap in the tooling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud memory APIs&lt;/strong&gt; — portable, but your agent's knowledge lives on someone else's servers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local-only systems&lt;/strong&gt; — private, but one hardware failure away from zero&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Protocol-based services&lt;/strong&gt; — great architecture, but not portable across machines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I wanted was simple: &lt;strong&gt;private, portable, auditable, and free.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Pattern You Already Know
&lt;/h2&gt;

&lt;p&gt;Every developer intuitively understands this separation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package.json    → syncs via git
node_modules/   → rebuilds locally from package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Agent memory has the same structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MEMORY.md       → syncs via git (source of truth)
vectordb/       → rebuilds locally from MEMORY.md (derived artifact)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source files are human-readable text — Markdown and JSON. They diff cleanly, version naturally, and merge without conflicts. Vector indexes are binary blobs that depend on your local embedding model. They should never touch git.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;The implementation is a single bash script (~200 lines) that does three things:&lt;/p&gt;

&lt;h3&gt;
  
  
  Push: Local → Git
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Compare workspace files against sync repo by content hash (skip unchanged)&lt;/li&gt;
&lt;li&gt;Copy changed &lt;code&gt;.md&lt;/code&gt; and &lt;code&gt;.json&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;Scan for secrets — abort if API keys found&lt;/li&gt;
&lt;li&gt;Commit and push&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pull: Git → Local
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;git pull --ff-only&lt;/code&gt; (fails loudly if diverged — protects local changes)&lt;/li&gt;
&lt;li&gt;Copy files to agent workspaces with 600 permissions&lt;/li&gt;
&lt;li&gt;Rebuild vector indexes for agents that received changes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Status
&lt;/h3&gt;

&lt;p&gt;Bidirectional drift check — shows files that exist locally but aren't synced, and vice versa.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Synced (and What Doesn't)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Synced&lt;/th&gt;
&lt;th&gt;Not Synced&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;*.md&lt;/code&gt; — Memory documents&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;*.sqlite&lt;/code&gt; — Vector indexes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;*.json&lt;/code&gt; — Structured data&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;vectordb/&lt;/code&gt; — Embedding stores&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.gitignore&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;*.jsonl&lt;/code&gt; — Session transcripts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sync.sh&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;*.key&lt;/code&gt;, &lt;code&gt;*.pem&lt;/code&gt;, &lt;code&gt;*.env&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;.gitignore&lt;/code&gt; does the heavy lifting here. Secrets and binary artifacts stay local. Only human-readable source files travel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Agent, Multi-Machine
&lt;/h2&gt;

&lt;p&gt;This pattern scales naturally. Each agent gets its own directory in the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;security-auditor/MEMORY.md
growth-engine/MEMORY.md
content-moderator/MEMORY.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Security knowledge doesn't pollute architecture patterns. And because it's just git, syncing across machines is a push/pull away.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Secret Scanning Part
&lt;/h2&gt;

&lt;p&gt;The scariest thing about syncing agent memory to git is accidentally pushing API keys. The script runs a regex scan before every commit — looks for common key patterns (&lt;code&gt;sk-&lt;/code&gt;, &lt;code&gt;ghp_&lt;/code&gt;, &lt;code&gt;Bearer&lt;/code&gt;, base64 blobs) and aborts if anything looks suspicious.&lt;/p&gt;

&lt;p&gt;Not bulletproof, but it catches the obvious mistakes that would otherwise end up in your git history forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;The repo is MIT-licensed: &lt;a href="https://github.com/musecl/musecl-memory" rel="noopener noreferrer"&gt;github.com/musecl/musecl-memory&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's a bash script, not a framework. No dependencies beyond git. Works with any agent system that stores memory as files — Claude, GPT, local models, whatever.&lt;/p&gt;

&lt;p&gt;If you're running agents that accumulate knowledge, I'm curious: how are you handling persistence today? The tooling landscape is still early, and I think there's a lot of room for different approaches.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>git</category>
      <category>devops</category>
    </item>
    <item>
      <title>I Built a Zero-Dependency Memory System for AI Agents in 200 Lines of Bash</title>
      <dc:creator>musecl</dc:creator>
      <pubDate>Sat, 14 Feb 2026 04:16:11 +0000</pubDate>
      <link>https://forem.com/musecl_0bae2b19be982f944b/i-built-a-zero-dependency-memory-system-for-ai-agents-in-200-lines-of-bash-4m67</link>
      <guid>https://forem.com/musecl_0bae2b19be982f944b/i-built-a-zero-dependency-memory-system-for-ai-agents-in-200-lines-of-bash-4m67</guid>
      <description>&lt;h1&gt;
  
  
  I Built a Zero-Dependency Memory System for AI Agents in 200 Lines of Bash
&lt;/h1&gt;

&lt;p&gt;Most AI agent memory solutions require databases, vector stores, or cloud services. I wanted something simpler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;musecl-memory&lt;/strong&gt; is a file-based memory sync system for AI agents. No dependencies. No databases. Just bash, git, and markdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;AI agents forget everything between sessions. The standard solutions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vector databases (Pinecone, Weaviate, ChromaDB)&lt;/li&gt;
&lt;li&gt;Cloud memory services (Mem0, Letta)&lt;/li&gt;
&lt;li&gt;Custom embeddings pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These work, but they're overkill for many use cases. If your agent just needs to remember decisions, preferences, and context across sessions — you don't need a vector DB. You need a file and a sync script.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Each agent gets a directory. Each directory has a &lt;code&gt;MEMORY.md&lt;/code&gt; file. A single bash script syncs them to a git repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;agents/
  researcher/MEMORY.md
  coder/MEMORY.md
  reviewer/MEMORY.md
sync.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. The &lt;code&gt;MEMORY.md&lt;/code&gt; files are plain markdown — agents read them at session start and write findings back. &lt;code&gt;sync.sh&lt;/code&gt; handles git add/commit/push with conflict detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Works
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Agents already understand markdown.&lt;/strong&gt; No serialization, no schema, no ORM. An agent reads a markdown file the same way it reads a prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Git gives you versioning for free.&lt;/strong&gt; Every memory change is a commit. You can diff, revert, branch, and merge memories the same way you manage code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Zero vendor lock-in.&lt;/strong&gt; Switch LLM providers, agent frameworks, or hosting — your memory files are just text in a git repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. It scales.&lt;/strong&gt; Whether you have 2 agents or 50, the pattern is the same. Sync takes under 2 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  How sync.sh Works
&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;# Detect all agent directories&lt;/span&gt;
&lt;span class="c"&gt;# For each: check if MEMORY.md changed&lt;/span&gt;
&lt;span class="c"&gt;# Stage changes, commit with timestamp&lt;/span&gt;
&lt;span class="c"&gt;# Push to remote (handles conflicts with pull --rebase)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Drift detection&lt;/strong&gt;: Warns if local and remote diverge&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic commits&lt;/strong&gt;: One commit per sync, not per file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflict-safe&lt;/strong&gt;: Uses rebase strategy to avoid merge commits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Idempotent&lt;/strong&gt;: Running it twice with no changes is a no-op&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example Use Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;code review&lt;/strong&gt; agent that remembers past findings and checks for regressions&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;research&lt;/strong&gt; agent that accumulates knowledge across sessions&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;planning&lt;/strong&gt; agent that tracks decisions and their rationale&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;personal assistant&lt;/strong&gt; that learns preferences over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each agent reads its &lt;code&gt;MEMORY.md&lt;/code&gt; at the start of every session. No cold starts. Full continuity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/musecl/musecl-memory.git
&lt;span class="nb"&gt;cd &lt;/span&gt;musecl-memory

&lt;span class="c"&gt;# Create an agent&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; agents/my-agent
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; agents/my-agent/MEMORY.md &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;'
# My Agent Memory
## Decisions
- Started tracking on 2026-02-13
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# Sync&lt;/span&gt;
./sync.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Compared to Alternatives
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;musecl-memory&lt;/th&gt;
&lt;th&gt;Mem0&lt;/th&gt;
&lt;th&gt;Letta&lt;/th&gt;
&lt;th&gt;Vector DB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dependencies&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Python + API&lt;/td&gt;
&lt;td&gt;Python + DB&lt;/td&gt;
&lt;td&gt;DB + embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup time&lt;/td&gt;
&lt;td&gt;30 sec&lt;/td&gt;
&lt;td&gt;10+ min&lt;/td&gt;
&lt;td&gt;15+ min&lt;/td&gt;
&lt;td&gt;20+ min&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Free tier / paid&lt;/td&gt;
&lt;td&gt;Free tier / paid&lt;/td&gt;
&lt;td&gt;Varies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Privacy&lt;/td&gt;
&lt;td&gt;100% local&lt;/td&gt;
&lt;td&gt;Cloud&lt;/td&gt;
&lt;td&gt;Cloud/local&lt;/td&gt;
&lt;td&gt;Varies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Versioning&lt;/td&gt;
&lt;td&gt;Git (built-in)&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;td&gt;Manual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Framework lock-in&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Mem0 SDK&lt;/td&gt;
&lt;td&gt;Letta SDK&lt;/td&gt;
&lt;td&gt;DB-specific&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  When NOT to Use This
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You need semantic search across thousands of memories → use a vector DB&lt;/li&gt;
&lt;li&gt;You need real-time memory sharing between concurrent agents → use a database&lt;/li&gt;
&lt;li&gt;You need sub-document granularity with embeddings → use Mem0 or similar&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;musecl-memory is for the 80% of cases where agents just need persistent, versioned, human-readable context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/musecl/musecl-memory" rel="noopener noreferrer"&gt;musecl/musecl-memory&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;License&lt;/strong&gt;: CC BY-NC-SA 4.0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Examples&lt;/strong&gt;: Included in the repo&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Would love feedback. What's your current approach to agent memory?&lt;/p&gt;

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