similar
fialr similar <file> [options]Find files in the corpus that are semantically similar to the given file, ranked by cosine similarity. Uses stored vector embeddings.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
file | Path to the reference file |
Options
Section titled “Options”| Option | Description |
|---|---|
--limit N | Maximum results (default: 10) |
--threshold N | Minimum similarity score, 0.0–1.0 (default: 0.0) |
-v, --verbose | Show debug output |
What it does
Section titled “What it does”Retrieves the stored embedding for the given file and compares it against all other embeddings in the corpus using cosine similarity. Results are ranked by similarity score and returned with file metadata.
If the reference file does not have an embedding, run fialr embed first.
Output
Section titled “Output”similar ~/Documents/2024-q1_report.pdf
SIMILAR 8 files (threshold: 0.0)──────────────────────────────────────────────────────── 0.94 financial/2024-q2_report.pdf quarterly, financial, revenue 0.91 financial/2024-q3_report.pdf quarterly, financial, revenue 0.87 financial/2023-annual_report.pdf annual, financial, revenue 0.82 work/quarterly_review_template.docx quarterly, template, review 0.74 financial/2024-budget_forecast.xlsx budget, forecast, financialExamples
Section titled “Examples”# Find files similar to a specific documentfialr similar ~/Documents/contract.pdf
# Limit to top 5 results above 0.8 similarityfialr similar ~/Documents/contract.pdf --limit 5 --threshold 0.8See also
Section titled “See also”- embed — generate embeddings for the corpus
- search — semantic search with
--semanticflag - Deduplication guide — embedding-based near-duplicate detection