---
title: "Semantic Search"
description: "Meaning-based retrieval with vector and hybrid search in Basic Memory."
canonical_url: "https://docs.basicmemory.com/concepts/semantic-search"
---
# Semantic Search

> Meaning-based retrieval with vector and hybrid search in Basic Memory.

Most knowledge tools make you organize everything up front so you can find it later. Basic Memory takes the opposite approach — write naturally, and let search figure out the connections.

<docs-video alt="Semantic search answering a plain-language question" poster="/videos/posters/docs-semantic-search.png" src="https://docs.basicmemory.com/videos/docs-semantic-search.mp4">



</docs-video>

When you or your AI save a note, Basic Memory indexes it two ways: by the exact words it contains, and by what it *means*. Search for "login security improvements" and find notes about "authentication hardening" even though the exact words don't match. This happens automatically — no tagging system to maintain, no folder hierarchy to get right.

What makes this different from a typical search tool is that your AI is part of the loop. It writes notes, searches them, and builds on what it finds — all through the same tools. The search index updates incrementally as notes change, so the AI is always working with current knowledge, not a stale snapshot.

<mermaid code="flowchart LR
    Q[Query] --> T[Text Search]
    Q --> V[Vector Search]
    T --> SF[Score Fusion]
    V --> SF
    SF --> RR{Reranking enabled?}
    RR -->|No| R[Results]
    RR -->|Yes| X[Cross-encoder rerank]
    X --> R
">



</mermaid>

---

## Search modes

Basic Memory supports three search modes. Your AI already knows when to use each one — just describe what you're looking for in plain language. You can also use them directly from the command line.

### Text

Keyword search. You type words, it finds notes containing those words. Supports boolean operators like `AND` and `OR`.

<code-group>

```text [Conversation]
You: "Search my notes for project AND planning"
AI: [Finds notes containing both words]
```

```bash [CLI]
bm tool search-notes "project AND planning"
```

</code-group>

Best when you know the exact terms — names, identifiers, tags. A query that uses `AND`, `OR`, or `NOT` without an explicit search type runs as text search, so `coffee NOT pour` excludes any note that mentions "pour" anywhere. Other queries from the CLI run as hybrid by default.

Full-text search also finds words in scripts written without spaces — Chinese, Japanese, Korean, Thai, Lao, Tibetan, Myanmar, and Khmer — by indexing single characters and character pairs alongside whole words (new in v0.24, on both SQLite and Postgres). Notes indexed before upgrading gain this after `bm reindex --search`. If a long unspaced compound finds nothing, the empty result carries a `query_hint` suggesting a shorter word or spaces between words.

### Vector

Meaning-based search. Your query is compared against all indexed content by meaning, not exact words. Searching for "ways to make the frontend faster" finds notes about "React performance optimization" and "bundle size reduction."

<code-group>

```text [Conversation]
You: "Find notes about ways to make the frontend faster"
AI: [Finds notes about React performance, bundle size, lazy loading]
```

```bash [CLI]
bm tool search-notes "ways to make the frontend faster" --vector
```

</code-group>

Best for conceptual queries when you aren't sure what words were used.

### Hybrid (default)

Runs both text and vector search, then combines results. Notes found by both methods rank highest. Notes found by only one method still appear but rank lower.

<code-group>

```text [Conversation]
You: "Search for authentication security"
AI: [Finds notes matching the words AND notes about related concepts]
```

```bash [CLI]
bm tool search-notes "authentication security"
```

</code-group>

This is the default. You get keyword precision plus meaning-based recall.

### You don't need to pick

Basic Memory describes each search mode to your AI, so it already knows when to use text, vector, or hybrid search. Just ask for what you want in plain language:

- "Find my notes about authentication security" — the AI runs a hybrid search
- "Search for the exact phrase project AND planning" — the AI switches to text search
- "What have I written about handling failures gracefully?" — the AI uses vector search

