How kpnc0/localmind works
LocalMind is a local semantic-search CLI. Its principal workflow is to read supported files from a watch folder, extract text, embed passages, and save or incrementally reuse vectors in an on-disk index; search embeds a query, ranks indexed passages by cosine similarity, and prints file results with optional snippets. The README documents these capabilities, but the CLI orchestration and extraction implementation were not excerpted, so workflow edges rely on the README rather than inspected call sites.
Main entry points: main.rs Command handling · embed.rs Passage embedding · index.rs Binary index · extract.rs Text extraction
Components 13
CLI and results
- Command handling
src/main.rs - Terminal results
src/main.rs - Snippet formatting
src/snippet.rs
Document ingestion
- Watch folder
- Text extraction
src/extract.rs
Semantic processing
- Passage embedding
src/embed.rs - Embedding model
- Query embedding
src/embed.rs - Vector ranking
src/search.rs - Hugging Face
Index storage
- Binary index
src/index.rs - Incremental reuse
src/index.rs
Other components
- CLI user
Connections 17
- CLI user → Command handling: runs commands
Readme.md - Command handling → Watch folder: selects folder
Readme.md - Watch folder → Text extraction: supplies files
Readme.md - Text extraction → Passage embedding: provides text
Readme.md - Passage embedding → Embedding model: computes vectors
Readme.md - Command handling → Binary index: writes or opens
Readme.md - Binary index → Incremental reuse: provides cached records
Readme.md - Incremental reuse → Passage embedding: avoids re-embedding
Readme.md - Command handling → Query embedding: embeds query
Readme.md - Query embedding → Embedding model: computes vector
Readme.md - Command handling → Vector ranking: requests search
Readme.md - Binary index → Vector ranking: provides vectors
Readme.md - Vector ranking → Terminal results: returns ranked files
Readme.md - Command handling → Terminal results: prints results
Readme.md - Terminal results → Snippet formatting: formats optional snippets
Readme.md - Snippet formatting → Text extraction: reads file text
src/snippet.rs - Passage embedding → Hugging Face: downloads model files
src/embed.rs