<?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: goyohan0611-png</title>
    <description>The latest articles on DEV Community by goyohan0611-png (@goyohan0611png).</description>
    <link>https://dev.to/goyohan0611png</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%2F4193097%2F5a06e915-c8ee-45ac-be95-a08fa470454b.png</url>
      <title>DEV Community: goyohan0611-png</title>
      <link>https://dev.to/goyohan0611png</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/goyohan0611png"/>
    <language>en</language>
    <item>
      <title>I changed one embedding model and my agent memory needed 8x fewer tokens for the same accuracy</title>
      <dc:creator>goyohan0611-png</dc:creator>
      <pubDate>Fri, 30 Oct 2026 04:19:44 +0000</pubDate>
      <link>https://dev.to/goyohan0611png/i-changed-one-embedding-model-and-my-agent-memory-needed-8x-fewer-tokens-for-the-same-accuracy-2hi7</link>
      <guid>https://dev.to/goyohan0611png/i-changed-one-embedding-model-and-my-agent-memory-needed-8x-fewer-tokens-for-the-same-accuracy-2hi7</guid>
      <description>&lt;p&gt;I build &lt;a href="https://github.com/goyohan0611-png/turnbook" rel="noopener noreferrer"&gt;Turnbook&lt;/a&gt;, a local memory for coding agents. It saves every turn from Claude Code, Codex, Cursor, Copilot CLI, Gemini CLI and OpenCode word for word into one SQLite file on your PC, and when a question needs the past it hands the agent a short evidence packet. Saving calls no model, so it costs no tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fgoyohan0611-png%2Fturnbook%2Fmain%2Fdemo%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fgoyohan0611-png%2Fturnbook%2Fmain%2Fdemo%2Fdemo.gif" alt="Claude Code saves a decision, and Codex, a different app, recalls it (live recording)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the 0.10 release I swapped the search model from multilingual mpnet to &lt;a href="https://huggingface.co/google/embeddinggemma-300m" rel="noopener noreferrer"&gt;EmbeddingGemma&lt;/a&gt; (4-bit ONNX, runs on CPU). I expected a small accuracy bump. What I got was mostly a token cut.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/xiaowu0162/LongMemEval" rel="noopener noreferrer"&gt;LongMemEval_S&lt;/a&gt;: 500 questions, each about a long chat history (~115k tokens). The memory searches the history, packs what it found into a bounded packet, and a reader model answers from the packet only.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reader: gpt-5-mini&lt;/li&gt;
&lt;li&gt;Judge: the benchmark's official gpt-4o prompt&lt;/li&gt;
&lt;li&gt;All 500 questions count. One question the reader never answers (it spends its whole output budget thinking) counts as wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only two things change between rows: the search model, and how big a packet the reader gets.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Search model&lt;/th&gt;
&lt;th&gt;Tokens the reader reads (median)&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;mpnet&lt;/td&gt;
&lt;td&gt;3.4k&lt;/td&gt;
&lt;td&gt;86.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mpnet&lt;/td&gt;
&lt;td&gt;6.7k&lt;/td&gt;
&lt;td&gt;89.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mpnet&lt;/td&gt;
&lt;td&gt;13.2k&lt;/td&gt;
&lt;td&gt;90.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;mpnet&lt;/td&gt;
&lt;td&gt;26.3k&lt;/td&gt;
&lt;td&gt;91.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;EmbeddingGemma&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.1k&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;91.8%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The old model reached 91.8% only when the reader got 26.3k tokens. EmbeddingGemma gets there with 3.1k.&lt;/p&gt;

&lt;p&gt;At the same packet size, the paired comparison is 33 questions only Gemma gets right vs 7 only mpnet gets right (exact McNemar p = 0.00004). The biggest move was multi-session questions, the ones that need facts from several different conversations: 73.6% → 88.4%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why fewer tokens, not just higher accuracy
&lt;/h2&gt;

&lt;p&gt;With a weaker search model, the right turn is often found but ranked 15th or 40th. The only way to get it in front of the reader is a bigger packet, so you pay for accuracy with tokens. A better search model puts the right turn near the top, so a small packet already contains it.&lt;/p&gt;

