When working with AI agents in Cursor, you might notice that the context from one task can bleed into another. A "memory project" set in one chat will remain active even when you start a new conversation. This persistence, managed by an underlying MCP (Model Context Protocol) server, is powerful but can lead to confusion and errors—like writing notes or files to the wrong project—if you're not aware of it.
This lesson dives into how this persistence works, shows you how to inspect the underlying configuration and logs, and demonstrates the most critical best practice for working with multiple memory projects: always start your task by explicitly telling the AI which project to use. By adopting this simple habit, you can prevent context-switching errors and ensure your AI agents work reliably and predictably across all your projects.
The state of the active "memory project" is cached and persists across different chat sessions. If you switch from working on "Project A" to "Project B" without explicitly changing the memory project, the AI might still operate within the context of "Project A," causing it to save files or access information from the wrong place.
To ensure the AI always operates in the correct context, make it a habit to start any multi-step prompt, rule, or script with a clear, explicit command to switch to the desired memory project. This simple first step prevents ambiguity and ensures your actions are always applied to the correct target.
mcp.json configuration to see how the default project is set.MCP Logs in the Output panel to understand the server's lifecycle.Please get my current memory project.
Set my current memory project to issues.
Set my current memory project to script-generator.
Switch my current project to issues.
Please show me my current memory project.
Create a markdown note in my knowledge folder that there is a grid view and a list view, and that grid view appears in desktop mode, and list view appears on mobile mode.
Please switch to my script generator memory project.
/mcp
This mcp.json configuration shows the basic-memory server being started with a default --project of script-generator.
{
"mcpServers": {
"basic-memory": {
"command": "uvx",
"args": [
"basic-memory",
"mcp",
"--project",
"script-generator",
"mcp"
]
}
}
}
[00:00] Now it is important to be aware of switching back and forth between projects. So if I say please get my current memory project, so right now it's set to script generator, and I say set my current memory project to issues, like we did when parsing out the notes from today, this will now be set to issues. Now if I start a new conversation and I say please get my current memory project, you'll see this is still set to issues. Now if you look at the settings with Command-Shift-J, hop over to the tools, you can hit tab to focus the search box and search quickly. We'll scroll down to basic memory and you'll see it's essentially starting up an MCP server when cursor starts up.
[00:38] And if you ever want to look at the output of MCP servers and see what's going on, if you focus on the output view with command-shift-U, make sure and swap over to the MCP logs. You can also search for it in the command palette, it's called output view. I'll go ahead and clear the output, you'll see if I toggle basic memory off and on again, you'll see it's handling the listings and it's connected and it found the tools and that's about as much information as you get. So in this scenario when you run this again, you'll see that the current memory project is still set to issues. Now because this is cached somewhere, when swapping back and forth between various tasks, if you want to be very specific about which memory project to use, you should always start with in your rules or scripts which one you want it to use to avoid accidentally calling another one.
[01:24] So just set my current memory project to script generator is enough to make sure your agent starts with the right files and directories when working with multiple projects. So it's just important to keep in mind in case you start building up lots of projects that step number one in rules and in scripts is always switch project. Because you'll notice that even if I say switch my current project to issues and I'll open up Cloud code, which I'll show you how to configure in the next lesson. If I run the slash mcp command, you'll see basic memory was already set up. And if I tell Claude to check on please show me my current memory project, You'll see the current project is issues.
[02:03] So there's something at the basic memory level which is storing the current project and nothing short of quitting cursor so that everything shuts down. We'll reset this back to default. It's just one of those situations where you don't know if that's a bug or a feature, But it's definitely something to be aware of. So if I say something like create a markdown note in my knowledge folder that there is a grid view and a list view and that grid view appears in desktop mode and list view appears on mobile mode, we'll see that it's writing a note and it created a note in a knowledge folder, but if we check our issues directory you'll see a new knowledge folder. That's obviously not what we wanted, so I'd have to delete that, come back up, insert, please switch to my script generator memory project, then run this again, and now this time we'll have our knowledge with our new note in place in the correct folder and in the correct project.