<?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: frog404</title>
    <description>The latest articles on DEV Community by frog404 (@frog404).</description>
    <link>https://dev.to/frog404</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4007658%2F802e1aa8-58a6-4c4d-8a8a-d6fbc9795738.png</url>
      <title>DEV Community: frog404</title>
      <link>https://dev.to/frog404</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/frog404"/>
    <language>en</language>
    <item>
      <title>I built an AI-friendly knowledge base so coding agents stop forgetting project context</title>
      <dc:creator>frog404</dc:creator>
      <pubDate>Thu, 02 Jul 2026 13:49:58 +0000</pubDate>
      <link>https://dev.to/frog404/i-built-an-ai-friendly-knowledge-base-so-coding-agents-stop-forgetting-project-context-onc</link>
      <guid>https://dev.to/frog404/i-built-an-ai-friendly-knowledge-base-so-coding-agents-stop-forgetting-project-context-onc</guid>
      <description>&lt;p&gt;I have 20+ personal projects. Every time I start a new AI session, I have to re-explain the project structure, what was decided last time, and what to do next. Switching between Claude Code, Codex, and other tools makes it worse — the context doesn't follow.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/iwabuchi404/context-mixer" rel="noopener noreferrer"&gt;&lt;strong&gt;ContextMixer&lt;/strong&gt;&lt;/a&gt; to fix this: a knowledge base where AI agents search, read, and update project documents through MCP or REST API, and humans review them in a web UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not Notion / Obsidian / local Markdown?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Local Markdown + Git&lt;/strong&gt; worked for CLI agents but couldn't be accessed from chat-based tools like Claude.ai.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Notion&lt;/strong&gt; had MCP support, but fetching pages was slow and token-heavy. Its rich block structure is great for humans but inefficient for AI access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Obsidian&lt;/strong&gt; is local-first, which rules out chat-based access.&lt;/p&gt;

&lt;p&gt;I needed something accessible from both chat and CLI, lightweight for AI, and editable by humans. Nothing fit, so I built my own. It runs on Cloudflare Workers + D1 + R2, entirely within the free tier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progressive retrieval
&lt;/h2&gt;

&lt;p&gt;The core design idea: agents choose how much to read.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;View&lt;/th&gt;
&lt;th&gt;Returns&lt;/th&gt;
&lt;th&gt;Tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;meta&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;title + summary&lt;/td&gt;
&lt;td&gt;tens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;outline&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;heading structure&lt;/td&gt;
&lt;td&gt;hundreds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;section&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;one specific section&lt;/td&gt;
&lt;td&gt;hundreds–thousands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;full&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;entire document&lt;/td&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A typical flow for "check the auth design":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. list_docs(collection_id)        → document list with metadata
2. get_doc(doc_id, view="outline") → heading structure
3. get_doc(doc_id, view="section", section="Auth") → just what's needed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three API calls, but hundreds of tokens instead of thousands. Most queries resolve at &lt;code&gt;meta&lt;/code&gt; → &lt;code&gt;section&lt;/code&gt; without ever reading the full document.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Cortex: structuring project memory
&lt;/h2&gt;

&lt;p&gt;ContextMixer is a generic container. The structure is up to you.&lt;/p&gt;

&lt;p&gt;I keep four documents per project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;context&lt;/strong&gt; — current phase, recent work, unresolved issues, handoff notes for the next session&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;spec&lt;/strong&gt; — confirmed goals, requirements, tech stack (nothing tentative)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;decisions&lt;/strong&gt; — design choices with reasoning, including rejected alternatives&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;notes&lt;/strong&gt; — library pitfalls, bug workarounds, implementation tips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I call this pattern &lt;strong&gt;AI Cortex&lt;/strong&gt;. The agent reads &lt;code&gt;context&lt;/code&gt; at session start and updates it at the end. The next session picks up where the last one left off.&lt;/p&gt;

&lt;p&gt;The biggest win: I no longer re-explain previous sessions. The agent reads &lt;code&gt;context&lt;/code&gt; and resumes. &lt;code&gt;decisions&lt;/code&gt; also helps — "why did we drop Vue?" is answered by the document, not by me repeating myself.&lt;/p&gt;

&lt;p&gt;But letting AI write to a knowledge base has risks. Without rules, agents write tentative ideas into &lt;code&gt;spec&lt;/code&gt;, create unconfirmed decisions, or duplicate documents. Writing permissions aren't enough — you need writing &lt;em&gt;rules&lt;/em&gt;. In my setup, CLAUDE.md specifies things like "don't write to &lt;code&gt;decisions&lt;/code&gt; without user confirmation" and "search before creating new documents." Still a work in progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  Karpathy's LLM Wiki
&lt;/h2&gt;

&lt;p&gt;After I started building ContextMixer, I came across Karpathy's LLM Wiki pattern — where an LLM builds and maintains a structured wiki from raw sources instead of doing RAG lookups every time.&lt;/p&gt;

&lt;p&gt;It resonated, but the use cases differ. LLM Wiki is a research library: accumulate and organize what you've read. ContextMixer is a project whiteboard: manage ongoing work across sessions, tools, and access points.&lt;/p&gt;

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

&lt;p&gt;📦 &lt;a href="https://github.com/iwabuchi404/context-mixer" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;br&gt;
🔗 &lt;a href="https://context-mixer.frog404.work" rel="noopener noreferrer"&gt;Demo&lt;/a&gt;&lt;br&gt;
📄 &lt;a href="https://frog404.work/projects/context-mixer/" rel="noopener noreferrer"&gt;Project page (detailed design notes)&lt;/a&gt;&lt;br&gt;
📝 &lt;a href="https://zenn.dev/frogworks404/articles/50e2c51734b523?locale=en" rel="noopener noreferrer"&gt;Japanese article on Zenn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI agents don't need to remember everything. They need a good place to read from.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>cloudflarechallenge</category>
    </item>
  </channel>
</rss>
