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

# Attachment Store Protocol • AI Agent SDK

> AttachmentStoreProtocol: Seam for a gateway-managed attachment store (Issue #5207).

# AttachmentStoreProtocol

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Seam for a gateway-managed attachment store (Issue #5207).

Large files cannot ride inline inside a single `message` frame (bounded by
`max_payload`), so they are streamed as chunks into a store keyed by a
reserved `ref_id` (reserve → put chunk at offset → close), then referenced
from :class:`AttachmentRef`. The contract lives in core so every client and
implementation agree on one shape; the concrete durable store (filesystem /
object store) is a wrapper/bot concern, kept out of the dependency-free core.

## Methods

> **[reserve()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentStoreProtocol-reserve.md)**
>
> Reserve an entry for an incoming file and return its `ref_id`.

> **[put\_chunk()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentStoreProtocol-put_chunk.md)**
>
> Write `data` at `offset` for the reserved `ref_id`.

> **[close()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentStoreProtocol-close.md)**
>
> Finalize the upload and return the resulting :class:`AttachmentRef`.

> **[open()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentStoreProtocol-open.md)**
>
> Open the stored attachment for reading (outbound download).

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L666)**
>
> `praisonaiagents/gateway/protocols.py` at line 666


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.