<?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: tazwar devp</title>
    <description>The latest articles on DEV Community by tazwar devp (@tazwar_devp_c34fd1dba7f84).</description>
    <link>https://dev.to/tazwar_devp_c34fd1dba7f84</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%2F3882878%2F46effa59-e1f6-4162-b320-cbf19111337e.png</url>
      <title>DEV Community: tazwar devp</title>
      <link>https://dev.to/tazwar_devp_c34fd1dba7f84</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tazwar_devp_c34fd1dba7f84"/>
    <language>en</language>
    <item>
      <title>I Built a Long-Term Memory Engine for AI Coding Agents in Rust</title>
      <dc:creator>tazwar devp</dc:creator>
      <pubDate>Sun, 24 May 2026 17:23:44 +0000</pubDate>
      <link>https://dev.to/tazwar_devp_c34fd1dba7f84/i-built-a-long-term-memory-engine-for-ai-coding-agents-in-rust-4n2m</link>
      <guid>https://dev.to/tazwar_devp_c34fd1dba7f84/i-built-a-long-term-memory-engine-for-ai-coding-agents-in-rust-4n2m</guid>
      <description>&lt;p&gt;AI coding agents have a weird problem.&lt;br&gt;
They fail the same way repeatedly.&lt;br&gt;
You fix a bug once.&lt;br&gt;
The next session forgets it existed.&lt;br&gt;
A few hours later the agent repeats the exact same mistake.&lt;/p&gt;

&lt;p&gt;Wrong float handling.&lt;br&gt;
Broken retry logic.&lt;br&gt;
Reintroducing old bugs.&lt;br&gt;
Ignoring project-specific constraints.&lt;/p&gt;

&lt;p&gt;That pushed me into building Memorie.&lt;br&gt;
A local-first semantic memory engine for AI coding agents.&lt;/p&gt;

&lt;p&gt;Not a chatbot history wrapper.&lt;br&gt;
Not another “AI memory platform.”&lt;br&gt;
Just an experiment around one question:&lt;/p&gt;

&lt;p&gt;What would it take for coding agents to actually learn from previous work?&lt;br&gt;
The mistake I made first&lt;br&gt;
The first implementation was basically:&lt;/p&gt;

&lt;p&gt;Store conversations&lt;br&gt;
Embed them&lt;br&gt;
Retrieve similar chunks later&lt;/p&gt;

&lt;p&gt;It worked surprisingly well for small demos.&lt;br&gt;
Then it slowly collapsed.&lt;br&gt;
The memory store became full of:&lt;/p&gt;

&lt;p&gt;duplicated ideas&lt;br&gt;
low-value observations&lt;br&gt;
outdated fixes&lt;br&gt;
contradictory advice&lt;br&gt;
random noise from failed attempts&lt;/p&gt;

&lt;p&gt;Retrieval quality degraded over time because the system had no concept of memory quality.&lt;br&gt;
That changed the entire direction of the project.&lt;br&gt;
I stopped thinking about “storage.”&lt;br&gt;
I started thinking about memory governance.&lt;br&gt;
The core is written in Rust.&lt;br&gt;
Current stack:&lt;/p&gt;

&lt;p&gt;SQLite persistence&lt;br&gt;
ONNX embeddings&lt;br&gt;
HNSW search&lt;br&gt;
BLAKE3 deduplication&lt;br&gt;
Python bindings through ctypes&lt;br&gt;
CFFI layer&lt;/p&gt;

&lt;p&gt;The system stays fully local-first.&lt;br&gt;
No external vector database.&lt;br&gt;
No hosted APIs inside the core loop.&lt;br&gt;
Everything lives in a single SQLite-backed memory system.&lt;br&gt;
The retrieval pipeline roughly works like this:&lt;/p&gt;

&lt;p&gt;query&lt;br&gt;
→ embedding&lt;br&gt;
→ similarity search&lt;br&gt;
→ trust weighting&lt;br&gt;
→ contradiction filtering&lt;br&gt;
→ ranking&lt;br&gt;
→ final memories&lt;/p&gt;

&lt;p&gt;Each memory tracks:&lt;br&gt;
trust&lt;br&gt;
uncertainty&lt;br&gt;
reinforcement history&lt;br&gt;
failure count&lt;br&gt;
recency&lt;br&gt;
importance&lt;/p&gt;

&lt;p&gt;The goal is not “remember everything.”&lt;br&gt;
The goal is:&lt;br&gt;
remember what consistently helps.&lt;/p&gt;

&lt;p&gt;One design choice that mattered a lot&lt;br&gt;
I originally planned to use ANN search immediately.&lt;br&gt;
Bad idea.&lt;br&gt;
For smaller datasets, linear scans were simpler and often fast enough.&lt;br&gt;
So the current system uses:&lt;/p&gt;

&lt;p&gt;linear scan under ~500 memories&lt;br&gt;
HNSW above that threshold&lt;/p&gt;

