Semantic grep for the terminal — search files by meaning, not pattern
Project description
semsearch
Semantic grep for the terminal. Search files by meaning, not pattern.
Uses fastembed (BAAI/bge-small-en-v1.5) + FAISS for fast local vector search. No API keys needed — everything runs locally.
Install
pip install semsearch
Usage
# Search a file
semsearch "deployment issue" logs.md
# Search multiple files, top 3 results
semsearch "permission error" memory/*.md -k 3
# Show 2 lines of context around each match
semsearch "database migration" notes.md -n 2
# Force re-index (ignore cache)
semsearch "query" file.md --reindex
# Set minimum similarity threshold
semsearch "auth bug" *.md -m 0.5
How it works
- On first search, each file's non-empty lines are embedded and cached in
~/.cache/semsearch/ - Cache is keyed by file content hash — changes auto-invalidate
- Your query is embedded and compared via FAISS inner-product search
- Results are printed grep-style with similarity scores
Options
| Flag | Description | Default |
|---|---|---|
-k, --top-k |
Number of results | 5 |
-n, --context |
Context lines before/after | 0 |
-m, --max-distance |
Minimum similarity score | none |
--reindex |
Force re-embed | false |
--model |
Embedding model | BAAI/bge-small-en-v1.5 |
--no-cache |
Skip cache | false |
--version |
Print version |
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
semfind-0.1.0.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semfind-0.1.0.tar.gz.
File metadata
- Download URL: semfind-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f3e02a5b63b4a6307f997007272eefa094e1bf0562366d4480e206cba95c7e7
|
|
| MD5 |
c1b56183124881f914cc9ea4863085b7
|
|
| BLAKE2b-256 |
575061ed785adfa65e7315445ada054d301c79d6c506bef30681cf87f358cb4a
|
File details
Details for the file semfind-0.1.0-py3-none-any.whl.
File metadata
- Download URL: semfind-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8ffeee9952a38834efcb573c196239a0b0c1ffe658c96c578065abd05167f7a
|
|
| MD5 |
36d206a61c55dfa760304856131c28d5
|
|
| BLAKE2b-256 |
da8a266ce83c477b09e96370d72425f00047d307d3c666cb3e5388489d13936e
|