> ## 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**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

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

<CardGroup cols={2}>
  <Card title="reserve()" icon="function" href="../functions/AttachmentStoreProtocol-reserve">
    Reserve an entry for an incoming file and return its `ref_id`.
  </Card>

  <Card title="put_chunk()" icon="function" href="../functions/AttachmentStoreProtocol-put_chunk">
    Write `data` at `offset` for the reserved `ref_id`.
  </Card>

  <Card title="close()" icon="function" href="../functions/AttachmentStoreProtocol-close">
    Finalize the upload and return the resulting :class:`AttachmentRef`.
  </Card>

  <Card title="open()" icon="function" href="../functions/AttachmentStoreProtocol-open">
    Open the stored attachment for reading (outbound download).
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L666">
  `praisonaiagents/gateway/protocols.py` at line 666
</Card>