&lt;p&gt;That removed complexity early and made debugging easier.&lt;br&gt;
I think too many infrastructure projects optimize for scale before correctness.&lt;br&gt;
Reinforcement is harder than retrieval&lt;br&gt;
This became the real problem.&lt;/p&gt;

&lt;p&gt;Suppose an agent retrieves 5 memories and succeeds.&lt;br&gt;
Which memory actually contributed to the success?&lt;br&gt;
A lot of systems reinforce everything equally.&lt;br&gt;
That creates long-term garbage accumulation.&lt;/p&gt;

&lt;p&gt;So Memorie uses attribution gates before reinforcement:&lt;br&gt;
semantic overlap checks&lt;br&gt;
cosine similarity thresholds&lt;br&gt;
usage matching&lt;/p&gt;

&lt;p&gt;Still imperfect.&lt;br&gt;
But enough to stop obvious false reinforcement loops.&lt;br&gt;
Contradictions get ugly fast&lt;br&gt;
Eventually memories start disagreeing.&lt;br&gt;
Example:&lt;/p&gt;

&lt;p&gt;Memory A:&lt;br&gt;
“Always retry failed requests.”&lt;/p&gt;

&lt;p&gt;Memory B:&lt;br&gt;
“Never retry this endpoint because duplicate execution corrupts state.”&lt;/p&gt;

&lt;p&gt;Both can be valid depending on context.&lt;br&gt;
Right now contradiction handling uses:&lt;/p&gt;

&lt;p&gt;semantic similarity&lt;br&gt;
polarity detection&lt;br&gt;
quality-weighted conflict resolution&lt;/p&gt;

&lt;p&gt;Lower-trust memories get archived instead of immediately deleted.&lt;br&gt;
Honestly, this part still feels very unsolved.&lt;br&gt;
The part that changed my thinking&lt;br&gt;
I started this project assuming memory retrieval was the hard problem.&lt;/p&gt;

&lt;p&gt;Now I think the real challenge is:&lt;br&gt;
how systems decide what deserves to survive.&lt;br&gt;
Most memory systems focus on retrieval speed.&lt;br&gt;
I think long-term usefulness matters more.&lt;br&gt;
Without suppression, decay, and conflict handling, memory systems slowly poison themselves.&lt;/p&gt;

&lt;p&gt;Current state&lt;br&gt;
The project is still experimental and not production ready.&lt;br&gt;
But it already includes:&lt;/p&gt;

&lt;p&gt;Rust core library&lt;br&gt;
SQLite persistence&lt;br&gt;
semantic retrieval&lt;br&gt;
trust scoring&lt;br&gt;
reinforcement + penalty loops&lt;br&gt;
contradiction resolution&lt;br&gt;
Python bindings&lt;br&gt;
MCP server support&lt;/p&gt;

&lt;p&gt;Repo:&lt;br&gt;
&lt;a href="https://github.com/tazwaryayyyy/Memorie-AI" rel="noopener noreferrer"&gt;GITHUB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would genuinely appreciate criticism from people working on:&lt;/p&gt;

&lt;p&gt;AI agents&lt;br&gt;
retrieval systems&lt;br&gt;
vector databases&lt;br&gt;
reinforcement systems&lt;br&gt;
memory architectures&lt;/p&gt;

&lt;p&gt;Especially around where this design breaks at scale.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Why RAG is failing your AI agents (and what trust scoring fixes)</title>
      <dc:creator>tazwar devp</dc:creator>
      <pubDate>Thu, 16 Apr 2026 17:51:03 +0000</pubDate>
      <link>https://dev.to/tazwar_devp_c34fd1dba7f84/why-rag-is-failing-your-ai-agents-and-what-trust-scoring-fixes-fcl</link>
      <guid>https://dev.to/tazwar_devp_c34fd1dba7f84/why-rag-is-failing-your-ai-agents-and-what-trust-scoring-fixes-fcl</guid>
      <description>&lt;p&gt;Explain that most RAG (Retrieval-Augmented Generation) is "dumb." It finds a document that looks like your query and shoves it into the prompt. If that document is wrong, or outdated, the agent follows it anyway.&lt;/p&gt;

&lt;p&gt;Explain the Memoire Three-Signal Model:&lt;/p&gt;

&lt;p&gt;Quality: Was this good when we wrote it?&lt;/p&gt;

&lt;p&gt;Experience: Has it actually worked in past tasks?&lt;/p&gt;

&lt;p&gt;Stability: Is the trust score converging or is the agent constantly failing when it uses this?&lt;/p&gt;

&lt;p&gt;End with the MCP one-liner. People love things they can install in thirty seconds.&lt;br&gt;
&lt;a href="https://github.com/tazwaryayyyy/Memorie-AI" rel="noopener noreferrer"&gt;Memorie-AI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>database</category>
    </item>
  </channel>
</rss>
