Skip to content

[BUG] project info crashes with no such module: vec0 #652

Closed

Description

@cderv

Bug Description

bm project info crashes with no such module: vec0 when sqlite-vec isn't loaded in the
Python environment (e.g., stock CPython on Windows).

Steps To Reproduce

  1. Install via uv tool install basic-memory (uses CPython 3.13 which doesn't bundle sqlite-vec)
  2. Run bm project info <project>

Expected Behavior

The command should handle missing sqlite-vec gracefully, similar to how it already short-circuits
when vector tables don't exist.

Actual Behavior

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such module: vec0
[SQL: SELECT COUNT(*) FROM search_vector_chunks c JOIN search_vector_embeddings e
ON e.rowid = c.id WHERE c.project_id = ?]

Environment

  • OS: Windows 11
  • Python: 3.13.9
  • Basic Memory: 0.19.1
  • Installation: uv tool

Additional Context

get_embedding_status in project_service.py checks sqlite_master for the vector tables
before querying them. But vec0 virtual tables show up in sqlite_master even when the module
isn't loaded — the tables were created by a previous migration or environment where sqlite-vec
was available. The existence check passes, but the query fails.

Possible Solution

The check could be complemented by verifying vec0 is actually loadable, or the vector queries
could fall back to vector_tables_exist=False on OperationalError.

Activity

  1. cderv commented on Mar 9, 2026

    @cderv
    Author

    After some more digging — sqlite-vec is actually installed and importable in the uv tool environment:

    >>> import sqlite_vec
    >>> sqlite_vec.loadable_path()
    '...sqlite_vec/vec0'

    So the issue may not be a missing package. Looking at the code, get_embedding_status queries vec0 virtual tables through self.repository.execute_query (the base repository), while the sqlite-vec extension loading logic lives in the search repository (_ensure_sqlite_vec_loaded). The extension may just not be loaded on the connection used for the query.

  2. changed the title [-][BUG] project info crashes when sqlite-vec module is unavailable[/-] [+][BUG] project info crashes with `no such module: vec0`[/+] on Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions