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

smolbren similar <query> [--type <type>] [--limit <n>]

Arguments and flags

query
string
required
A natural-language query. Full questions and descriptions work better than single keywords — the model embeds meaning, not terms.
--type
string
Restrict results to notes whose frontmatter type exactly matches this value. Case-sensitive; discover values with smolbren types.
--limit
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.
FieldTypeDescription
idstringVault-relative note ID, e.g. blogs/context-engineering
pathstringVault-relative file path including .md
typestring | nullThe note’s frontmatter type, or null
titlestringThe note’s title
scorenumberCosine similarity of the best-matching chunk, in [-1, 1]; higher is more similar
chunk_seqintegerWhich chunk of the note matched best (0-based)
snippetstringThe matching chunk’s text, truncated to ~280 characters

Examples

Find notes by meaning
smolbren similar "how should agents decide what goes into the context window"
[
  {
    "id": "blogs/context-engineering",
    "path": "blogs/context-engineering.md",
    "type": "blog",
    "title": "Context engineering",
    "score": 0.71,
    "chunk_seq": 2,
    "snippet": "…deciding what an AI system knows, when it knows it, where that knowledge came from…"
  }
]
Restrict to one note type
smolbren similar "retrieval quality tradeoffs" --type journal --limit 5
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.