# Embeddings & search

The model, the vector store, and how a query is answered.

## Model

Chunks and queries are embedded with **`BAAI/bge-small-en-v1.5`** via
[fastembed](https://github.com/qdrant/fastembed), which runs locally on CPU — no
API calls, no key. Override the model in
[`config.toml`](/docs/reference/configuration/); changing it requires re-indexing
every bookmark.

## Vector store

Each bookmark collection maps to one Chroma collection (`col_<id>`) using cosine
distance. Search embeds the query, runs a nearest-neighbour lookup capped at
`top_k`, and returns each hit as `{text, url, title, score}` where
`score = 1 − distance` (higher is closer).

An empty or missing collection returns no results rather than an error.

## `search` vs `ask`

Both tools run the identical retrieval. `search_collection` is framed for a
keyword query and returns a bare chunk list; `ask_collection` takes a
natural-language question and wraps the chunks with the question so the client
can synthesise an answer. Neither does any generation itself — that's the
client's job.
