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

# Attachment Support

<Badge icon="arrow-left" color="gray">[Back to Playground](/agent-platform/agents/agentic-apps/simulation-and-testing)</Badge>

Agentic Apps support real-time document sharing during interactions. Users can upload files directly into the chat, allowing agents to analyze and use document content dynamically when generating responses.

The platform handles uploaded files in two ways:

* **Content Extraction** — For specific file types, extracts and uses content as context.
* **Metadata Storage** — For all supported file types, stores file information for reference.

***

## Content Extraction and Contextual Use

For selected file types, the platform extracts content and passes it as context to the agent. This allows the agent to respond based on the file's content without the user having to summarize or retype it.

**How it works:**

1. User uploads a document using the attachment option.
2. The platform automatically extracts content from supported files.
3. The agent uses the extracted content to generate contextually relevant responses.

**Example:** When using an HR Assistant, a user can upload their resume instead of manually entering personal and professional details. The assistant extracts the relevant information and uses it in the conversation.

***

## File Metadata

For all supported file types, the platform captures file metadata as **artifacts** stored in `sessionMeta` system memory.

### Stored Metadata Fields

| Field         | Description                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
| `fileId`      | Unique identifier for the uploaded file                                                                       |
| `type`        | Type of data                                                                                                  |
| `filename`    | Original filename as uploaded by the user                                                                     |
| `mimetype`    | MIME type of the uploaded file                                                                                |
| `isActive`    | Whether the file is active for the current conversation. See [File State Management](#file-state-management). |
| `downloadUrl` | Temporary download URL, valid for **30 days** from upload                                                     |

**Example artifact structure:**

```json theme={null}
"artifacts": [
  {
    "fileId": "f-1558ea9e-xxxxxxxxxxxx-a283-c0bef1dec83a",
    "type": "file",
    "filename": "app-export.json",
    "mimetype": "application/json",
    "isActive": false,
    "downloadUrl": "https://localhost/api/v1/getMediaStream/orgFiles/public?h=..."
  }
]
```

### Accessing Metadata in Code Tools

The download URL and other metadata can be accessed in code tools for further processing.

```js theme={null}
// Access the sessionMeta memory store
retrieved = memory.get_content("sessionMeta")

// Access the download URL of the first uploaded file
download_url = retrieved["content"]["artifacts"][0]["downloadUrl"]

// Download the file and do further processing
```

**Example:** A user uploads a `.csv` sales report. A code tool retrieves the download URL, downloads the file, and runs a custom analysis script.

### Accessing Metadata in Prompts

To reference uploaded file information in agent or orchestrator prompts:

```
{{memory.sessionMeta.artifacts}}
```

***

## Supported File Formats

| Format                                           | Content Extraction | URL Generation |
| ------------------------------------------------ | ------------------ | -------------- |
| PDF (`.pdf`)                                     | ✅                  | ✅              |
| Microsoft Word (`.docx`)                         | ✅                  | ✅              |
| Text (`.txt`)                                    | ✅                  | ✅              |
| JSON (`.json`)                                   | ✅                  | ✅              |
| Spreadsheets (`.csv`, `.xls`, `.xlsx`)           | ❌                  | ✅              |
| Presentations (`.ppt`, `.pptx`)                  | ❌                  | ✅              |
| Web files (`.htm`, `.html`)                      | ❌                  | ✅              |
| Images (`.gif`, `.png`, `.jpg`, `.jpeg`, `.bmp`) | ❌                  | ✅              |
| Rich Text (`.rtf`)                               | ❌                  | ✅              |

***

## Using the Attachment Feature

In the Playground, use the **Attach** option in the chat widget to upload files while testing. For file size and count limits, see [Attachment Configuration](/agent-platform/ai-agents/agentic-apps/settings/app-configurations#attachment-configuration).

***

## File State Management

Each uploaded file is assigned a state that controls whether its content is used in the current conversation.

* **Active** — Default state when a file is uploaded. The file's content is available for use in the current conversation.
* **Inactive** — Uncheck the file in the attachment list to make it inactive. The content is excluded from the current conversation but the file is not deleted and can be reactivated at any time.

**Example:** If a user uploads multiple documents but only wants the agent to reference one, they can uncheck the others to exclude them from that interaction.

***

## Important Notes

* Files can be attached at any point during a conversation.
* There are limits on file count and size. See [App Configurations](/agent-platform/agents/agentic-apps/settings/app-configurations#attachment-configuration) for details.
* Download URLs are temporary and expire **30 days** after upload.
* Content extraction is supported only for specific file types. See the [supported formats table](#supported-file-formats) above.
