Improved
- RAM optimization: eliminate double tokenization —
extract_chunksinbm25_index.rs,artifact_index.rs, andchunks_ts.rsno longer allocates atokens: Vec<String>per chunk. Token count is computed inline; the vector is set toVec::new().add_chunktokenizes fromcontentonce for the inverted index and overwritestoken_countfrom the fresh result. This eliminates one redundant allocation + tokenization pass per chunk during index build. - MemoryProfile fully wired — The
MemoryProfileenum (low/balanced/performance) now actively controls runtime behavior:max_bm25_cache_bytes()respects profile limits (64 / 128 / 512 MB), with explicit user config taking precedence.- Semantic cache (
SemanticCacheIndex) is skipped entirely whenmemory_profile = low. - Embedding engine loading is skipped in
ctx_semantic_searchandctx_knowledgewhenmemory_profile = low.
- Doctor shows active memory profile —
lean-ctx doctornow displays the effective memory profile (low / balanced / performance), its source (env / config / default), and what it controls (cache limits, embedding status). Helps users understand and debug RAM behavior. - MCP manifest regenerated — Updated
mcp-tools.jsonto reflect current tool count (57 granular tools).
Upgrade
lean-ctx update # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.5.12...v3.5.12