AI Experiment #2: Cursor Memory Bank tested

Exploring Memory Bank techniques for AI development and comparing approaches for maintaining context in complex projects

Preberi v slovenščini

Hey there!

Here’s the promised continuation of my experiment building the “Mind Fitness Now” app with AI tools.

Last week, I shared my experience with the “Claude Task Master” tool, which turned out to be a bit too… well, let’s call it “thorough,” leading to unnecessary complications and a huge amount of code for the initial phase.

Today, however, we’ll focus on the Cursor Memory Bank concept.

What Exactly is Cursor Memory Bank?

If you’ve ever worked with AI assistants on larger projects, you’ve probably noticed that they sometimes “forget” what you agreed on in a previous session or even a few steps back in the same session. Cursor Memory Bank (and similar concepts, like the Cline Memory Bank) addresses this issue.

Imagine it as a structured digital diary of your project. This diary consists of a series of Markdown files that the AI reads at the beginning of each session (or when you instruct it to) to refresh its memory about:

Such a structure would include files like:

The idea is that these files allow the AI to maintain context, thereby working more consistently and effectively over longer periods.

How to Get Started with Cursor Memory Bank?

Based on the vanzan01/cursor-memory-bank project (https://github.com/vanzan01/cursor-memory-bank), here’s a simplified guide to get you started:

  1. Step 1: Get the Files

    • Clone the repository into your project directory:
      git clone https://github.com/vanzan01/cursor-memory-bank.git
      
    • This will provide you with all necessary files, including rule files, custom mode instructions, and template Memory Bank files.
  2. Step 2: Setting Up Custom Modes in Cursor

    • This is a critical step. You need to manually create six custom modes in Cursor. For each mode, you will copy the instruction content from the corresponding file in the custom_modes/ directory of the cloned repository into the “Advanced options” section of the custom mode setup in Cursor.
    • The modes to create are:
      • VAN MODE (🔍 VAN): For initialization. Uses custom_modes/van_instructions.md.
      • PLAN MODE (📋 PLAN): For task planning. Uses custom_modes/plan_instructions.md.
      • CREATIVE MODE (🎨 CREATIVE): For design decisions. Uses custom_modes/creative_instructions.md.
      • IMPLEMENT MODE (⚒️ IMPLEMENT): For code implementation. Uses custom_modes/implement_instructions.md.
      • REFLECT MODE (🔍 REFLECT): For review. Uses the REFLECT section from custom_modes/reflect_archive_instructions.md.
      • ARCHIVE MODE (📚 ARCHIVE): For documentation. Uses the ARCHIVE section from custom_modes/reflect_archive_instructions.md.
    • Refer to the README.md on GitHub for detailed instructions on naming, enabling tools, and pasting the advanced options for each mode.
  3. Basic Usage Overview

    • Start with VAN Mode by typing “VAN” to initialize the project analysis.
    • Follow the workflow (VAN → PLAN → CREATIVE → IMPLEMENT → REFLECT → ARCHIVE), which might be shortened based on task complexity.
    • You can type “QA” in any mode for technical validation.

It’s crucial that you (or the AI) regularly update these files so they remain relevant.

My Experience with Memory Bank on “Mind Fitness Now”

The theory sounded promising. Here’s how I approached the implementation with Memory Bank, step by step, as shown in the excerpts from my communication with the AI:

I successfully defined different behaviors:

I started with this prompt:

Once the memory bank created the necessary files, I initiated the implementation, saying, “Let’s start with the implementation, step by step.”

In the intermediate steps, I instructed it to update the memory bank files to track the implementation:

And after completing all parts, I triggered a quality analysis:

Combining Approaches or Simplifying Them?

I wondered if it would make sense to combine “Claude Task Master” for a basic task structure and then “Memory Bank” for ongoing work. After this experience, it seems to me that for a project the size of “Mind Fitness Now,” Task Master is best for the initial breakdown of the project into smaller requirements. Memory Bank, for a project of this size, is currently less suitable, mainly because it’s not 100% reliable, and I consequently spent more time troubleshooting the Memory Bank system itself than developing the project. Alternatively, if I hadn’t started the project with Task Master, Memory Bank might have been more prominent; in my case, however, the AI agent already had clear instructions from the task list prepared by Task Master.

I will definitely keep an eye on how the Memory Bank project develops because the idea of better context control is not a bad one.

Conclusion and What’s Next?

Why am I researching this? Because I want to find the most effective way to program with AI. That is, to manage the code and not blindly delegate it to the AI, while still delivering a functional result.

The last two newsletters were more technical. You don’t need to worry if that’s not your thing. The purpose is for me to learn, and when I’ve prepared a detailed guide, we can take the simplest yet most effective path.

The next newsletter won’t be technical; I’ll show you the result I’ve built: The “Mind Fitness Now” application.

Interested?

Stay with me!

Talk soon, Primož