Basic Memory Sync Issues Resolution Guide
Current Sync Error
The Basic Memory sync is failing with a database constraint error:
(sqlite3.IntegrityError) UNIQUE constraint failed: entity.file_path, entity.project_id
[SQL: UPDATE entity SET file_path=? WHERE entity.id = ?]
[parameters: ('quartz/i18n/locales/ro-RO.ts', 220)]
Root Cause
This error occurs when Basic Memory tries to update an entity with a file path that already exists for the same project. This can happen when:
- Files are moved or renamed outside of Basic Memory
- The database has stale entries from previous file locations
- Multiple files with the same path were indexed at different times
For broader patterns on building resilient systems that handle failures gracefully, see Error Recovery & Resilience Patterns.
Resolution Steps
Option 1: Restart Basic Memory MCP Server (Recommended)
- Stop the Basic Memory MCP server
- Clear any cache or temporary files
- Restart the server to trigger a fresh sync
Option 2: Create New Project
If restarting doesn’t resolve the issue:
- Create a new Basic Memory project for the repository
- This will start with a clean database
- All files will be freshly indexed
# Using Basic Memory MCP
create_memory_project("claude-research-v2", "/Users/johnlindquist/dev/claude-research")
switch_project("claude-research-v2")Option 3: Manual Database Cleanup
For advanced users only:
- Locate the Basic Memory database
- Remove duplicate entries for the affected file paths
- Restart the sync process
Prevention
To prevent future sync issues:
- Use Basic Memory for file operations - When moving or renaming files, use Basic Memory’s move_note function
- Regular sync checks - Periodically check sync status
- Avoid external file moves - Don’t move files outside of Basic Memory while it’s running
- Single project instance - Ensure only one Basic Memory project points to the same directory
Current Workaround
Despite the sync error, Basic Memory is still functional for most operations:
- File reading and writing work normally
- Search functionality is available for previously indexed content
- New files can be created and will be indexed
The sync error primarily affects:
- Automatic indexing of externally created files
- Updates to file paths in the database
- Complete project synchronization
Next Steps
- Monitor the Basic Memory GitHub repository for updates
- Consider filing an issue if the problem persists
- Use the workaround methods documented above
- Continue using Basic Memory with awareness of the limitation
Related Resources
- Basic Memory Integration Guide
- Error Recovery & Resilience Patterns
- General Troubleshooting Guide
- Basic Memory Documentation
basic-memory troubleshooting sync-issues database claude-code