> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quivr.thevibecompany.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Measure search

> Compare search relevance, latency and cost before changing the settings your users rely on.

Measure a search change against your current setup on the same queries and documents. Check whether the results get better and what happens to latency, failures and cost.

## Build a baseline

1. Pick queries that reflect your workload. Include exact names, meaning-based questions and searches that commonly miss.
2. Collect relevance judgments, which say which results answer each query. Keep the query IDs, dataset version and split fixed across runs.
3. Record the Quivr revision, plugin builds and settings, search profile, test machine and dataset version. Keep a separate held-out set for the final check.
4. Measure relevance at the result depth users see. The evaluation tools report metrics such as `nDCG@10`, which gives more weight to relevant results near the top. Also record p95 latency, the rate of errors or fallbacks, and any reported provider spend.

The repository's `make eval` runner searches public datasets. See the [evaluation guide](https://github.com/The-Vibe-Company/quivr/blob/main/docs/agents/evaluation.md) for its setup and report fields. On a running deployment, `GET /v0/admin/stats/searches` reports operational counts and latency by search mode and profile. Use a key with `observability:read` and grants for all Corpora in its Organization. If `admin_listen` is set, send the request there with a key from `admin_keys`.

## Log and compare

Use the checkout's `scripts/eval/results` CLI to store results in an MLflow tracking server. Your tracking operator provides `MLFLOW_TRACKING_URI`, `MLFLOW_TRACKING_USERNAME` and `MLFLOW_TRACKING_PASSWORD`. Keep credentials and the contents of private queries and documents out of the results. The [results guide](https://github.com/The-Vibe-Company/quivr/blob/main/docs/eval-results.md) covers required fields, Python dependencies, and separate storage and credentials for private per-query scores.

Use your measurement files and tracking credentials. Install `jq` for this example and `scipy` for paired comparisons. Log the baseline and save its result key:

```sh theme={null}
BASELINE_RECEIPT=$(scripts/eval/results log baseline.json) &&
  BASELINE_RESULT_KEY=$(printf '%s\n' "$BASELINE_RECEIPT" | jq -er '.result_key') &&
  printf '%s\n' "$BASELINE_RECEIPT"
```

Log the candidate against that key, then compare the two runs:

```sh theme={null}
CANDIDATE_RECEIPT=$(scripts/eval/results log candidate.json --baseline "$BASELINE_RESULT_KEY") &&
  CANDIDATE_RESULT_KEY=$(printf '%s\n' "$CANDIDATE_RECEIPT" | jq -er '.result_key') &&
  printf '%s\n' "$CANDIDATE_RECEIPT" &&
  scripts/eval/results compare "$CANDIDATE_RESULT_KEY" "$BASELINE_RESULT_KEY"
```

Pair the same query IDs on the same dataset fingerprint, split and evaluation tier. Inspect large per-query regressions alongside aggregate gains. Compare the settings you would actually deploy, including fallback behavior. If a log receipt reports `pending`, keep its local outbox and run `scripts/eval/results sync` once the server and credentials are available.

## Run local load tests

Use `make load` from a checkout with the [local stack prerequisites](https://docs.quivr.thevibecompany.co/get-started/launch-quivr.md). Install PyYAML from `contracts/http/v0/checks/requirements.txt` first, including for offline scenario validation. The load test starts an isolated stack with synthetic documents and deterministic fake models. The output measures engine behavior under load.

Validate the smoke scenario without starting a stack:

```sh theme={null}
make load args='--scenario tests/load/smoke.yaml --validate'
```

For example, to run that workload with Docker available:

```sh theme={null}
make load args='--scenario tests/load/smoke.yaml --out .scratch/load/smoke'
```

Read `report.md` and `report.json` for search latency, processing and drain progress, and missing work. Compare runs on the same hardware with the same scenario and fake delays. Use a relevance run with the production search path to measure real ranking and provider latency.

## Run a search campaign

For longer trials, the repository's experimental campaign tooling records candidate settings and their quality, latency and cost. Follow the [campaign guide](https://github.com/The-Vibe-Company/quivr/blob/main/docs/search-campaigns.md) for the control database, tracking access and paid compute setup. Use development data to explore and use the full engine against held-out data to confirm a candidate before promoting it.

## Next

* [Choose a search profile](https://docs.quivr.thevibecompany.co/operate/search-profiles.md).
* [Investigate capacity limits](https://docs.quivr.thevibecompany.co/operate/scale.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.