> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
> Use this file to discover all available pages before exploring further.

# What are the file limits in the chat and in agents?

> Learn why chats limit attachments to 20 files and agents to 50, and how to work with larger document collections using Knowledge bases.

Large Language Models have a context window, which is the maximum amount of text they can process at once. This includes the prompt you send to the model, the previous chat history, as well as attached files (this is explained in [this guide](/en/using-langdock/guides/prompt-engineering/basics/basics)). To work efficiently with files, reduce the number of documents to the lowest number of files possible.

## Chat: 20 files

In a single chat, you can attach up to 20 files. This limit helps ensure the attached content fits into the model's context window alongside your prompt and chat history.

## Agents: 50 files

You can attach up to 50 files to an agent's Knowledge section. When the Agent has up to 20 files, all are previewed directly in the model's context. With more than 20 files, documents are retrieved on demand through document search instead, while spreadsheets remain attached.

To work with larger document collections, use a [Knowledge base](/en/using-langdock/library/knowledge-bases) and attach it to an agent as an action. Knowledge bases support up to 1,000 files and are fully searchable.
