> ## Documentation Index
> Fetch the complete documentation index at: https://memory.basicmachines.co/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code

> Set up Basic Memory with VS Code for file-based knowledge management and development documentation

VS Code provides excellent support for Basic Memory through direct file editing, terminal integration, and rich markdown features, making it ideal for maintaining development documentation alongside your code.

## Setup

### Configure VS Code Settings

Create or update `.vscode/settings.json` for enhanced markdown editing:

```json theme={null}
{
  "files.associations": {
    "*.md": "markdown"
  },
  "markdown.preview.breaks": true,
  "markdown.preview.linkify": true,
  "editor.wordWrap": "on",
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  "search.exclude": {
    "**/node_modules": true,
    "**/.git": true
  }
}
```

### Install Basic Memory (optional)

```bash theme={null}
# Install Basic Memory
uv tool install basic-memory

# Or with pip
pip install basic-memory
```

### Install Recommended Extensions

**Essential Extensions:**

* **Markdown All in One** - Rich markdown editing with preview
* **Markdown Preview Enhanced** - Advanced preview features
* **Git Graph** - Visual git history for your knowledge base
* **Terminal** - Built-in terminal for Basic Memory CLI

## Integration Features

### File-Based Editing

> [card] Live Editing
>
> Edit markdown files with syntax highlighting and preview

> [card] Instant Sync
>
> Changes automatically sync to knowledge graph

> [card] Search Integration
>
> Use VS Code search across all documentation

> [card] Git Integration
>
> Version control your knowledge alongside code

### Terminal Integration

Set up CLI aliases for quick access:

```bash theme={null}
# Add to your shell profile (.bashrc, .zshrc, etc.)
alias note="basic-memory tools write-note"
alias search="basic-memory tools search-notes --query"
alias recent="basic-memory tools recent-activity"

# Usage in VS Code terminal
note --title "Authentication Flow" --folder "architecture"
search "database patterns"
recent --timeframe="2 days"
```

### Multi-Root Workspace

Combine multiple projects in one workspace:

```json theme={null}
{
  "folders": [
    {
      "name": "Project Code",
      "path": "./src"
    },
    {
      "name": "Documentation",
      "path": "./docs"
    },
    {
      "name": "Shared Knowledge",
      "path": "~/knowledge"
    }
  ],
  "settings": {
    "search.exclude": {
      "**/node_modules": true,
      "**/.git": true
    }
  }
}
```

## Quick Start

### Project Structure

Organize your project with integrated knowledge:

```
my-project/
├── src/
├── tests/
├── docs/           # Basic Memory project folder
│   ├── architecture/
│   ├── decisions/
│   ├── patterns/
│   └── api/
├── .vscode/
│   └── settings.json
└── README.md
```

### Basic Usage

1. **Edit documentation** in VS Code with full IDE features
2. **Use split editor** - code on left, documentation on right
3. **Terminal commands** for quick Basic Memory operations
4. **File explorer** to navigate between code and docs
5. **Git integration** to version control everything together

## VS Code Snippets

Create custom snippets for Basic Memory patterns. Add to `.vscode/markdown.json`:

```json theme={null}
{
  "Basic Memory Note": {
    "prefix": "bmnote",
    "body": [
      "---",
      "title: ${1:Note Title}",
      "tags: [${2:tag1, tag2}]",
      "---",
      "",
      "# ${1:Note Title}",
      "",
      "## Observations",
      "- [${3:category}] ${4:observation} #${5:tag}",
      "",
      "## Relations",
      "- ${6:relation_type} [[${7:Related Note}]]",
      "",
      "$0"
    ],
    "description": "Create a Basic Memory note template"
  }
}
```

## Troubleshooting

### Common Issues

> [accordion] VS Code not recognizing markdown files
>
> **Solutions:**
>
> * Check file associations in settings
> * Install Markdown All in One extension
> * Verify markdown language mode is selected

> [accordion] Basic Memory sync not working
>
> **Solutions:**
>
> * Check sync status: `basic-memory status`
> * Start background sync: `basic-memory sync --watch`
> * Verify file permissions in project directory

> [accordion] Search not finding content
>
> **Solutions:**
>
> * Check VS Code search settings
> * Verify files are not excluded in search.exclude
> * Use Basic Memory CLI search for knowledge graph queries

### Performance Tips

* **Exclude large files**: Configure search.exclude appropriately
* **Use workspace**: Better performance than opening large folders
* **Limit extensions**: Only install needed extensions
* **Regular cleanup**: Archive old documentation periodically

## Integration Benefits

### Development Workflow

* **Real-time documentation** - Edit docs as you code
* **Unified search** - Search code and documentation together
* **Git versioning** - Track changes to both code and knowledge
* **Split editing** - View code and docs simultaneously
* **Terminal access** - Quick Basic Memory commands

### File Management

* **Direct editing** - No need for external tools
* **Rich preview** - See formatted markdown in real-time
* **Folder organization** - Maintain clear structure
* **Link navigation** - Follow wikilinks between notes
* **Syntax highlighting** - Clear visual editing

## Next Steps

> [card] [Project Documentation](https://memory.basicmachines.co/how-to/project-documentation.md)
>
> Learn effective project documentation strategies

> [card] [Note Taking](https://memory.basicmachines.co/how-to/note-taking.md)
>
> Master note-taking techniques for development

> [card] [CLI Reference](https://memory.basicmachines.co/guides/cli-reference.md)
>
> Master Basic Memory command line tools

> [card] [Knowledge Format](https://memory.basicmachines.co/guides/knowledge-format.md)
>
> Structure your development documentation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.