Problem
Basic Memory requires SQLite's FTS5 (Full-Text Search version 5) extension for its search functionality, but doesn't check if FTS5 is available before attempting to use it. This causes failures on systems where SQLite is compiled without FTS5 support.
Current Behavior
- The application attempts to create an FTS5 virtual table without checking availability
- On systems without FTS5 support, this results in an error during database initialization
- Users get a cryptic SQLite error instead of a clear message about the missing dependency
Proposed Solution
Add a startup check that:
- Tests if FTS5 is available in the current SQLite installation
- Provides a clear, actionable error message if FTS5 is missing
Implementation Details
The check could be added in src/basic_memory/db.py during database initialization:
def check_fts5_support(conn):
"""Check if SQLite has FTS5 support enabled."""
try:
conn.execute("CREATE VIRTUAL TABLE temp_fts5_check USING fts5(content)")
conn.execute("DROP TABLE temp_fts5_check")
return True
except sqlite3.OperationalError as e:
if "no such module: fts5" in str(e):
return False
raise
If FTS5 is not available, display an error like:
Error: SQLite FTS5 extension is not available.
Basic Memory requires SQLite with FTS5 support for search functionality.
Additional Considerations
- Document the FTS5 requirement in README.md and installation guides
- Consider adding this check to the test suite
- Could potentially add a fallback search mechanism (though this would be a larger change)
Related Issues
This issue was discovered during testing of the basic-memory-installer on a fresh macOS VM where the system SQLite lacked FTS5 support.
Problem
Basic Memory requires SQLite's FTS5 (Full-Text Search version 5) extension for its search functionality, but doesn't check if FTS5 is available before attempting to use it. This causes failures on systems where SQLite is compiled without FTS5 support.
Current Behavior
Proposed Solution
Add a startup check that:
Implementation Details
The check could be added in
src/basic_memory/db.pyduring database initialization:If FTS5 is not available, display an error like:
Additional Considerations
Related Issues
This issue was discovered during testing of the basic-memory-installer on a fresh macOS VM where the system SQLite lacked FTS5 support.