Memories is the system for sharing and persisting context across conversations.

There are two mechanisms for this in Windsurf: Memories, which can be automatically generated by Cascade, and rules, which are manually defined by the user at both the local and global levels.

How to Manage Memories

Memories and Rules can be accessed and configured at any time by clicking on the Customizations icon in the top right slider menu in Cascade, or via “Windsurf - Settings” in the bottom-right hand corner. To edit an existing memory, simply click into it and then click the Edit button.

Memories

During conversation, Cascade can automatically generate and store memories if it encounters context that it believes is useful to remember.

Additionally, you can ask Cascade to create a memory at any time. Just prompt Cascade to “create a memory of …”.

Cascade’s autogenerated memories are associated with the workspace that they were created in and Cascade will retrieve them when it believes that they are relevant. Memories generated in one workspace will not be available in another.

Creating and using auto-generated memories do NOT consume credits

Rules

Users can explicitly define their own rules for Cascade to follow.

Rules can be defined at either the global level or the workspace level.

global_rules.md - rules applied across all workspaces

.windsurf/rules - workspace level repo containing rules that are tied to globs or natural language descriptions.

To get started with Rules, click on the Customizations icon in the top right slider menu in Cascade, then navigate to the Rules panel. Here, you can click on the + Global or + Workspace button to create new rules at either the global or workspace level, respectively.

You can find example rule templates curated by the Windsurf team at https://windsurf.com/editor/directory to help you get started.

Rules files are limited to 6000 characters each. Any content above 6000 characters will be truncated and Cascade will not be aware of them.

If the total of your global rules and local rules exceed 12,000 characters, priority will be given to the global rules, followed by the workspace rules. Any rules beyond 12,000 characters will be truncated.

Activation Modes

At the rule level, you can define how a rule should be activated for Cascade.

There are 4 modes:

  1. Manual: This rule can be manually activated via @mention in Cascade’s input box
  2. Always On: This rule will always be applied
  3. Model Decision: Based on a natural language description of the rule the user defines, the model decides whether to apply the rule.
  4. Glob: Based on the glob pattern that the user defines (e.g. .js, src/**/.ts), this rule will be applied to all files that match the pattern.

Best Practices

To help Cascade follow your rules effectively, follow these best practices:

  • Keep rules simple, concise, and specific. Rules that are too long or vague may confuse Cascade.
  • There’s no need to add generic rules (e.g. “write good code”), as these are already baked into Cascade’s training data.
  • Format your rules using bullet points, numbered lists, and markdown. These are easier for Cascade to follow compared to a long paragraph. For example:
# Coding Guidelines 
- My project's programming language is python
- Use early returns when possible
- Always add documentation when creating new functions and classes
  • XML tags can be an effective way to communicate and group similar rules together. For example:
<coding_guidelines>
- My project's programming language is python
- Use early returns when possible
- Always add documentation when creating new functions and classes
</coding_guidelines>