AI coding assistants are incredibly powerful, but their memory is often ephemeral. They forget context between conversations, forcing you to repeat information and lose valuable insights. This lesson introduces basic-memory, a knowledge management system that solves this by allowing your AI assistant to build a persistent, local knowledge graph using simple Markdown files.
basic-memory integrates directly with Cursor via the Model Context Protocol (MCP), enabling your AI to read and write notes about your project. This creates a long-term memory that the AI can access and build upon over time, all stored as human-readable files right in your project directory.
Workflow Demonstrated
- Install and Initialize: Use a single command to install 
basic-memoryand initialize a new memory store for your current project. - Configure the MCP Server: Create a simple 
mcp.jsonfile in your.cursordirectory to connectbasic-memoryto Cursor's tool system. - Write to Memory: Use a natural language prompt in Cursor to instruct the AI to create a new note, which 
basic-memorysaves as a Markdown file. - Read from Memory: Ask the AI to retrieve and summarize existing notes, demonstrating its ability to access its long-term, project-specific knowledge.
 
Key Benefits
- Persistent Knowledge: Your AI can pick up conversations right where you left off, retaining context from previous interactions.
 - Local-First & Human-Readable: All knowledge is stored as structured Markdown files on your computer, which you can read and edit directly.
 - Structured & Searchable: The AI can read, write, and search through notes, effectively building a traversable knowledge graph for your project.
 - Seamless Integration: Works directly with Cursor (or any compatible LLM) through the Model Context Protocol (MCP), enabling powerful, stateful automation.
 
Commands Used
Install the basic-memory tool.
Check the available commands for the basic-memory CLI.
Add a new basic-memory project, linking a name to a specific directory path for storing memories.
MCP Configuration
Create a .cursor/mcp.json file and add the following configuration, replacing your-project-name with the name you used in the project add command (script-generator in this example).
AI Prompts
A prompt to ask the AI to write a new note to its memory.
A prompt to ask the AI to retrieve and summarize information from its memory.