Core Commands

import

Imports external knowledge sources with support for project targeting:

# Claude conversations
basic-memory import claude conversations

# Claude projects
basic-memory import claude projects

# ChatGPT history
basic-memory import chatgpt

# Memory JSON format
basic-memory import memory-json /path/to/memory.json

# Import to specific project
basic-memory --project=work import claude conversations

status

Shows system status information:

# Basic status check
basic-memory status

# Detailed status
basic-memory status --verbose

# JSON output
basic-memory status --json

project

Manage multiple projects with the new unified database architecture. Projects can now be switched instantly during conversations without restart.

# List all configured projects with status
basic-memory project list

# Create a new project
basic-memory project add work ~/work-basic-memory

# Set the default project
basic-memory project default work

# Remove a project (doesn't delete files)
basic-memory project remove personal

# Show detailed project statistics
basic-memory project info

You can also manage projects within an LLM chat via mcp tools.

Using Projects in Commands

All commands support the --project flag to specify which project to use:

# Sync a specific project
basic-memory --project=work sync

# Run MCP server for a specific project
basic-memory --project=personal mcp

tools

Direct access to MCP tools via CLI with new editing and file management capabilities:

# Create notes
basic-memory tool write-note --title "My Note" --content "Content here"

# Search notes
basic-memory tool search-notes --query "authentication"

help

The full list of commands and help for each can be viewed with the --help argument.

basic-memory --help

You need to install Basic Memory via uv or pip to use the command line tools. See the Getting Started guide for installation instructions.

sync

Keeps files and the knowledge graph in sync:

Changes sync automatically - no manual sync required.

# Basic sync
basic-memory sync

# Watch for changes
basic-memory sync --watch

# Show detailed sync information
basic-memory sync --verbose

Options:

  • --watch: Continuously monitor for changes
  • --verbose: Show detailed output

As of the v0.12.0 release syncing will occur in real time when the mcp process starts.

  • The real time sync means that it is no longer necessary to run the basic-memory sync --watch process in a terminal to sync changes to the db (so the AI can see them). This will be done automatically.

This behavior can be changed via the config. The config file for Basic Memory is in the home directory under .basic-memory/config.json.

To change the properties, set the following values:

~/.basic-memory/config.json
{
  "sync_changes": false,
}

Using stdin with Basic Memory’s write_note Tool

The write-note tool supports reading content from standard input (stdin), allowing for more flexible workflows when creating or updating notes in your Basic Memory knowledge base.

Use Cases

This feature is particularly useful for:

  1. Piping output from other commands directly into Basic Memory notes
  2. Creating notes with multi-line content without having to escape quotes or special characters
  3. Integrating with AI assistants like Claude Code that can generate content and pipe it to Basic Memory
  4. Processing text data from files or other sources

Basic Usage

Method 1: Using a Pipe

You can pipe content from another command into write_note:

# Pipe output of a command into a new note
echo "# My Note\n\nThis is a test note" | basic-memory tool write-note --title "Test Note" --folder "notes"

# Pipe output of a file into a new note
cat README.md | basic-memory tool write-note --title "Project README" --folder "documentation"

# Process text through other tools before saving as a note
cat data.txt | grep "important" | basic-memory tool write-note --title "Important Data" --folder "data"

Method 2: Using Heredoc Syntax

For multi-line content, you can use heredoc syntax:

# Create a note with heredoc
cat << EOF | basic-memory tool write_note --title "Project Ideas" --folder "projects"
# Project Ideas for Q2

## AI Integration
- Improve recommendation engine
- Add semantic search to product catalog

## Infrastructure
- Migrate to Kubernetes
- Implement CI/CD pipeline
EOF

Method 3: Input Redirection

You can redirect input from a file:

# Create a note from file content
basic-memory tool write-note --title "Meeting Notes" --folder "meetings" < meeting_notes.md

Integration with Claude Code

This feature works well with Claude Code in the terminal:

CLI

In a Claude Code session, let Claude know he can use the basic-memory tools, then he can execute them via the cli:

echo "# Test Note from Claude\n\nThis is a test note created by Claude to test the stdin functionality." | basic-memory tool write-note --title "Claude Test Note" --folder "test" --tags "test" --tags "claude"
# Stable releases
pip install basic-memory

# Beta/pre-releases
pip install basic-memory --pre

# Latest development builds (auto-published)
pip install basic-memory --pre --force-reinstall

# Check current version
basic-memory --version

Troubleshooting Common Issues

Sync Conflicts

If you encounter a file changed during sync error:

  1. Check the file referenced in the error message
  2. Resolve any conflicts manually
  3. Run sync again

Import Errors

If import fails:

  1. Check that the source file is in the correct format
  2. Verify permissions on the target directory
  3. Use —verbose flag for detailed error information

Status Issues

If status shows problems:

  1. Note any unresolved relations or warnings
  2. Run a full sync to attempt automatic resolution
  3. Check file permissions if database access errors occur