You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
brain search: vector signal never fires in a fresh process (VECTOR_CACHE never loaded from disk) #545
cora brain <query> (and MCP cora.brain_search) never include the vector signal in a fresh process. Every query returns signals=fts (+ graph) only, despite a valid cora_index.usearch on disk.
Root cause
vector_search (src/index/brain.rs:360-366) only reads VECTOR_CACHE:
rust let cache = VECTOR_CACHE.read().unwrap(); let vi = match cache.as_ref() { Some(v) if !v.is_empty() => v, _ => return Vec::new(), // ← fresh process: cache is None → bail };
The cache is populated only by embed_project (the cora index path, src/index/brain.rs:150-159). CodeVectorIndex::load_or_create has no caller on the search path. cora brain and cora index are separate processes, so the vector index built by index is invisible to brain.
$ printf 'fn alpha() {}\nfn beta() {}\n' > lib.rs
$ cora index
✅ Indexed 2 symbols from 2 files
$ ls ~/.codecora/cora-code/
cora_index.usearch cora_index.keys cora.db
$ cora brain alpha
🧠 1 results for 'alpha'
alpha (lib.rs) [function] score=0.0164 signals=fts ← no vector signal
Cross-process check: rename cora_index.usearch → cora_index.usearch.bak, run cora brain alpha again — identical output, no warning. Search never touches the file.
Impact
Hybrid RRF fusion effectively degrades to FTS+graph in all real usage (CLI and MCP).
The Brain Mode value proposition (semantic recall) is silently absent.
In vector_search, on cache miss load the index from disk before giving up (respecting current_vector_store() for the extension), e.g.:
rust let vi = match cache.as_ref() { Some(v) if !v.is_empty() => v, _ => { drop(cache); // populate cache from disk (load_or_create), then re-read } };
Mind the write-lock ordering with embed_project and the dimension-mismatch handling (check_dimension_compat). A user-visible notice when the store is empty but symbols exist would also help diagnosis.
Found while reviewing #543 (that PR is opt-in vecq; this bug is pre-existing on develop).
Activity
fix(brain): load vector index from disk on the search path (#545) (#546)