

# Generating a memory bank for Amazon Q chat
Generating a memory bank

Amazon Q can automatically generate memory bank files that provide a quick index of your project's structure, technology stack, and product information. This feature analyzes key files in your project to create summary files that help Amazon Q understand your codebase without having to analyze the entire project each time you ask a question.

When you generate memory bank files, Amazon Q creates a `memory-bank` subfolder under `.amazonq/rules` that contains the following auto-generated files:
+ `product.md` – Overview of your project and its capabilities.
+ `structure.md` – Your project's architecture, folder organization, and key components.
+ `tech.md` – Your technology stack, frameworks, dependencies, and coding standards.
+ `guidelines.md` – Development standards and patterns for your project.

These files are automatically used as context when you chat with Amazon Q, providing it with background information about your project.

## Generate a memory bank for your project


To generate a memory bank, complete the following procedure.

1. In your IDE, open the Amazon Q chat panel.

1. In the chat input box, choose the **Rules** button.

1. Select **Generate Memory Bank**.

1. A new chat tab opens where Amazon Q begins analyzing your project to create the memory bank files.

1. Once complete, you can view the files by choosing the **Rules** button.

   You can select and deselect individual files to be used as context when you ask a question.

1. If your project changes, you can have Amazon Q generate new memory bank files to update its context. To do so, choose the **Rules** button and then select **Regenerate Memory Bank**.

## Customize memory bank generation


You can customize how memory bank files are generated by creating custom project rules. For example, you can create a rule that specifies the language or format for the generated files:

```
When generating the memory bank files like product.md, structure.md, and tech.md, 
always generate content in Spanish and include detailed code examples.
```

Save your memory bank rules in a file in your project's `project-root/.amazonq/rules` folder.

For more information about creating custom project rules, see [Creating project rules for use with Amazon Q Developer chat](context-project-rules.md).