> For the complete documentation index, see [llms.txt](https://docs.multiset.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.multiset.ai/fundamentals/localization/query-mode.md).

# Query Mode

Choose between the fast default engine (VPS-1) and the slower, more accurate deep-search engine (VPS-2) for single-frame, multi-frame and equirect queries.

### What is Query Mode?

Query mode selects which localization engine handles a query. It lets you trade latency for accuracy on a per-request basis, without changing anything about your map or the rest of your request.

| Mode                | Single frame | Multi frame    | Accuracy                                          | Use for                                           |
| ------------------- | ------------ | -------------- | ------------------------------------------------- | ------------------------------------------------- |
| `vps-1` *(default)* | \~1 second   | 2 to 4 seconds | Standard                                          | Real-time, interactive localization               |
| `vps-2`             | \~2 seconds  | \~5 seconds    | Up to **15% higher recall** and improved accuracy | Offline or background workflows, difficult scenes |

Query mode is set with the `queryMode` parameter. If you omit it, the request uses `vps-1`.

{% hint style="info" %}
Query mode applies to the **Single Frame Query** (`/vps/map/query` and `/vps/map/query-form`), including [equirect panoramas](/fundamentals/localization/equirect-query.md), and to the [Multi Frame Query](/fundamentals/rest-api-docs/map-query.md#vps-multi-image-query-api) (`/vps/map/multi-image-query`). For how single-frame and multi-frame queries differ, see [Localization](/fundamentals/localization.md#query-types).
{% endhint %}

### VPS-1 (Default)

`vps-1` is the standard engine and the default when `queryMode` is not provided. It returns a pose in roughly 1 second for a single frame query and 2 to 4 seconds for a multi frame query, which makes it the right choice for anything interactive.

**Use VPS-1 when:**

* You are localizing in real time (live AR, in-app navigation, continuous re-localization).
* Response time matters more than squeezing out the last few percent of accuracy.
* The scene is well textured and not visually repetitive.

### VPS-2 (Deep Search)

`vps-2` is a deep-search engine that searches more of the map before estimating a pose. It delivers up to **15% higher recall** and improved accuracy, at the cost of higher latency: around 2 seconds for a single frame query and around 5 seconds for a multi frame query.

**Use VPS-2 when:**

* You are running an **offline or background** workflow where a few extra seconds do not matter.
* The environment is challenging or visually repetitive (long corridors, basements, warehouses, transit stations) and `vps-1` sometimes fails to find a pose.
* You want to verify or improve a result: retry a failed or low-confidence `vps-1` query with `vps-2`.
* Accuracy is strictly more important than speed for the task.

{% hint style="info" %}
A common pattern is to query with `vps-1` first for a fast result and fall back to `vps-2` only when the response has `poseFound: false` or low confidence.
{% endhint %}

### API Usage

Pass `queryMode` alongside your usual query parameters. It is optional and defaults to `vps-1`. Allowed values are `vps-1` and `vps-2`.

#### JSON body (`/vps/map/query`)

```json
{
    "mapCode": "MAP_RJFKKWQ1787J",
    "queryMode": "vps-2",
    "queryImage": "data:image/png;base64,...",
    "cameraIntrinsics": { "fx": 664.38, "fy": 664.38, "px": 478.97, "py": 364.99 }
}
```

#### Form-data (`/vps/map/query-form`)

On the form-data endpoint, `queryMode` is a plain string form field:

```
queryMode: vps-2
```

The same field works on the multi-image endpoint (`/vps/map/multi-image-query`) and with `imageType=equirect`.

See [Map Query](/fundamentals/rest-api-docs/map-query.md) for the full request and response reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.multiset.ai/fundamentals/localization/query-mode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
