A comprehensive memory system for Cursor IDE that provides both short-term session memory and long-term persistent memory without relying on external tools or databases.
- Dual Memory Architecture: Short-term session memory + long-term persistent memory
- Operational Modes: Different modes (THINK, PLAN, IMPLEMENT, REVIEW, DOCUMENT) with specialized memory behaviors
- Context Request System: AI requests relevant memory files based on context
- User-Reported Events: Report key events to trigger memory updates
- Rich Command Interface: Commands for explicit memory operations
- Annotation Support: Use code annotations for memory updates
- Memory Promotion: Convert short-term memory to long-term when valuable
- Structured Responses: Consistent completion reports with next steps and available commands
# Clone the repository
git clone https://github.com/forsonny/Enhanced-Cursor-Memory-Bank-System.git
# Navigate to your project
cd your-project
# Run the initialization script
path/to/init-memory-bank.shOr download and run directly:
curl -L -o init-memory-bank.sh https://raw.githubusercontent.com/forsonny/Enhanced-Cursor-Memory-Bank-System/refs/heads/main/init-memory-bank.sh
chmod +x init-memory-bank.sh
./init-memory-bank.sh- Open Cursor IDE
- Click on Settings (gear icon in the top right)
- Navigate to Rules → User Rules
- Copy the contents of the
custom-instructions.mdfile - Paste into the Custom Instructions field in Cursor settings
This step is crucial as it sets up the AI to properly interact with the memory system!
When adding the memory bank rules in Cursor, configure each rule with the correct type:
| Rule File | Rule Type | Glob Pattern |
|---|---|---|
| 001_memory_core.mdc | Always | N/A |
| 002_memory_commands.mdc | Always | N/A |
| 003_mode_definitions.mdc | Always | N/A |
| 004_auto_context.mdc | Auto Attached | **/*.* |
| 005_memory_events.mdc | Always | N/A |
⚠️ Important: Setting the correct rule types ensures the memory system works properly across all files and contexts in your project.
-
Initialize the system: The initialization script creates all necessary files and directories.
-
Check system status:
/memory status -
Select and confirm a mode:
- Select "THINK" from Cursor's UI dropdown
- Type
/mode thinkto confirm
-
Update memory files:
/memory update project_brief.md "Your content here" -
Report development events:
/memory event commit "Implemented authentication"
For detailed instructions, see USAGE.md.
- Installation Guide - Detailed installation instructions
- Usage Guide - How to use the memory bank system
- Custom Modes Setup - Setting up Cursor's custom modes
- Memory Structure - Understanding the memory file structure
- Command Reference - Complete command documentation
- Event System - How to report events and trigger memory updates
your-project/
├── .cursor/
│ ├── rules/ # Cursor rules (.mdc files)
│ │ ├── 001_memory_core.mdc # Core memory system
│ │ ├── 002_memory_commands.mdc # Memory commands
│ │ ├── 003_mode_definitions.mdc # Operational modes
│ │ ├── 004_auto_context.mdc # Context request system
│ │ └── 005_memory_events.mdc # Event-based updates
│ └── memory/ # Memory storage
│ ├── config.json # System configuration
│ ├── short_term/ # Session-specific memory
│ │ ├── current_context.md
│ │ ├── working_decisions.md
│ │ └── session_notes.md
│ └── long_term/ # Persistent memory
│ ├── project_brief.md
│ ├── architecture.md
│ ├── patterns.md
│ ├── decisions.md
│ └── progress.md
- Short-Term Memory: Session-specific context that's active during the current development session
- Long-Term Memory: Persistent knowledge that's maintained across all sessions
- THINK: Exploration mode for understanding problems
- PLAN: Planning mode for designing solutions
- IMPLEMENT: Implementation mode for writing code
- REVIEW: Review mode for analyzing code
- DOCUMENT: Documentation mode for updating docs
The system responds to commands like:
/memory init: Initialize the memory system/memory status: Check memory system status/memory recall <context>: Request to see specific memory/memory update <file> <content>: Suggest memory updates/memory event <type> <details>: Report development events/mode <mode_name>: Confirm operational mode (after UI selection)
After completing actions, the AI will provide:
## Action Report
- **Completed:** [List of completed actions]
- **Status:** [Success/Partial/Failed]
- **Files Affected:** [List of files updated]
## Available Commands
- `/command1` - [Brief description]
- `/command2` - [Brief description]
## Suggested Next Steps
- [Concrete suggestion 1]
- [Concrete suggestion 2]
- [Memory update suggestion]
The Enhanced Memory Bank System works with Cursor's capabilities:
- AI uses rules in .mdc files to guide behavior
- AI requests to see memory files based on context
- You report significant events that trigger memory updates
- AI suggests updates to memory files that you can implement
- Memory persists across sessions through the file structure
- AI provides structured completion reports with next steps and available commands
This approach ensures that context is maintained effectively while working within Cursor's actual capabilities.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
This project was inspired by:
Project Link: https://github.com/forsonny/Enhanced-Cursor-Memory-Bank-System
