Overview
Basic Memory integrates with VS Code through the Model Context Protocol (MCP), allowing AI assistants in VS Code to access and manage your knowledge base while you code. This is particularly useful for:
Documenting code decisions and architecture
Maintaining project-specific knowledge
Building context for code reviews
Tracking technical debt and TODOs
Capturing meeting notes and decisions
Prerequisites
VS Code with MCP support (requires compatible AI extension)
Basic Memory installed on your system
Installation
Install Basic Memory
Install Basic Memory using uv (recommended): uv tool install basic-memory
Alternatively, use pip:
Choose Configuration Method
You can configure Basic Memory for VS Code in two ways:
User Settings - Available across all workspaces
Workspace Settings - Specific to a project, can be shared with team
Configuration
User Settings
Workspace Settings
Project-Specific
Configure Basic Memory globally for all VS Code workspaces.
Open User Settings (JSON)
Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) and type: Preferences: Open User Settings (JSON)
Add MCP Configuration
Add this configuration to your user settings: {
"mcp" : {
"servers" : {
"basic-memory" : {
"command" : "uvx" ,
"args" : [ "basic-memory" , "mcp" ]
}
}
}
}
If you installed with pip instead of uv, use "command": "basic-memory" and "args": ["mcp"]
Configure Basic Memory for a specific project workspace. This is useful for:
Sharing configuration with team members
Using project-specific Basic Memory projects
Version controlling the configuration
Create .vscode Directory
In your project root, create a .vscode directory if it doesn’t exist:
Create mcp.json File
Create a file at .vscode/mcp.json with this content: {
"servers" : {
"basic-memory" : {
"command" : "uvx" ,
"args" : [ "basic-memory" , "mcp" ]
}
}
}
Commit Configuration (Optional)
Add the configuration to version control to share with your team: git add .vscode/mcp.json
git commit -m "Add Basic Memory MCP configuration"
Configure VS Code to use a specific Basic Memory project: {
"servers" : {
"basic-memory" : {
"command" : "uvx" ,
"args" : [
"basic-memory" ,
"mcp" ,
"--project" ,
"your-project-name"
]
}
}
}
This is especially useful when working on multiple projects. You can have different .vscode/mcp.json files in each repository.
Starting the Sync Process
For real-time synchronization between files and the database, run:
# One-time sync
basic-memory sync
# Real-time sync (recommended)
basic-memory sync --watch
Run basic-memory sync --watch in a VS Code terminal to keep it running while you work.
Usage Examples
Documenting Architecture Decisions
You: Create a note documenting our decision to use SQLite for
local storage instead of a full PostgreSQL setup.
AI: [Uses write_note to create architecture decision record]
Retrieving Context During Code Review
You: What was our rationale for the async client pattern?
AI: [Uses build_context to load related architecture notes]
Based on your architecture notes, the async client pattern was
chosen because...
Tracking Technical Debt
You: Add a note about the authentication refactor we need to do
AI: [Creates note with technical debt observations and relations
to affected components]
Searching Documentation
You: Find all notes about database migrations
AI: [Uses search_notes with relevant filters]
I found 5 notes about database migrations...
Development Workflows
Code Documentation Workflow
Write Code
Develop features as usual in VS Code
Document Decisions
Ask the AI to create notes about important design decisions: "Create a note about why we chose this caching strategy"
Link Related Concepts
Build connections between related notes: "Link this note to our performance optimization notes"
Review and Refine
Open the notes in your file browser or Obsidian to review and enhance
Meeting Notes Workflow
Start Meeting
Open VS Code before or during the meeting
Capture Notes
Ask AI to create structured meeting notes: "Create a meeting note for today's sprint planning with attendees,
decisions, and action items"
Link to Relevant Code
Connect meeting decisions to code: "Link this decision to the authentication module"
The AI assistant in VS Code has access to all Basic Memory tools:
write_note Create notes with observations and relations
read_note Read notes by title or permalink
search_notes Full-text search across knowledge base
build_context Navigate the knowledge graph
recent_activity See recently updated content
list_directory Browse project directories
edit_note Make incremental edits to notes
canvas Create visual knowledge maps
Viewing Your Notes
Notes are stored as Markdown files and can be viewed in:
VS Code
Obsidian
Command Line
Open notes directly in VS Code: # Open project directory
code ~/basic-memory
# Or open specific note
code ~/basic-memory/notes/my-note.md
VS Code’s built-in Markdown preview works great for viewing notes. Open your Basic Memory project directory in Obsidian for:
Rich graph view visualization
Advanced linking and backlinks
Canvas support
Plugin ecosystem
In Obsidian: File → Open vault → Choose basic-memory directory View notes with any terminal tool: # List all notes
ls ~/basic-memory
# View a note
cat ~/basic-memory/notes/my-note.md
# Search notes
grep -r "search term" ~/basic-memory
Tips for VS Code Users
Use Workspace-Specific Projects
Create a Basic Memory project for each code repository: basic-memory project add "my-app" ~/code/my-app/docs
Then configure .vscode/mcp.json to use that project: {
"servers" : {
"basic-memory" : {
"command" : "uvx" ,
"args" : [ "basic-memory" , "mcp" , "--project" , "my-app" ]
}
}
}
Track your knowledge base with git: cd ~/basic-memory
git init
git add .
git commit -m "Initial knowledge base"
Install VS Code Markdown extensions for better note editing:
Markdown All in One
Markdown Preview Enhanced
Markdown Links
Create VS Code snippets for common note patterns: {
"Basic Memory Observation" : {
"prefix" : "obs" ,
"body" : [ "- [$1] $2" ]
},
"Basic Memory Relation" : {
"prefix" : "rel" ,
"body" : [ "- $1 [[$2]]" ]
}
}
Troubleshooting
MCP server not connecting
Verify Basic Memory is installed: basic-memory --version
Check your MCP configuration syntax in settings
Restart VS Code
Check VS Code’s Output panel for MCP errors
Ensure Basic Memory has write access to the project directory
Check file ownership: ls -la ~/basic-memory
Fix permissions if needed: chmod -R u+rw ~/basic-memory
Verify sync is running: basic-memory status
Check for errors: basic-memory doctor
Manually sync: basic-memory sync
Next Steps
Writing Effective Notes Learn note format and best practices
Search Techniques Master search and discovery features
Project Management Organize knowledge with multiple projects
Visualization Create visual knowledge maps