> 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/knowledge-and-retrieval/import-selected-google-drive-files.md).

# Import selected Google Drive files

Google Drive import adds selected files to a knowledge base through an authorized connection. Select individual files when the knowledge base needs only part of a folder.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2F6RlRF9pHsxRQLrgrluqM%2FG037A.mp4?alt=media&token=da592b44-fc72-4fa9-a921-8e34eaaafabf>" %}

## Before you start

Have a Google Drive account that can open the source files and an authorized Google Drive connection in StackAI. Use [Create and manage connections](https://docs.stackai.com/guides-and-quickstarts/using-tools-and-actions/create-and-manage-connections.md) if you need to connect it. The [Google Drive integration reference](https://docs.stackai.com/integrations/catalog/google-drive.md) covers provider-specific setup.

To begin a new connected import, open **Knowledge Bases → Import from a Connection**, select the Google Drive connection, and choose **Next: Select files**. Check the connection name and owner so you use the intended account. For a base already connected to Drive, open that base and use **Select Files** to update its selection.

## Select the source documents

In the file picker opened by **Next: Select files** or **Select Files**, locate the source folder.

![Connected source document picker](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/CyjlXsekvV56MQdeLRlm/assets/g037a-g037a-01-folder.png)

Expand nested folders when the documents you need are stored below the top level.

Select the individual documents and choose Load selected files.

![Connected source document picker](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/b0DIuirZNtgwzR0C2tWE/assets/g037a-g037a-02-selection.png)

Review the selection carefully so the import includes only the intended sources.

## Review the imported files

Browse the imported folder structure and check each file's status.

![Imported document processing status](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/5Q8CetSLEG6TG6HC2tK1/assets/g037a-g037a-03-indexed.png)

A completed file transfer can still require indexing before the contents are searchable.

Open a document and inspect Parsed and Chunks.

![Imported document processing status](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/j1I9ejUYGjZoVB6oYeKt/assets/g037a-g037a-04-parsed.png)

Confirm that extracted passages contain the information you expect from the source file.

## Change the source selection

Use Select Files to change which source files are included.

![Connected source file selection](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/0l2GJ4dQJbAD4RPzKZhF/assets/g037a-g037a-05-selection-review.png)

Review the selected documents and save the selection to update the import scope.

## Search the imported documents

Use Evaluate to ask about a document in a nested folder.

![Imported document retrieval results](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/Hfa8wHBJs22bnyYdyCmH/assets/g037a-g037a-06-hamlet.png)

Inspect both the returned passage and its filename to confirm the relevant source is available.

Use other questions to check documents at different folder levels.

![Imported document retrieval results](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/XlRBIgI1CWzs6PMV2Xn1/assets/g037a-g037a-07-prince.png)

Each result identifies the source document that supplied the passage.

## If the connection or files are missing

Clear the connection-list search first. If no suitable account is available, use **New Connection** or **Go to Connections** and [authorize the required account](https://docs.stackai.com/guides-and-quickstarts/using-tools-and-actions/create-and-manage-connections.md). If your organization does not offer the Google Drive provider or connector, ask its administrator to review the integration's availability and connector configuration.

If the picker reports a connection error, check its message, reconnect the account if authorization has expired, and retry. For a missing file, open it directly in Drive with the same account and confirm its location and permissions; choosing StackAI's import option does not grant new Drive access.

## Important behavior

Imported documents must finish indexing before retrieval can use them.

Selecting a connected source does not grant additional access in its provider. Use an account authorized to read the selected files.

## Continue

* [Source permissions](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/source-permissions.md)
* [Sync and ingestion lifecycle](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/sync-and-ingestion-lifecycle.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/knowledge-and-retrieval/import-selected-google-drive-files.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.
