# Search in Files

<mark style="background-color:red;">The Search in Files tool requires an</mark> <mark style="background-color:red;"></mark><mark style="background-color:red;">**OpenAI API key**</mark><mark style="background-color:red;">.</mark>

The Search in Files tool allows the addition of files to enhance the chat's knowledge base. Models can search for relevant information within these files and utilize it as context for responses. **Only text-based files are supported, such as texts, code, CSVs, and PDFs where the text is selectable.**

To add knowledge files, click the <img src="/files/tzzj2XR9h6aLZpppHXOx" alt="" data-size="original"> button in the top right corner. You can drag the file into the Chat Knowledge window or click the <img src="/files/yh1le36zUMsaYWKIIkPg" alt="" data-size="line"> button to open Finder. Please wait for the files to complete parsing.

<figure><img src="/files/mq75rbb7vtD7MMQLRIid" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Large files may take more time to parse. While it is not mandatory, it is advisable to keep individual knowledge files under 50 MB.
{% endhint %}

{% hint style="info" %}
The models may not always choose to search in the knowledge files for content. It is a good practice to remind them to use the knowledge files to answer queries.
{% endhint %}

## Knowledge Window Limit

<figure><img src="/files/5nNJTB9VwxjNfYf9KCEe" alt=""><figcaption></figcaption></figure>

This setting defines how much content to fetch from the knowledge files.

<mark style="background-color:yellow;">**Important:**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">It is essential that the knowledge window limit is less than the context window limit of the model, otherwise, the model will not be able to use the knowledge due to its larger size.</mark>

## Time to Process

Processing approximately 3,000,000 symbols from the knowledge files takes about 1 minute when parsing. Please keep in mind that processing time will increase with larger files.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macdocs.supgpt.app/tools/search-in-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
