<?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: Nikhil tiwari</title>
    <description>The latest articles on DEV Community by Nikhil tiwari (@nikhil102).</description>
    <link>https://dev.to/nikhil102</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%2F3922500%2Ffba6bd7d-a48c-44af-9f05-df50db196d43.JPG</url>
      <title>DEV Community: Nikhil tiwari</title>
      <link>https://dev.to/nikhil102</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikhil102"/>
    <language>en</language>
    <item>
      <title>I Built Persistent Memory for AI Coding Assistants — Here's How It Works</title>
      <dc:creator>Nikhil tiwari</dc:creator>
      <pubDate>Sun, 10 May 2026 21:42:13 +0000</pubDate>
      <link>https://dev.to/nikhil102/i-built-persistent-memory-for-ai-coding-assistants-heres-how-it-works-2i0b</link>
      <guid>https://dev.to/nikhil102/i-built-persistent-memory-for-ai-coding-assistants-heres-how-it-works-2i0b</guid>
      <description>&lt;h2&gt;
  
  
  Every time you open a new AI chat, your assistant forgets everything. I fixed that.
&lt;/h2&gt;

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

&lt;p&gt;If you use Cursor, Claude Code, or Amazon Q regularly, you've probably hit this wall:&lt;/p&gt;

&lt;p&gt;You explain your project architecture in Monday's chat. On Tuesday, you open a new session and start from scratch. You paste the same context, re-explain the same patterns, and re-describe the same service boundaries — every single time.&lt;/p&gt;

&lt;p&gt;This isn't a minor inconvenience.&lt;/p&gt;

&lt;p&gt;For large codebases, every AI interaction starts with 10 minutes of context-loading before you can ask anything useful. For teams, every developer builds their own mental model of the codebase in isolation, while the AI assistant knows none of it.&lt;/p&gt;

&lt;p&gt;I've been building production systems on Azure for several years — .NET microservices, KEDA autoscaling, Azure Service Bus pipelines. Our codebase has 40+ services, clean architecture patterns, vendor integration handlers, and years of architectural decisions that live entirely in people's heads.&lt;/p&gt;

&lt;p&gt;Every time I opened a new AI chat, I was manually transferring that knowledge into a chat window.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Mnemo&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Mnemo Does
&lt;/h2&gt;

&lt;p&gt;Mnemo is a local MCP (Model Context Protocol) server that gives AI coding assistants persistent, structured knowledge about your codebase.&lt;/p&gt;

&lt;p&gt;One command initializes it.&lt;/p&gt;

&lt;p&gt;After that, every AI chat automatically knows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your project's architecture and patterns&lt;/li&gt;
&lt;li&gt;Your API endpoints&lt;/li&gt;
&lt;li&gt;Your engineering decisions&lt;/li&gt;
&lt;li&gt;Who owns which part of the codebase&lt;/li&gt;
&lt;li&gt;Errors you've already debugged and how you fixed them&lt;/li&gt;
&lt;li&gt;Incidents, code reviews, and team knowledge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It works with Cursor, Claude Code, Amazon Q, and any MCP-compatible AI client.&lt;/p&gt;

&lt;p&gt;The moment a new AI chat session starts, Mnemo automatically loads your project context.&lt;/p&gt;

&lt;p&gt;You never paste architecture descriptions again.&lt;/p&gt;




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

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mnemo init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;inside your project, several things happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. AST-Based Codebase Parsing
&lt;/h2&gt;

&lt;p&gt;Mnemo parses your codebase using real language parsers — not regex or grep.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;C#&lt;/strong&gt; → Roslyn&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python&lt;/strong&gt; → &lt;code&gt;ast&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt; → TypeScript Compiler API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allows Mnemo to understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Method signatures&lt;/li&gt;
&lt;li&gt;Class hierarchies&lt;/li&gt;
&lt;li&gt;Interface implementations&lt;/li&gt;
&lt;li&gt;Dependency relationships&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From this, it builds a compact &lt;strong&gt;repo map&lt;/strong&gt; — a structured representation of your codebase shape.&lt;/p&gt;

&lt;p&gt;Not the full source code.&lt;/p&gt;

&lt;p&gt;Just the architecture-level understanding required for AI context.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Architecture Detection
&lt;/h2&gt;

&lt;p&gt;Mnemo scans the codebase for structural signals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Common handler inheritance&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IRepository&amp;lt;T&amp;gt;&lt;/code&gt; patterns&lt;/li&gt;
&lt;li&gt;Command/query separation&lt;/li&gt;
&lt;li&gt;Event-driven conventions&lt;/li&gt;
&lt;li&gt;DI registration styles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using these signals, it classifies your architecture automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clean Architecture&lt;/li&gt;
&lt;li&gt;CQRS&lt;/li&gt;
&lt;li&gt;Event-Driven&lt;/li&gt;
&lt;li&gt;Hexagonal&lt;/li&gt;
&lt;li&gt;Repository Pattern&lt;/li&gt;
&lt;li&gt;Handler Pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This becomes part of the persistent project memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. MCP Server Initialization
&lt;/h2&gt;