If you're using the CLI directly, pass the query as an argument — hybrid is the default and covers most cases. Use `--vector` when you're exploring by concept, or `--hybrid` to combine both explicitly.

---

## Filtering

### Tag search

Search by tag using a simple prefix:

<code-group>

```text [Conversation]
You: "Search for notes tagged security"
You: "Search for tag:coffee AND tag:brewing"
```

```bash [CLI]
bm tool search-notes "tag:security"
```

</code-group>

### Metadata filters

Search by note properties — like status, tags, or any custom frontmatter field — without needing a text query:

<code-group>

```text [Conversation]
You: "Show me all my in-progress notes"
You: "Find notes tagged security and oauth"
You: "What are my high-priority items?"
```

```bash [CLI]
bm tool search-notes "" --meta status=in-progress
bm tool search-notes "" --tag security --tag oauth
bm tool search-notes "" --filter '{"priority": {"$in": ["high", "critical"]}}'
```

</code-group>

<tip>

See [Metadata Search](https://docs.basicmemory.com/concepts/metadata-search) for the full operator reference, nested-field syntax, and worked examples.

</tip>

### Valid-time filters

Observations can carry a date qualifier that says when a fact holds — `- [decision] @effective:2026-06-10 ...` (see [Observations and Relations](https://docs.basicmemory.com/concepts/observations-and-relations#when-a-fact-holds-valid-time)). `bm_search` can filter on that authored time with `valid_at` (true at a date or instant), `valid_overlaps` (true at any point in a range), and `time_kind` (`effective`, `valid`, `occurred`, `due`, or `mentioned`):

```text
You: "Which caching decisions were in effect on July 1st?"
AI: [bm_search("caching", valid_at="2026-07-01", time_kind="effective")]
```

These filters only match observations that carry a qualifier, and they compose with vector and hybrid search. Details are in [Metadata Search](https://docs.basicmemory.com/concepts/metadata-search#searching-by-valid-time).

### Combining text and filters

Combine a text or meaning-based search with property filters:

<code-group>

```text [Conversation]
You: "Search for authentication notes that are specs"
You: "Find active error handling notes"
```

```bash [CLI]
bm tool search-notes "authentication" --type spec
bm tool search-notes "error handling" --meta status=active
```

</code-group>

### Searching across projects

Search normally runs in one project. Pass `all_projects=True` to search every project, or `projects=["work", "research"]` to search a chosen set (new in v0.24). Results come back as a single ranking across the chosen projects, and each hit names its project.

```text
You: "Search my work and research projects for rate limiting"
AI: [bm_search("rate limiting", projects=["work", "research"])]
```

---

## Enabling semantic search

Semantic search works automatically — there's nothing to set up, and as of [v0.24](https://docs.basicmemory.com/whats-new/v0-24) there's nothing to turn off either. The `semantic_search_enabled` setting has been removed; FastEmbed and sqlite-vec are core dependencies of every install (Homebrew and uv). An old `config.json` value or `BASIC_MEMORY_SEMANTIC_SEARCH_ENABLED` variable is ignored, so an install that had turned semantic search off will download the embedding model and build vectors after upgrading. Embeddings are generated automatically on first startup for existing notes.

<note>

Where the sqlite-vec extension can't load — notably the python.org Python build on macOS — search falls back to keyword-only. A vector or hybrid query then says semantic search is unavailable and points at the log. `bm project info <name>` shows whether the vector runtime is available. Installing Basic Memory with Homebrew, or with uv using a uv-managed Python, avoids it.

</note>

For a few hundred notes, expect 1–3 minutes for the initial index build. After that, new and edited notes are indexed incrementally during normal sync.

To manually rebuild the search index (for example, after switching embedding providers):

```bash
bm reindex --embeddings
```

Changing the Postgres vector index between pgvector and Milvus also requires this command. Until it completes, vector search returns nothing and hybrid search serves full-text results only. Follow [Run Postgres with Milvus](https://docs.basicmemory.com/local/postgres-and-milvus) for setup, switching, and recovery details.

Running on an Intel Mac? See [Platform compatibility](#platform-compatibility) below for a workaround.

---

## Enable reranking

Reranking adds a cross-encoder after vector or hybrid retrieval. Retrieval finds a candidate set; the reranker reads the query and each candidate together, then replaces the leading candidates' scores with a more precise relevance order. Text-only search is unchanged.

Reranking is opt-in:

```bash
bm config set reranker_enabled true
```

The default `fastembed` provider runs locally with `jinaai/jina-reranker-v1-tiny-en`. The first reranked search downloads the model, so expect that first request to take longer. Later requests reuse the cached process-wide model.

To use a hosted or self-hosted reranker through LiteLLM:

```bash
bm config set reranker_enabled true
bm config set reranker_provider litellm
bm config set reranker_model cohere/rerank-v3.5
export COHERE_API_KEY=...
```

LiteLLM models use explicit `provider/model` names. You can set `reranker_api_base` for a custom endpoint and `reranker_api_key` to pass the credential directly; otherwise LiteLLM uses its normal provider environment variables.

### Choose a provider

<table>
<thead>
  <tr>
    <th>
      Provider
    </th>
    
    <th>
      Runs
    </th>
    
    <th>
      Default model
    </th>
    
    <th>
      Tradeoff
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        fastembed
      </code>
    </td>
    
    <td>
      Local ONNX
    </td>
    
    <td>
      <code>
        jinaai/jina-reranker-v1-tiny-en
      </code>
    </td>
    
    <td>
      No API key or per-query cost; downloads on first use and adds local inference latency.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        litellm
      </code>
    </td>
    
    <td>
      Hosted or self-hosted API
    </td>
    
    <td>
      Set an explicit <code>
        provider/model
      </code>
    </td>
    
    <td>
      Supports Cohere, Jina, Voyage, and other LiteLLM rerank providers; adds network latency, provider cost, and credential requirements.
    </td>
  </tr>
</tbody>
</table>

### Configure reranking

<table>
<thead>
  <tr>
    <th>
      Config field
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        reranker_enabled
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Enable cross-encoder reranking for vector and hybrid search.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_provider
      </code>
    </td>
    
    <td>
      <code>
        fastembed
      </code>
    </td>
    
    <td>
      Use local <code>
        fastembed
      </code>
      
       or API-backed <code>
        litellm
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_model
      </code>
    </td>
    
    <td>
      <code>
        jinaai/jina-reranker-v1-tiny-en
      </code>
    </td>
    
    <td>
      Model identifier; LiteLLM requires <code>
        provider/model
      </code>
      
       form.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_candidates
      </code>
    </td>
    
    <td>
      <code>
        20
      </code>
    </td>
    
    <td>
      Number of leading retrieval candidates to rescore. Larger windows can improve recall but cost more time or provider usage.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_max_document_chars
      </code>
    </td>
    
    <td>
      <code>
        2000
      </code>
    </td>
    
    <td>
      Maximum candidate characters sent to the cross-encoder. <code>
        0
      </code>
      
       sends the full matched text.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_timeout
      </code>
    </td>
    
    <td>
      <code>
        30.0
      </code>
    </td>
    
    <td>
      Maximum seconds per LiteLLM request. FastEmbed ignores this setting.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_api_base
      </code>
    </td>
    
    <td>
      unset
    </td>
    
    <td>
      Custom API base for a self-hosted LiteLLM reranker.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_api_key
      </code>
    </td>
    
    <td>
      unset
    </td>
    
    <td>
      Credential passed directly to LiteLLM; normal provider environment variables work when unset.
    </td>
  </tr>
</tbody>
</table>

Every field is also available as `BASIC_MEMORY_<FIELD>`. See [Configuration](https://docs.basicmemory.com/reference/configuration#reranker-settings) for types and environment-variable names.

### Tune latency

Reranking cost depends heavily on candidate length and count:

- Short-note benchmarks add about **90 ms at p50** with the default local model and settings.
- In a long transcript-chunk benchmark, p95 latency rose from **420 ms to about 2.1 seconds** when reranking was enabled — about **5×** — while retrieval quality improved.
- Lower `reranker_candidates` when a smaller recall window still contains the right results.
- `reranker_max_document_chars` caps each candidate at 2,000 characters by default, which bounds worst-case latency on long notes and transcript chunks. The matched chunk leads the reranker document, so the strongest retrieval signal is kept first. Set it to `0` to send full text, and measure quality on your corpus before changing it.

Changing reranker settings does not change stored embeddings, so it does not require `bm reindex --embeddings`.

### Handle reranker failures

An enabled reranker is part of the requested ranking contract. Basic Memory deliberately does not fall back to the original retrieval order when reranking fails:

- Temporary provider, rate-limit, connection, timeout, or first-download failures return HTTP `503` so callers can retry.
- Malformed or incomplete provider responses return HTTP `502`.
- Authentication, model, dependency, and permanent configuration failures surface directly.
- A retryable failure from any project aborts a multi-project result page instead of returning partially reranked results.

Disable reranking if retrieval-only results are preferable to a failed request in your application.

---

## Under the Hood

You don't need to read this section to use search — it's here for the curious.

### Chunking

Notes are not searched as whole documents. Basic Memory breaks each note into smaller pieces before indexing, so search can surface the specific *part* of a note that's relevant.

<mermaid code="flowchart TD
    N[Note] --> H[Headers]
    N --> O[Observations]
    N --> R[Relations]
    N --> P[Prose]
    H --> C1[Section Chunks]
    O --> C2[Observation Chunks]
    R --> C3[Relation Chunks]
    P --> C4[Merged Chunks ~900 chars]
    C1 --> E[Embeddings]
    C2 --> E
    C3 --> E
    C4 --> E
">



</mermaid>

The chunking follows the note's structure:

- **Headers** create chunk boundaries — each section becomes its own chunk
- **Observations** (categorized facts like `- [technique] Water temperature...`) are indexed individually
- **Relations** (links to other notes like `- works_at [[Company]]`) are indexed individually
- **Prose** paragraphs are merged into chunks of ~900 characters with ~120 character overlap at boundaries

This means a search for "water temperature for brewing" can surface the specific fact `Water temperature at 205°F extracts optimal compounds` rather than returning the entire "Coffee Brewing Methods" note.

### How results are ranked

Results are returned as note-level items — plus individual observations and relations — ranked by their best-matching chunks, with the matched chunk text showing which part of the note was most relevant.

### Hybrid fusion

Hybrid mode runs text and vector search independently, then merges results using score-based fusion:

<mermaid code="flowchart LR
    Q[Query] --> FTS[Text Search]
    Q --> VS[Vector Search]
    FTS --> R1[Scored Results]
    VS --> R2[Scored Results]
    R1 --> SF[Score Fusion]
    R2 --> SF
    SF --> F[Final Ranking]
">



</mermaid>

Results found by both keyword and meaning match rank highest. The dominant signal (whichever source scored higher) is preserved, while the weaker signal adds a 30% bonus. Items found by only one source keep their original score.

Question-form queries rarely match every keyword, so when the strict all-words text query comes back empty, hybrid search retries it as a relaxed any-word query rather than letting the text half go silent. As of v0.23 this relaxation works for queries in any script — CJK, Cyrillic, Greek, Arabic, and other non-Latin alphabets included.

SQLite and PostgreSQL both search complete note bodies. Since v0.23.1, PostgreSQL stores long bodies in bounded, overlapping full-text chunks, allowing deep matches and preserving Boolean query behavior across chunk boundaries. The upgrade migration backfills existing notes automatically. A later `bm reindex --search` replaces rows only for the selected project; it does not clear sibling projects that share the same database.

### Deduplication

Each chunk has a content hash. When notes are re-synced or reindexed, unchanged chunks skip re-indexing. Only modified content triggers new embeddings. Editing one note in a thousand-note knowledge base only re-indexes the chunks that changed.

---

## Configuration

The settings you're most likely to tune:

<table>
<thead>
  <tr>
    <th>
      Config field
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        semantic_embedding_provider
      </code>
    </td>
    
    <td>
      <code>
        "fastembed"
      </code>
    </td>
    
    <td>
      Common values: <code>
        fastembed
      </code>
      
       (local), <code>
        openai
      </code>
      
       (OpenAI or any OpenAI-compatible API)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        semantic_embedding_api_base
      </code>
    </td>
    
    <td>
      unset
    </td>
    
    <td>
      Custom endpoint for the <code>
        openai
      </code>
      
       provider, such as a local embedding server
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        semantic_min_similarity
      </code>
    </td>
    
    <td>
      <code>
        0.55
      </code>
    </td>
    
    <td>
      Minimum similarity threshold
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        semantic_vector_index
      </code>
    </td>
    
    <td>
      <code>
        "pgvector"
      </code>
    </td>
    
    <td>
      Postgres vector index: <code>
        pgvector
      </code>
      
       or <code>
        milvus
      </code>
      
      ; SQLite always uses sqlite-vec
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reranker_enabled
      </code>
    </td>
    
    <td>
      <code>
        false
      </code>
    </td>
    
    <td>
      Opt in to cross-encoder reranking of vector and hybrid candidates
    </td>
  </tr>
</tbody>
</table>

The full list — models, dimensions, batch size, vector candidates, env vars — is in the [Configuration reference](https://docs.basicmemory.com/reference/configuration#semantic-search-settings).

### Similarity threshold

The `semantic_min_similarity` setting controls which results are "similar enough" to return. The value ranges from `0.0` to `1.0`:

- **Higher** (e.g., `0.7`) — Fewer results, stronger relevance. Good for focused queries.
- **Lower** (e.g., `0.3`) — More results, looser associations. Good for exploration.
- **0.0** — Disables filtering. All vector results returned regardless of score.

The default `0.55` is a reasonable middle ground.

See [Configuration](https://docs.basicmemory.com/reference/configuration) for the full config reference.

---

## Embedding providers

### FastEmbed (default)

- Runs locally — no API key, no network calls, no cost
- Model: `BAAI/bge-small-en-v1.5`
- Dimensions: 384

#### Configure a custom FastEmbed model

Choose a model from FastEmbed's installed catalog and set its actual output dimensions. Some asymmetric models also require different literal prompts for indexed passages and search queries; Basic Memory does not infer these model-specific prefixes.

For example, configure multilingual E5 with its 1024 dimensions and required `passage: ` / `query: ` prefixes:

```bash
bm config set semantic_embedding_provider fastembed
bm config set semantic_embedding_model intfloat/multilingual-e5-large
bm config set semantic_embedding_dimensions 1024
bm config set semantic_embedding_document_prefix "passage: "
bm config set semantic_embedding_query_prefix "query: "
bm reindex --embeddings
```

The trailing spaces are part of the model input. Rebuild embeddings after changing the model, dimensions, or either prefix so document and query vectors use the same contract. The default BGE model is symmetric and does not need prefixes.

### OpenAI

- Requires an [OpenAI API subscription](https://platform.openai.com/api-keys) and `OPENAI_API_KEY` environment variable
- Model: `text-embedding-3-small`
- Dimensions: 1536
- Higher dimensions capture more nuance, which can improve results for large or domain-specific knowledge bases

Switching provider or model requires rebuilding the index:

```bash
bm reindex --embeddings
```

### OpenAI-compatible endpoints

The `openai` provider honors `semantic_embedding_api_base` and `semantic_embedding_api_key` (new in v0.24), so it can point at any OpenAI-compatible embedding server — llama.cpp, vLLM, Text Embeddings Inference, LM Studio, or Ollama — and keep embeddings on your own hardware:

```bash
export BASIC_MEMORY_SEMANTIC_EMBEDDING_PROVIDER=openai
export BASIC_MEMORY_SEMANTIC_EMBEDDING_MODEL=your-model
export BASIC_MEMORY_SEMANTIC_EMBEDDING_API_BASE=http://localhost:8080/v1
export BASIC_MEMORY_SEMANTIC_EMBEDDING_API_KEY=sk-local
export BASIC_MEMORY_SEMANTIC_EMBEDDING_DIMENSIONS=768   # your model's output size
bm reindex --embeddings
```

Set the dimensions to the model's actual output size — vector storage is created at a fixed size. Many local servers ignore the key, but the OpenAI client still needs a non-empty value; when the key is unset, Basic Memory falls back to `OPENAI_API_KEY`.

---

## Platform compatibility

<table>
<thead>
  <tr>
    <th>
      Platform
    </th>
    
    <th>
      FastEmbed (local)
    </th>
    
    <th>
      OpenAI (API)
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      macOS ARM64 (Apple Silicon)
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      macOS x86_64 (Intel Mac)
    </td>
    
    <td>
      No (see workaround)
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      Linux x86_64
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      Linux ARM64
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      Windows x86_64
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Yes
    </td>
  </tr>
</tbody>
</table>

### Intel Mac workaround

The default local embedding model doesn't run on Intel Macs. You have two options:

**Option 1: Use OpenAI embeddings (recommended)**

Requires an [OpenAI API subscription](https://platform.openai.com/api-keys) — create a key there and set it as an environment variable.

```bash
export BASIC_MEMORY_SEMANTIC_EMBEDDING_PROVIDER=openai
export OPENAI_API_KEY=sk-...
bm reindex --embeddings
```

**Option 2: Pin ONNX Runtime** (uv installs)

```bash
uv tool install basic-memory --with 'onnxruntime<1.24'
bm reindex --embeddings
```

For MCP configs that launch via `uvx`, use `uvx --with 'onnxruntime<1.24' basic-memory mcp`. Homebrew installs can't pin the runtime — use the OpenAI option or switch to a uv install.

---

## Reindexing

```bash
# Incremental reindex of search index and embeddings (skips unchanged content)
bm reindex

# Force a full rebuild, re-embedding everything
bm reindex --full

# Rebuild only vector embeddings
bm reindex --embeddings

# Rebuild only full-text search index
bm reindex --search

# Reindex a specific project
bm reindex -p my-project
```

### When you need to reindex

- **First time** — Happens automatically on first startup
- **Switching provider or model** — Embeddings from different models aren't compatible
- **Switching the Postgres vector index** — Run `bm reindex --embeddings` after changing between pgvector and Milvus; the incremental rebuild is enough
- **After a database reset** — `bm reset` clears everything
- **Troubleshooting** — a full rebuild (`bm reindex --full`) can fix index issues; the default run is incremental and skips unchanged content

`bm reindex --embeddings` exits nonzero if any embedding fails. Treat that as an incomplete vector index and fix the reported provider or index error before retrying.

An incremental `bm reindex --search` also reconciles stale full-text rows, including orphaned entries for files whose contents have not changed. Try it before a full rebuild when text search returns content that was removed from disk or the current index.

---

## Inspecting retrieval

Two read-only CLI commands, new in v0.23, show what search actually did — so you can tell an indexing problem from a ranking problem:

```bash
# Is this note indexed, embedded, and current?
bm inspect chunks "my-note"

# What stages did this query run, and why did results rank the way they did?
bm inspect query "how do we handle auth" --mode hybrid
bm inspect query "auth" --mode vector --show-misses
```

`inspect chunks` shows a note's search rows and vector chunks with a per-chunk status (`ready`, `pending`, `stale`, or `orphaned`). `orphaned` means the chunk was embedded under a different model or vector index than the one configured — the classic "I switched models and now vector search finds nothing" state, fixed by `bm reindex --embeddings`.

`inspect query` traces one search execution — matching, filtering, fusion, reranking, and the final page — with scores and rerank movement, captured from the same call that returned the results. Add `--show-misses` to see why near-miss candidates were dropped.

See the [CLI Reference](https://docs.basicmemory.com/reference/cli-reference#retrieval-inspection-commands) for all flags and the JSON output contract.

---

## FAQ

### Is this RAG?

Sort of. RAG (retrieval-augmented generation) usually means fetching relevant documents and feeding them to an AI as context. Basic Memory does that — but it's tighter than a typical RAG pipeline in two ways. First, your AI reads and writes notes directly through MCP tools, and search is just one of several ways it navigates your knowledge. It's less "retrieve and generate" and more "the AI already lives in your notes." Second, most RAG setups assume static content — you load documents once and query them. Basic Memory watches for changes and selectively re-indexes only the chunks that were modified. Your knowledge base is alive, and the search index stays current as you and your AI work.

### Do I need an API key to use semantic search?

No. The default embedding provider (FastEmbed) runs entirely on your machine — no API key, no network calls, no cost. If you want to use OpenAI embeddings instead, that does require an OpenAI API key. See [Embedding providers](#embedding-providers).

### Does semantic search send my notes to the cloud?

Not with the default setup. FastEmbed generates embeddings locally on your machine. Nothing leaves your computer. If you switch to OpenAI embeddings, your note text is sent to OpenAI's API for embedding — but the resulting vectors are stored locally.

### How many notes can it handle?

Thousands without issue. The initial indexing takes a few minutes for a few hundred notes, and after that new or edited notes are indexed incrementally. The SQLite-based vector store is fast for typical personal knowledge bases.

### My search results aren't great. What can I do?

A few things to try:

- **Be more specific in your query.** "authentication" is vague; "how we handle JWT token refresh" gives the vector search more meaning to work with.
- **Lower the similarity threshold.** The default `0.55` filters out loosely related results. Try `0.3` if you want broader recall. See [Configuration](#configuration).
- **Enable reranking.** If retrieval finds the right material but orders it poorly, opt in with `bm config set reranker_enabled true`, then measure the added latency on your notes.
- **Check that embeddings are built.** Run `bm reindex --embeddings` to make sure the index is up to date.
- **Inspect what retrieval did.** `bm inspect query "your query" --show-misses` shows every stage and why candidates were dropped; `bm inspect chunks <note>` shows whether a note you expected is embedded and current. See [Inspecting retrieval](#inspecting-retrieval).
- **Try a different search mode.** If you're looking for an exact term, use text search. If you're exploring a concept, use vector search directly instead of hybrid.

### Can I use a different embedding model?

Yes. You can switch between FastEmbed (local, free), OpenAI (API, paid), or a self-hosted OpenAI-compatible server. See [Embedding providers](#embedding-providers). After switching, run `bm reindex --embeddings` since embeddings from different models aren't compatible.

### Does Basic Memory Cloud support semantic search?

Yes. Semantic search is always on in Cloud, using the same hybrid search. No setup required — it works the same way as local.

### What inspired Basic Memory's search?

Basic Memory's hybrid search draws on ideas from the open source community — in particular [QMD](https://github.com/tobi/qmd), which combines BM25 keyword search with vector semantic search in a local-first design. We loved the approach and wanted it integrated into Basic Memory's read-write knowledge system, where the AI doesn't just search your notes but actively works in them.

---

## Next steps

<card-group>
<card icon="i-lucide-wrench" title="MCP Tools Reference" to="https://docs.basicmemory.com/reference/mcp-tools-reference">

`bm_search` parameters and search modes.

</card>

<card icon="i-lucide-settings" title="Configuration" to="https://docs.basicmemory.com/reference/configuration">

All semantic settings and environment variables.

</card>

<card icon="i-lucide-shield-check" title="Schema System" to="https://docs.basicmemory.com/concepts/schema-system">

Define and validate note structure with schemas.

</card>
</card-group>


## Sitemap

See the full [sitemap](https://docs.basicmemory.com/sitemap.md) for all pages.
