Skip to content

Instantly share code, notes, and snippets.

@LucasRoesler
Created March 3, 2025 09:58
Show Gist options
  • Save LucasRoesler/849ae74cd317ee046500194edadcf344 to your computer and use it in GitHub Desktop.
Save LucasRoesler/849ae74cd317ee046500194edadcf344 to your computer and use it in GitHub Desktop.
GenAI Coding Agent helper memory bank instructions

Memory Bank

The memory bank concept tells the GenAI Agent to track the context of it's current task. Generally this helps it to stay more focused and produce better results while also encapsulating important contextual and technical infomration that is required for larger tasks. It also make it easier for the agent to identify new or future tasks without becoming sidetraked.

The iniital text init_memory_bank.md is a simple prompt to tell the agent to create the required memory bacnk content. THis can of course be adjusted so that it tracks additional information or is stored in a different location.

I generally include the memory bank folder in the .gitignore because I view it as hyper specific to my work on a project. But for personal projects, you might also commit it.

The how_to_use.md is also included into .memory folder. I actually asked it ot generate this as a "minimal prompt that tells you how to use the memory bank"

Note that I wrote the last paragraph manually to help streamline the memory bank loading process.

Memory Folder - Minimal Prompt

Create a .memory folder with:

  • project_context.md: Project purpose, requirements, goals
  • active_context.md: what your current task is and required information to complete it.
  • technical_decisions.md: Key decisions with rationale
  • code_structure.md: Directory structure, module organization
  • implementation_notes.md: Complex algorithms, non-obvious solutions
  • task_list.md: Completed/pending tasks with dependencies

Update memory files when making significant changes.

To reload memory: "reload your memory from the .memory folder and tell me what the next task is"

During a reload, only start with the task_list.md and active_context.md files. Only read the other files when necessary to complete a task.

create a memory bank in the .memory folder. This is a folder where you can write information to track your current context, an ongoing task list, and any technical context or decisions that are important to ensure high quality and consistent implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment