> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/agent-builder-and-skills/search-connected-apps-with-federated-search.md).

# Search connected apps with Federated Search

Connected-app search lets an agent find information in an external service. Use it when users need answers from information that stays in that service.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FlYCvDuhLsQWgr71s4DIN%2FG013.mp4?alt=media&token=fa116f07-bf45-4bb0-9571-4e5b75de056a>" %}

## Before you start

You need an account with access to the provider and the information you want to search.

## Choose an app

Select **Add Knowledge Sources → Search Connected Apps**. Search for the provider that holds the information you need.

![Search Connected Apps provider choices](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/EX5jM49xBn6Jrqz6odQm/assets/g013-g013-01-app-options.png)

## Choose whose account to use

Select **Use my connection** to use the builder’s connected account. Select **End users connect their own accounts** when each person should use their own access.

![Builder and end-user connection options](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/IMfHze3PFAYCaxyIWSFo/assets/g013-g013-02-connection-modes.png)

Choose or create the connection required for that option. The source card shows the connected provider.

![Connected provider source card](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/NMuTOtbq9AclkTljlsye/assets/g013-g013-03-connected-app.png)

## Guide the search

In **Instructions**, explain when the agent should search the app and what information it should return. Enable citations when readers need links to the source.

![Search instructions and citation settings](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/JqSo1KyDUbE63EOygu1b/assets/g013-g013-04-instructions.png)

## Review the results

Send a request that needs information from the app.

![Answer using information from a connected app](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/c3MpEpucNieCAu6Snc4G/assets/g013-g013-05-cited-answer.png)

Open the source panel to inspect the document and passage used in the answer.

![Source document and passage supporting an answer](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/7FY44h0GzVW4mKLagx4j/assets/g013-g013-06-source-citation.png)

## Important behavior

The connected account’s permissions determine what the agent can find. If a document is missing, check the selected account and its access in the external service.

## Connection setup and next steps

If no usable connection is available, follow [Create and manage connections](https://docs.stackai.com/guides-and-quickstarts/using-tools-and-actions/create-and-manage-connections.md) and return to the source picker. For users who connect their own accounts, review [End user connections](https://docs.stackai.com/guides-and-quickstarts/using-tools-and-actions/end-user-connections.md) and test as an intended end user. If you need a searchable copy of documents in StackAI instead, use [Ground an agent using a knowledge base](https://docs.stackai.com/guides-and-quickstarts/agent-builder-and-skills/ground-an-agent-using-a-knowledge-base.md).


---

# 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.stackai.com/guides-and-quickstarts/agent-builder-and-skills/search-connected-apps-with-federated-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.