&lt;p&gt;On LoCoMo conversations the re-ranker never saw, "answer turn among the first 10 found" went from 70.2% to 83.7%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other things that changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Other languages.&lt;/strong&gt; Meaning-only search, Korean questions, answer in the top 30: 67.5% → 86.9%. A Korean question finds an English conversation 87.8% of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory use.&lt;/strong&gt; The memory server went from ~772 MB to ~525 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed.&lt;/strong&gt; Search is a bit slower: ~40 ms vs ~26 ms per query on a GitHub runner. I think that's a fine trade, but it is a trade.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The small learned re-ranker on top was trained on LoCoMo and LongMemEval together, so 91.8% is not a fully held-out score. On the 380 questions never used for tuning it is 91.1%.&lt;/li&gt;
&lt;li&gt;EmbeddingGemma is under Google's Gemma Terms of Use. Turnbook downloads it on first use; it isn't shipped in the package.&lt;/li&gt;
&lt;li&gt;Existing users' memories move to the new model in the background, at low priority; until that finishes, search keeps using the old model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every question, packet, answer and judge verdict is in the repo under &lt;code&gt;research/runs&lt;/code&gt;, so you can check any row.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;One command on Windows, macOS or Linux, no Python needed (see the README), or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;turnbook &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; turnbook-install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It registers itself as an MCP server with the agents it finds. In Claude Code, Codex and Copilot CLI it also adds relevant memory to every message automatically. Apache-2.0.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/goyohan0611-png/turnbook" rel="noopener noreferrer"&gt;https://github.com/goyohan0611-png/turnbook&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd like to hear from anyone who has measured other embedding models for agent memory, especially at small packet sizes.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>opensource</category>
      <category>llm</category>
    </item>
    <item>
      <title>95% recall, 80% answers: what LongMemEval retrieval scores don't tell you</title>
      <dc:creator>goyohan0611-png</dc:creator>
      <pubDate>Mon, 19 Oct 2026 02:35:25 +0000</pubDate>
      <link>https://dev.to/goyohan0611png/95-recall-80-answers-what-longmemeval-retrieval-scores-dont-tell-you-5dg4</link>
      <guid>https://dev.to/goyohan0611png/95-recall-80-answers-what-longmemeval-retrieval-scores-dont-tell-you-5dg4</guid>
      <description>&lt;p&gt;Memory layers for AI agents love to quote LongMemEval. You will see 94%, 95%, 96%. Those numbers are real, but they usually measure retrieval: &lt;em&gt;was one of the right sessions in the top 5 results?&lt;/em&gt; (recall_any@5). LongMemEval's own metric is different: &lt;em&gt;did the model answer the question correctly?&lt;/em&gt;, graded by a GPT-4o judge.&lt;/p&gt;

&lt;p&gt;I wanted to know how far apart those two numbers are, so I measured both on the same questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rohitg00/agentmemory" rel="noopener noreferrer"&gt;agentmemory&lt;/a&gt; reports &lt;strong&gt;95.2% R@5&lt;/strong&gt; on LongMemEval_S, and to its credit it says plainly that this is retrieval recall and not QA accuracy. It also publishes the sessions its hybrid search (BM25 + embeddings) returned for each of the 500 questions.&lt;/p&gt;

&lt;p&gt;So I took exactly those results, unchanged, pinned by commit and hash:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;For every question, the top 5 sessions agentmemory returned, every turn in full.&lt;/li&gt;
&lt;li&gt;The same answer model (gpt-5-mini), the same answer prompt.&lt;/li&gt;
&lt;li&gt;The official LongMemEval judge (gpt-4o-2024-08-06).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then I did the same with &lt;a href="https://github.com/goyohan0611-png/graph-mind" rel="noopener noreferrer"&gt;Graph-MIND&lt;/a&gt;, the memory layer I build, whose shipped retrieval returns a ~3.4k-token packet of individual turns.&lt;/p&gt;

