AI Memory
Easily manage AI context for your projects using the Memory Bank technique. This extension integrates with the Model Context Protocol (MCP) to provide structured AI interactions with Cursor.
Note: This extension is designed to work exclusively with Cursor IDE, not with VS Code. (Maybe will add support for VSCode in the future)
Features
- Creates and manages a collection of Memory Bank files to maintain context across AI interactions
- Seamlessly integrates with Cursor AI through the Model Context Protocol (MCP)
- Provides a simple interface for accessing and updating memory bank files
- Automatically configures Cursor's MCP integration settings for easy connection
- Helps maintain and access project context across different sessions
Installation
From Cursor Extension Panel (Recommended)
- Open Cursor
- Go to Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "AI Memory"
- Click "Install"
From VSIX File
- Download the latest
.vsix
file from GitHub releases
- In Cursor, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run "Extensions: Install from VSIX..." and select the downloaded file
Setup and Usage
Initial Setup
- Install the extension (see above)
- Create a workspace folder for your project (if you haven't already)
- Run the
AI Memory: Start MCP
command from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- The extension will:
- Create a
memory-bank
folder in your workspace root if it doesn't exist
- Start the MCP server (default port: 7331, fallback: 7332)
- Automatically update your Cursor MCP configuration to connect to the server
Memory Bank Structure
The extension creates and manages these core files in the memory-bank
folder:
projectbrief.md
: Foundation document that shapes all other files
productContext.md
: Why this project exists, problems it solves, user experience goals
activeContext.md
: Current work focus, recent changes, next steps
systemPatterns.md
: System architecture, key technical decisions, design patterns
techContext.md
: Technologies used, development setup, technical constraints
progress.md
: What works, what's left to build, current status, known issues
Using with Cursor AI
Once the MCP server is running, you can use AI Memory with Cursor in two ways:
Direct interaction with Cursor AI: Cursor will automatically access the memory bank context when you chat with it.
Using /memory
commands: Type commands like /memory status
in the Cursor chat to interact with your memory bank.
Available commands:
/memory status
: Check the status of the memory bank
/memory list
: List all memory bank files
/memory read <filename>
: Read a specific memory bank file
Dashboard
Run the AI Memory: Open Dashboard
command to open a dashboard interface for viewing and managing your memory bank files.
Troubleshooting MCP Connections
If you experience issues connecting to the MCP server from Cursor:
Check server status: Ensure the server is running by visiting http://localhost:7331/health
in your browser. You should see {"status":"ok ok"}
.
Port conflicts: If port 7331 is in use, the extension will try port 7332. Check the extension output to see which port was actually used.
Manual config update: Run the AI Memory: Update Cursor MCP Config
command to manually update the Cursor configuration.
Connection issues: If you see "Client closed" errors:
- Make sure no firewalls are blocking localhost connections
- Try restarting the MCP server with
AI Memory: Start MCP
again
- Check the extension's output panel for error messages
For detailed troubleshooting steps, see TROUBLESHOOTING.md.
Contributing
Contributions to AI Memory are welcome! This project uses automated versioning and release processes.
This project follows the Conventional Commits standard for commit messages:
feat:
- A new feature (triggers a minor version bump)
fix:
- A bug fix (triggers a patch version bump)
docs:
- Documentation changes
style:
- Code style changes (formatting, etc.)
refactor:
- Code changes that neither fix bugs nor add features
perf:
- Performance improvements
test:
- Adding or modifying tests
chore:
- Changes to the build process or auxiliary tools
BREAKING CHANGE:
- Changes that break backward compatibility (triggers a major version bump)
Automated Releases
When you push to the main
branch, the following happens automatically:
- A GitHub Action analyzes your commit messages
- The version in
package.json
is bumped based on the commit types
- A new tag is created and pushed
- A GitHub release is created with the packaged VSIX file
- The extension is published to VS Code Marketplace and Open VSX Registry (if tokens are configured)
Repository Secrets for Publishing
To enable automated publishing to the extension marketplaces, set up these repository secrets in your GitHub repository:
GH_TOKEN
(optional): Personal Access Token with 'repo' scope (used for pushing version changes)
VSCE_PAT
(optional): Personal Access Token for VSCode Marketplace publishing
OVSX_PAT
(optional): Personal Access Token for Open VSX Registry publishing
To add these secrets:
- Go to your repository on GitHub
- Navigate to Settings > Secrets and variables > Actions
- Click "New repository secret"
- Add each token with its corresponding name
Pull Request Process
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes using the conventional format (
git commit -m 'feat: add amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
Local Development
Prerequisites
- Node.js (v16 or later)
- pnpm (v8 or later)
- Cursor IDE for testing
Setup
Clone the repository:
git clone https://github.com/Ipenywis/aimemory.git
cd aimemory
Install dependencies:
pnpm install
Build the extension:
pnpm run compile
Development Workflow
Start the watch process for automatic rebuilding:
pnpm run watch
Launch the extension in debug mode:
- Press F5 in Cursor
- Or run the "Run Extension" launch configuration
Test the extension:
- Run commands from the Command Palette
- Use
/memory
commands in Cursor AI
Building VSIX Package
To package the extension for distribution:
pnpm run package
pnpm run package:vsce
The VSIX file will be created in the project root directory.
License
Apache 2.0
Enjoy!