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

# Attachments

> Upload files in chat conversations for multimodal AI processing.

You can attach files directly in chat conversations. Your agent processes these attachments — extracting text from documents, analyzing images, and incorporating the content into its response.

## Uploading Files in Chat

1. Click the **attachment icon** in the chat input area (or drag and drop a file).
2. Select one or more files from your computer.
3. The files upload and appear as previews in the message input.
4. Type your message (optional) and send.

Your agent receives both your text message and the attached files, processing them together.

## Supported File Types

<Tabs>
  <Tab title="Images">
    **JPG, PNG, GIF, WebP, SVG**

    Images are sent directly to the AI model for visual analysis. The model can describe what it sees, extract text from images, analyze charts and diagrams, and answer questions about visual content.

    <Tip>
      For best results with image analysis, ask specific questions about the image rather than just attaching it. "What does this chart show?" works better than attaching a chart with no context.
    </Tip>
  </Tab>

  <Tab title="Documents">
    **PDF, DOCX, TXT**

    Documents are processed server-side to extract text content. The extracted text is included in the AI context so the model can answer questions about the document.

    For PDFs with complex layouts, OCR and text extraction services handle tables, multi-column text, and embedded images.
  </Tab>

  <Tab title="Audio">
    **MP3, WAV, M4A**

    Audio files are transcribed to text using speech-to-text services. The transcription is then included in the AI context for the model to reference.
  </Tab>

  <Tab title="Video">
    **MP4, AVI, MOV**

    Video files undergo both audio transcription and visual frame extraction. The model receives the transcribed text and key frame descriptions.
  </Tab>

  <Tab title="Data & Code">
    **JSON, CSV, XML, and code files**

    Structured data and code files are included as text in the AI context. The model can analyze data patterns, review code, and answer questions about the content.
  </Tab>
</Tabs>

## How Attachments Are Processed

When you send a file in chat, the processing flow is:

1. **Upload** — The file is securely uploaded and stored via cloud storage (S3 or local).
2. **Content extraction** — Text is extracted from documents; images are prepared for vision processing; audio/video is transcribed.
3. **Context injection** — The extracted content is included in the AI model's context alongside your message and conversation history.
4. **Response generation** — The model generates a response that can reference both your message and the attachment content.

<Note>
  Attachment content is processed for the current message context. Unlike knowledge base documents, chat attachments are not permanently indexed or made searchable across conversations.
</Note>

## File Security

Attachments are handled with multiple security layers:

* **Token-based access** — Each uploaded file receives a unique access token for retrieval
* **Organization scoping** — Files are partitioned by organization
* **Type validation** — Files are validated against allowed types before processing
* **Size limits** — Configurable maximum file size per upload

Files are served via secure URLs with expiring access tokens, preventing unauthorized access.

## Attachments and Knowledge Bases

Chat attachments and knowledge base documents serve different purposes:

| Feature         | Chat Attachments           | Knowledge Base Documents                 |
| --------------- | -------------------------- | ---------------------------------------- |
| **Scope**       | Single conversation        | All conversations with linked agents     |
| **Persistence** | Stored but not indexed     | Fully indexed with vector embeddings     |
| **Search**      | Not searchable             | Searchable via semantic and graph search |
| **Citations**   | Not cited                  | Cited with `[1]`, `[2]` notation         |
| **Use case**    | "Analyze this file for me" | "Always know about this content"         |

If you find yourself attaching the same file repeatedly, consider uploading it to a knowledge base instead. That way, the agent can reference it in any conversation without re-uploading.

## Viewing Conversation Attachments

To see all files shared in a conversation:

* Attachments appear inline with the messages they were sent with
* Each attachment shows a preview (for images) or file metadata (name, type, size)
* Click an attachment to download or view it