&lt;p&gt;Mnemo launches a local MCP server process that exposes tools AI assistants can call.&lt;/p&gt;

&lt;p&gt;At the start of each AI chat session, the assistant calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mnemo_recall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mnemo then returns a structured context payload containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo map&lt;/li&gt;
&lt;li&gt;Architecture profile&lt;/li&gt;
&lt;li&gt;Recent engineering decisions&lt;/li&gt;
&lt;li&gt;Error/debug history&lt;/li&gt;
&lt;li&gt;Current task context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is stored locally inside:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mnemo/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON files store structured memory&lt;/li&gt;
&lt;li&gt;A vector store powers semantic search&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No source code leaves your machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why MCP Matters
&lt;/h2&gt;

&lt;p&gt;MCP (Model Context Protocol) is an open protocol from Anthropic that standardizes how AI assistants connect to tools and external context.&lt;/p&gt;

&lt;p&gt;Think of it like USB for AI tooling.&lt;/p&gt;

&lt;p&gt;Instead of every AI platform building proprietary integrations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any MCP server can provide tools&lt;/li&gt;
&lt;li&gt;Any MCP-compatible AI client can consume them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mnemo implements MCP, meaning it works across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cursor&lt;/li&gt;
&lt;li&gt;Claude Code&lt;/li&gt;
&lt;li&gt;Amazon Q&lt;/li&gt;
&lt;li&gt;Kiro&lt;/li&gt;
&lt;li&gt;Other MCP-compatible tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mnemo isn't tied to a single AI assistant.&lt;/p&gt;

&lt;p&gt;It's an intelligence layer that upgrades all of them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the AI Actually Sees
&lt;/h2&gt;

&lt;p&gt;When the assistant calls &lt;code&gt;mnemo_recall&lt;/code&gt;, it receives structured project context like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Project Context
Architecture: Clean Architecture + CQRS
Patterns: Repository (9 interfaces), Handler pattern (12 handlers), DI container

## Decisions
- Use handler pattern for vendor-specific logic
- Auth service uses cache-aside with 5min TTL

## Repo Map
PaymentService/Handlers/
  - StripeHandler
  - PayPalHandler
  - SquareHandler

AuthService/Services/
  - TokenService : ITokenService
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this context loaded, the AI understands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How the codebase is structured&lt;/li&gt;
&lt;li&gt;Which patterns are expected&lt;/li&gt;
&lt;li&gt;Existing architectural conventions&lt;/li&gt;
&lt;li&gt;Historical engineering decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So when you ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Add a new payment handler"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The generated implementation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inherits from &lt;code&gt;BasePaymentHandler&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Follows existing conventions&lt;/li&gt;
&lt;li&gt;Registers correctly in DI&lt;/li&gt;
&lt;li&gt;Matches existing architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without Mnemo, most assistants generate generic code that doesn't fit the system design at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Option A: VS Code Extension (Easiest)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install the Mnemo extension from the VS Code Marketplace&lt;/li&gt;
&lt;li&gt;Open a project&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;"Initialize Mnemo?"&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Done.&lt;/p&gt;

&lt;p&gt;The extension automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloads the Mnemo binary&lt;/li&gt;
&lt;li&gt;Initializes the repository&lt;/li&gt;
&lt;li&gt;Configures MCP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No Python required.&lt;/p&gt;




&lt;h3&gt;
  
  
  Option B: Homebrew (macOS/Linux)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap Mnemo-mcp/tap
brew &lt;span class="nb"&gt;install &lt;/span&gt;mnemo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
mnemo init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Option C: pip (All Platforms)
&lt;/h3&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;mnemo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Mnemo-mcp/Mnemo.git
&lt;span class="nb"&gt;cd &lt;/span&gt;Mnemo
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
mnemo init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Mnemo started as a solution to a frustrating problem:&lt;/p&gt;

&lt;p&gt;AI assistants forget everything between sessions.&lt;/p&gt;

&lt;p&gt;For small projects, that's annoying.&lt;/p&gt;

&lt;p&gt;For large production systems, it's a major productivity bottleneck.&lt;/p&gt;

&lt;p&gt;Mnemo gives AI coding assistants persistent architectural memory, allowing them to operate with real understanding of your codebase instead of stateless guesses.&lt;/p&gt;

&lt;p&gt;I'd love feedback — especially from teams managing large, distributed systems.&lt;/p&gt;

&lt;p&gt;What project context do you find yourself re-explaining most often?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
