Skip to main content
The similar command embeds your query with the same local model used by embed and returns the notes whose chunks are nearest in embedding space (cosine similarity, exact KNN). Unlike search, which matches keywords with BM25, similar finds notes that are about the same thing even when they share no words with the query. Requires smolbren embed to have run first (exit code 6 otherwise).

Synopsis

Arguments and flags

string
required
A natural-language query. Full questions and descriptions work better than single keywords — the model embeds meaning, not terms.
string
Restrict results to notes whose frontmatter type exactly matches this value. Case-sensitive; discover values with smolbren types.
integer
default:"10"
Maximum number of notes to return, best match first.

Output

A JSON array of note objects, sorted by descending score. Chunk hits are deduplicated: each note appears once, represented by its best-matching chunk.

Examples

Find notes by meaning
Restrict to one note type
similar needs both an index and embeddings. Exit code 5 means run smolbren index first; exit code 6 means run smolbren embed first. For a search that combines keyword precision with semantic recall, see search --hybrid.