# Attachments

## Introduction

Sending attachments is particularly useful if you want your agent backend to send some images or any other files to your users.

AgentLabs SDK allows you to effortlessly send attachments along with your messages.

Some attachments like Images will be displayed with a lightbox preview, others like zip files will be displayed as simple downloadable files.

<figure><img src="/files/dDK8eMx9t5rgA68WtKMN" alt=""><figcaption><p>Example of 3 attachments sent in a message</p></figcaption></figure>

<figure><img src="/files/e1hcJLv8nMuvZcRHcXe2" alt=""><figcaption><p>Example of zip files</p></figcaption></figure>

## How to send an attachment

Sending attachments is super easy. You only have to instantiate an Attachment and then pass it to the `send` method as an argument.

{% tabs %}
{% tab title="Python" %}

```python
from agentlabs.attachment import Attachment

attachment = Attachment.from_local_file("path-to-your-file")
    
agent.send(
    conversation_id=message.conversation_id,
    text="Here is your zip file",
    attachments=[attachment],
)
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
import {Attachment} from "@agentlabs/node-sdk";

const attachment = Attachment.fromLocalFile('path-to-your-file')

await agent.send({
    text: 'Here is an image for you...',
    conversationId: '<your-conversation-id>',
    attachments: [attachment],
});
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
You can pass as many attachments as you want. We also support all mime types as long as each file does not exceed 10MB.
{% endhint %}

## Going further

If you want to go further with attachments, you can check[ this example](https://github.com/agentlabs-inc/agent-examples/tree/main/nodejs-examples/ts-midjourney-clone-basic) where we show you how to create a basic midjourney clone.

Here's the result:

{% embed url="<https://youtu.be/hf2yARAHsog>" %}
A basic midjourney clone
{% endembed %}


---

# 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://docs.agentlabs.dev/core-concepts/attachments.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.
