Memory bank for AI coding

Recently I have been coaching my team to use AI for development. There are many tools that we can used for free to get so much value (such as Cline w/ gemini or openrouter, co-pilot, etc). Thus, we should not be shying away from this amazing tool just because it cannot get the outcome we want.

The art is to learn how to command and control AI with prompts, and I have shared some of the tips and tricks on my other post here (about vibe coding).

Memory bank

The more you start diving into certain topic, the more you see your problem is already solved by someone else. Let’s unpack what this “memory bank” is about.

Just like the PRD and instruction that I shared in the previous post, memory bank take one step further to include more files to save the state of our work. It’s essentially a form of persistent memory for AI systems, enabling them to maintain context across different interactions and sessions, rather than starting fresh each time.

The growing size of the context window is our ally now. We no need to worry about whether this state of work file size getting out of hand anymore. And that’s what make this memory bank so powerful.

How it work

It works by letting the AI to create the files that store the state information, and updating itself as you progress. This allow the AI to recall past interaction and context that can be shared to everyone in the team too.

There are plenty of example if you start google for it. You’ve got Cline, Cursor, Roo Code, and I believe more to come. Under the hood, we know all these LLM is just a smartly engineered prompts. And memory is one of them. I am using Cline’s memory bank as my based going forward.

Setup

It reach to a point that you don’t even need to explain your project. Simply follow their system prompts and you’re done. You just need to copy the whole prompt that is provided in the link. We don’t even have to pull our hair just to get this perfect prompt out. Below is just an example:

# Cline's Memory Bank

I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

## Memory Bank Structure

Read more from the source.

And then in the prompt, just type “initialize memory bank“. You’re good to go! You should expect files like projectbrief.md, productContext.md, activeContext.md, systemPatterns.md, techContext.md, and progress.md to be created automatically for you.

And everytime after you make some progress in your product development, simply instruct the AI to “update memory bank“. Just mind blown!

Read more what each file does here.

What is the Cline Memory Bank?

The Memory Bank is a structured documentation system that allows Cline to maintain context across sessions. It transforms Cline from a stateless assistant into a persistent development partner that can effectively “remember” your project details over time.

Key Benefits

  • Technology Agnostic: Functions with any tech stack or language
  • Context Preservation: Maintain project knowledge across sessions
  • Consistent Development: Experience predictable interactions with Cline
  • Self-Documenting Projects: Create valuable project documentation as a side effect
  • Scalable to Any Project: Works with projects of any size or complexity

I don’t think I need to explain further, just read the whole thing yourself here.

Conclusion

On top of being able to better control the AI with the right context when you’re working on project, we are able to share progress with the rest of the team. Because these memory bank files can be commited to the code repository.

The development is progressing rapidly this day. Is about time to start to read about best practice for this kind of development, because they are already exist out there. Start to build out your system prompts (global and project prompts) to leverage of the tool to be more productive.