&lt;p&gt;Only the retrieval differs. Same questions, same reader, same judge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;answer accuracy (499 Qs)&lt;/th&gt;
&lt;th&gt;never used for tuning (379)&lt;/th&gt;
&lt;th&gt;text the reader sees per question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;agentmemory (its top 5 sessions)&lt;/td&gt;
&lt;td&gt;80.4%&lt;/td&gt;
&lt;td&gt;78.6%&lt;/td&gt;
&lt;td&gt;~16.5k tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Graph-MIND&lt;/td&gt;
&lt;td&gt;89.0%&lt;/td&gt;
&lt;td&gt;87.1%&lt;/td&gt;
&lt;td&gt;~3.4k tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Graph-MIND alone was right on 64 questions and agentmemory alone on 21; exact McNemar p = 3.3e-6.&lt;/p&gt;

&lt;p&gt;By question type (Graph-MIND / agentmemory):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multi-session: 80.8 / 65.8&lt;/li&gt;
&lt;li&gt;temporal reasoning: 88.9 / 77.0&lt;/li&gt;
&lt;li&gt;single-session user: 98.4 / 87.5&lt;/li&gt;
&lt;li&gt;knowledge update: 94.4 / 90.3&lt;/li&gt;
&lt;li&gt;preference: 75.0 / 71.4&lt;/li&gt;
&lt;li&gt;abstention: 93.3 / 90.0&lt;/li&gt;
&lt;li&gt;single-session assistant: 94.6 / &lt;strong&gt;96.4&lt;/strong&gt; (agentmemory wins this one)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why 95% recall becomes 80% answers
&lt;/h2&gt;

&lt;p&gt;Three things happen between "a right session is in the top 5" and "the answer is right":&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Any is not all.&lt;/strong&gt; recall_any@5 counts a hit if &lt;em&gt;one&lt;/em&gt; answer session is retrieved. Multi-session questions ("how many times did I...", "how long between...") need several. That is where the gap is widest: 15 points.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More text is not more signal.&lt;/strong&gt; Five whole sessions are ~66k characters. The answer is a sentence or two in there. The reader has to find it, and on temporal questions also work out which of several dated mentions is the current one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rank is not position.&lt;/strong&gt; A session ranked fifth still lands in the reader's context, but next to four sessions that look relevant and are not.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of this makes agentmemory bad; 80% on LongMemEval with a small reader is respectable, and whole sessions are its natural unit. The point is that &lt;strong&gt;R@5 and QA accuracy are different measurements&lt;/strong&gt;, and comparing one project's R@5 with another's QA (or with each other's R@5 on different units: sessions vs. turns vs. chunks) does not tell you which one answers better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats, because I build one of these
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I picked the reader and the judge setup; it is the one every Graph-MIND number uses, and it is the official judge.&lt;/li&gt;
&lt;li&gt;Graph-MIND was developed against 120 of these 500 questions. The untuned column (379 questions) is there for that reason; the gap holds.&lt;/li&gt;
&lt;li&gt;I used agentmemory's published retrieval file, not a fresh run of its current code.&lt;/li&gt;
&lt;li&gt;Whole sessions are agentmemory's best case here: its reader sees about five times more text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is reproducible: the script is &lt;a href="https://github.com/goyohan0611-png/graph-mind/blob/main/research/rival_agentmemory.py" rel="noopener noreferrer"&gt;&lt;code&gt;research/rival_agentmemory.py&lt;/code&gt;&lt;/a&gt;, and every question, answer and judge verdict is in &lt;a href="https://github.com/goyohan0611-png/graph-mind/tree/main/research/runs/graph-v9.6-rival-agentmemory-k5" rel="noopener noreferrer"&gt;&lt;code&gt;research/runs/graph-v9.6-rival-agentmemory-k5&lt;/code&gt;&lt;/a&gt;. If the method is wrong, I would like to know.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Graph-MIND is, briefly
&lt;/h2&gt;

&lt;p&gt;A local memory shared by the coding agents in your terminal (Claude Code, Codex, Cursor, Gemini CLI, Copilot CLI, OpenCode). It stores every turn verbatim in SQLite on your machine, with no model call at write time, and retrieves with word search plus a small local embedding model. Open source (AGPL), one-line install.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The takeaway, whichever memory you use: ask for answer accuracy, on the same reader and judge.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>mcp</category>
      <category>benchmark</category>
    </item>
  </channel>
</rss>
