AI Agents // CONTEXT OVERLOAD & MEMORY•24 JUL 2026•5 min read

Curing LLM Amnesia: Building a Persistent Architectural Memory Bank

After 20 turns, standard LLMs lose architectural context and re-introduce rejected bugs. How persistent engineering journals and read-only Discuss Mode protect codebases.

Every developer who has worked with AI chat assistants knows the dread of "Chat Amnesia". You spend an hour carefully debating database schemas, selecting libraries, and rejecting certain flawed design patterns. Then, twenty messages later, the model's context window compresses or shifts. Suddenly, the AI suggests the exact library you rejected an hour ago, or overwrites your carefully migrated database tables with hallucinated mock columns. To solve this, we built a **Persistent Architectural Memory Bank** into Ashwatth: * **The Engineering Decision Journal**: Whenever key architectural decisions are made—such as adopting PGlite for local relational databases, choosing Next.js App Router over Pages, or establishing auth boundaries—the agent automatically logs them to a permanent journal (`log_journal_entry`). * **Living Specification Sync**: System constraints, design system tokens, and database schemas are synced directly from Supabase documents into the agent's state machine, keeping ground-truth architecture independent of chat turn count. * **Read-Only Discuss Mode**: When brainstorming technical trade-offs or analyzing code, developers can switch to Discuss Mode. In this mode, all file-mutation tools are disabled, allowing free-form technical advisory without any risk of accidental code breakage. With persistent memory, your AI co-engineer remembers your past decisions, respects your technical boundaries, and never suffers from chat amnesia.

Key Lessons & Engineering Principles

  • 1
    Raw chat history is an unreliable storage mechanism for project architecture.
  • 2
    A persistent decision journal prevents AI from repeating rejected technical dead-ends.
  • 3
    Separating brainstorming (read-only Discuss Mode) from execution (Kanban build mode) protects codebase integrity.