> For the complete documentation index, see [llms.txt](https://dev.pointr.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.pointr.tech/features/indoor-maps/search/agentic-search.md).

# Agentic Search

Agentic Search helps visitors find places the way they talk. A query such as "vegan lunch", "somewhere to charge my phone" or "I need to buy a present for a child" still find relevant places, even when the content does not use those exact words. Results also take POI details into account, such as cuisines, dietary options and accessibility, and tell visitors which places are open now.

Visitors can also ask the AI assistant in a simple conversation. They describe what they need and get places they can view or navigate to. The assistant may ask questions to help narrow down the search results if the request is broad.

Agentic Search also supports queries in other languages depending on your platform:

* **Apple Intelligence**: Supports English, Danish, Dutch, French, German, Italian, Norwegian, Portuguese, Spanish, Swedish, Turkish, Vietnamese, Chinese (simplified and traditional), Japanese, and Korean.
* **Gemini Nano (Android)**: Supports multiple languages on eligible devices, though availability varies by device model, software version, and region.

Agentic Search is on by default. The assistant is off until you turn it on for your site.

<figure><img src="https://2107440607-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX0ubTdDuDEByHfWtKKVg%2Fuploads%2FqKtck5pax1uD3JLtAtew%2FGemini_Generated_Image_rduhybrduhybrduh.jpg?alt=media&amp;token=37b60833-9bc0-4fa6-a5af-4e98790f4605" alt=""><figcaption></figcaption></figure>

## How it works

Every search starts with the standard Search on the device. On supported Android and iOS devices, Agentic Search continues the search with an AI model on the device when the standard search does not find a clear match. When Agentic Search is not available, takes too long or fails, or the device is offline, visitors see the standard results with no error.

The Web SDK uses the standard search only, and offers the assistant through Pointr Cloud.

## What visitors see

* Results are numbered and linked to numbered pins on the map.
* Each result shows whether the place is open, closing soon or opening soon.
* Close alternatives, for example a similar cuisine, are marked as alternatives. Places that do not meet specific search criteria, but which may still be relevant, are marked as not confirmed.
* When a building named in the query has nothing that matches, results come from the whole site, with a notice.
* When nothing matches, visitors see a **No results found** message, and the Quick Access Categories are the next step.

{% hint style="info" %}
AI is non-deterministic and can make mistakes. If visitors have specific dietary requirements or allergies they are advised to check with venues and not rely on information in the search results.
{% endhint %}

## The AI assistant (BETA)

The AI assistant conversation opens from a button beside the search field when it is enabled. It asks a clarifying question if a request is broad with many possible results, and then lists matching places. It only helps with places at your site, and replies in the language of the request where the model supports it.

The assistant can only help with finding places at the site and will decline other requests about other topics.

Search results shown in the AI assistant conversation are numbered and can be opened in the same way as normal search results, and visitors can view details or navigate to the POI.

If the AI cannot run directly on the device, it connects to Pointr Cloud. The cloud service works in eight languages: English, Turkish, Spanish, German, French, Arabic, Japanese and Chinese.

* **What it does**: The assistant can understand questions in these languages and reply with standard messages, such as asking for clarification or telling you if a POI is open.
* **What it does not do**: It does not translate the map itself. It only helps the assistant understand what you want to find.

## Where it runs

<table><thead><tr><th width="160">Platform</th><th>Agentic Search</th><th>The assistant</th></tr></thead><tbody><tr><td>Android</td><td>On supported devices, on the device.</td><td>On the device. On devices without a supported model, it is supported by Pointr Cloud when the server API is turned on.</td></tr><tr><td>iOS</td><td>On supported devices with Apple Intelligence, on the device.</td><td>On the device. On devices without a supported model, it is supported by Pointr Cloud when the server API is turned on.</td></tr><tr><td>Web SDK</td><td>Not available.</td><td>On Pointr Cloud, when the server API is turned on.</td></tr></tbody></table>

## How to set it up

In the Pointr Cloud Dashboard, open the site's SDK Configuration and find these settings in the User Interface category:

<table><thead><tr><th width="230">Setting</th><th width="330">Key</th><th width="100">Default</th><th>What it does</th></tr></thead><tbody><tr><td>Enable Agentic Search</td><td><code>userInterface_isAgenticSearchEnabled</code></td><td>True</td><td>Turns Agentic Search on or off. When it is off, search uses only the offline search, and the assistant is off too</td></tr><tr><td>Enable Agentic Conversation</td><td><code>userInterface_isAgenticConversationEnabled</code></td><td>False</td><td>Turns the assistant on or off.</td></tr><tr><td>Enable Agentic Search server API</td><td><code>userInterface_isAgenticSearchServerApiEnabled</code></td><td>False</td><td>Lets the assistant run on Pointr Cloud for Web and for devices without an on-device model. It needs Agentic Conversationon.</td></tr></tbody></table>

The assistant is off by default. Turn on **Enable Agentic Conversation** for each site where you want it. To offer the assistant on Web and on devices without an on-device model, also turn on **Enable Agentic Search server API**, so the assistant can run on Pointr Cloud.

A host app can turn Agentic Search or the assistant off for its own users, but cannot turn on what Pointr Cloud has turned off.

See [Configuration Parameters Reference](https://dev.pointr.tech/features/indoor-maps/map-configuration/configuration-parameters-reference.md) for all configuration keys.

## For developers

The MapWidget shows Agentic Search with no code, and the assistant as soon as your site turns it on. Use the API below to turn them off for your app, or to build your own search UI.

{% tabs %}
{% tab title="Android" %}
**Settings**

* `UserInterfaceConfiguration.isAgenticSearchEnabled` and `isAgenticConversationEnabled`: the site's settings. `isAgenticConversationEnabled` is `false` until the site turns the assistant on. Turn them off with `MutableUserInterfaceConfiguration.setIsAgenticSearchEnabled(false)` and `setIsAgenticConversationEnabled(false)`.
* `PTRSearchLayoutState.Assistant`: the search sheet shows the assistant.

**Search**

* `PoiManager.searchPoisAgentic(site, query, trigger, building, onComplete)` searches with the on-device language model, and falls back to the offline search when the model cannot answer. `cancelAgenticSearch()` stops it.
* `PoiManager.prepareAgenticSearch(site)` builds the search index and warms up the model. Call it when search opens.
* `PoiContainer.isConfidentMatch` tells you whether the offline results answer the query by themselves.
* `PoiContainer.searchInfo` (`PoiSearchInfo`) tells you how the results were found: `source`, `status`, `fallbackReason`, `notes` and the `details` of each place, such as its open state.
* `PoiManager.searchPois(site, searchString, shouldReportForAnalytics)`: pass `false` while the visitor is still typing, so Search Analytics gets one record of the query.
* `PoiManager.getPoisForCategory(site, buildingInFocus, poiCategory)` returns the places of a Quick Access category in the order of the category list, grouped like search results, with travel times when the visitor is on the site.
* `PoiGroup.searchRelevance` tells you how well the best place of a group matched the query. `PoiGroup.poisByTravelTime` lists all places of a group by travel time, featured first.

**The assistant**

* `PoiManager.isAgenticConversationAvailable(site)` and `getAgenticConversationRoute(site)` tell you whether the assistant is available and where it runs (`ON_DEVICE`, `MODEL_NOT_READY`, `SERVER` or `NONE`).
* `PoiManager.startAgenticConversation(site, building, category)` returns an `AgenticConversation` with `send`, `choose` and `cancel`. Each `AgenticReply` has a `kind`, `text`, `options` and the places in `search`.
* A reply of kind `AgenticReplyKind.SAVED_LIST` answers a request for the visitor's saved places. It has no text and no places, so show your own text.

**Language models**

* `PoiManager.setLanguageModelService(LanguageModelService)` sets the models. `GeminiNanoEngine` is the default `LanguageModelEngine`, and you can add your own engines.
* `isLanguageModelAvailable()`, `isLanguageModelDownloadable()` and `downloadLanguageModel(onProgress, onComplete)` follow the on-device model.

```kotlin
val poiManager = Pointr.getPointr()?.poiManager ?: return

val offline = poiManager.searchPois(site, query)
if (!offline.isConfidentMatch) {
    poiManager.searchPoisAgentic(site, query, AgenticSearchTrigger.SUBMIT, null) { container ->
        // Called on a background thread
        val notes = container.searchInfo?.notes.orEmpty()
        val showDietaryNotice = notes.any { it.code == PoiSearchNoteCode.DIETARY_NOTICE }
        showResults(container, showDietaryNotice)
    }
}

if (poiManager.isAgenticConversationAvailable(site)) {
    // Keep the conversation while the visitor talks to the assistant
    conversation = poiManager.startAgenticConversation(site, null)
    conversation?.send("somewhere quiet to eat") { reply ->
        // Called on a background thread, also while the text streams in
        if (reply.isFinal) showReply(reply.kind, reply.text, reply.options, reply.search)
    }
}
```

{% endtab %}

{% tab title="iOS" %}
**Settings**

* `PTRUserInterfaceConfiguration.isAgenticSearchEnabled` and `isAgenticConversationEnabled`: the site's settings. `isAgenticConversationEnabled` is `false` until the site turns the assistant on. Turn them off with `PTRMutableUserInterfaceConfiguration`.
* `PTRSearchLayout.assistant`: the search sheet shows the assistant. `searchDidChangeLayout(fromLayout:toLayout:)` tells you when it opens and closes.
* `PTRSearchEventsListener` has `searchDidHighlightResultPoi(_:)`, called when a result is highlighted or no longer highlighted, and `searchDidListResultPois(_:)`, called with the places that the results or the assistant list, in the order of their numbered cards.

**Search**

* `searchPoisAgentic(in:query:trigger:building:completion:)` searches with the on-device language model, and falls back to the offline search when the model cannot answer. It calls back with a `PTRPoiContainer`. `cancelAgenticSearch()` stops it.
* `prepareAgenticSearch(for:)` builds the search index and warms up the model. Call it when search opens.
* `PTRPoiContainer.isConfidentMatch` tells you whether the offline results answer the query by themselves.
* `PTRPoiContainer.searchInfo` (`PTRPoiSearchInfo`) tells you how the results were found: `source`, `status`, `fallbackReason`, `notes`, `latencyMs` and the `details` of each place by POI identifier, such as its open state.
* `poiContainer(for:with:buildingOnFocus:)` returns the places of a Quick Access category in the order of the category list, grouped like search results, with travel times when the visitor is on the site.
* `PTRPoiGroup.searchRelevance` tells you how well the best place of a group matched the query. `-[PTRPoiGroup poisSortedByTravelTime]` returns all places of a group sorted by travel time, featured first.

**The assistant**

* `isAgenticConversationAvailable(in:)` and `agenticConversationRoute(for:)` tell you whether the assistant is available and where it runs (`OnDevice`, `ModelNotReady`, `Server` or `None`).
* `startAgenticConversation(in:building:category:)` returns a `PTRAgenticConversation` with `send(_:onReply:)`, `chooseOption(_:onReply:)` and `cancel`. Each `PTRAgenticReply` has a `kind`, `text`, `options` and the places in `search`.
* A reply of kind `.savedList` answers a request for the visitor's saved places. It has no text and no places, so show your own text.

```swift
guard let poiManager = Pointr.shared.poiManager else { return }

let offline = poiManager.searchPois(in: site, with: query)
if !offline.isConfidentMatch {
    poiManager.searchPoisAgentic(in: site, query: query, trigger: .submit, building: nil) { container in
        // Called on a background thread
        let notes = container.searchInfo?.notes ?? []
        let showDietaryNotice = notes.contains { $0.code == .dietaryNotice }
        DispatchQueue.main.async { self.showResults(container, showDietaryNotice) }
    }
}

if poiManager.isAgenticConversationAvailable(in: site) {
    // Keep the conversation while the visitor talks to the assistant
    conversation = poiManager.startAgenticConversation(in: site, building: nil, category: nil)
    conversation?.send("somewhere quiet to eat") { reply in
        // Called on a background thread, also while the text streams in
        guard reply.isFinal else { return }
        DispatchQueue.main.async { self.showReply(reply) }
    }
}
```

{% endtab %}

{% tab title="Web" %}
The `isAgenticConversationEnabled` option (Boolean, default `true`) turns the assistant off for your web app. The assistant shows only when this option is `true` and the site turns on Agentic Search, Agentic Conversation and the Agentic Search server API. Agentic Conversation and the server API are off by default.

```js
const options = new PointrWebSDK.Options({
  container: "pointr-map",
  pointrCloudToken: "POINTR_CLOUD_TOKEN",
  isAgenticConversationEnabled: false, // No assistant in this web app
});
```

The Web SDK has no public API for Agentic Search or the assistant: they come with the MapWidget search. The `search()` method of the MapWidget keeps its own matching rules. See [Create a Custom Search](https://dev.pointr.tech/features/indoor-maps/search/create-a-custom-search.md).

See [Web SDK Options Reference](broken://pages/jfILLyJZnfDRZXmODSXo) for all options.
{% endtab %}
{% endtabs %}


---

# 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://dev.pointr.tech/features/indoor-maps/search/agentic-search.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.
