- When a message with attachments is recorded, Formation fetches each file through the connector that delivered it and stores it. This starts beside the agent’s turn, not after it.
- A refused fetch is retried in the background: after a minute, then at doubling intervals up to an hour, ten times in all. The reason for the last refusal is recorded in the connector’s own words, with no address, credential or response body.
read_document,view_imagesandimport_attachmentread the kept copy. When there is none (not fetched yet, every try refused, or the message is older than this feature), they fetch from the connector as before and keep what they get. A fetch that succeeds once never has to succeed again.
What does not change
Keeping a file changes where its bytes come from, never who may read them. A read passes the same conversation and audience checks as before and only then asks for the bytes. The object’s key is derived from the attachment’s ID, is recorded only in the database, and is never shown to a model or a person.Retention
A kept original lives exactly as long as the message it arrived with. When the message’s record is deleted, the object is deleted on the next pass of the capture loop. Deleting a file in the chat service does not delete Formation’s copy. The copy remains readable, by those the conversation’s checks admit, until its message is deleted. Kept originals are not sealed by Formation. Use a bucket with encryption at rest.Configuration
The blob store is process configuration, and optional. Without it nothing is kept and nothing else changes.
Set the first five together or not at all; a partial set fails startup. A
complete set that cannot be used (a malformed endpoint, an invalid bucket name)
is logged at startup and the install serves without keeping files.
Formation speaks the S3 object API with path-style addresses and Signature
Version 4. It makes three calls:
PutObject, GetObject and DeleteObject.
A wrong key pair or a missing bucket is not detected at startup; it shows as
attachments that stay unkept, with the store’s error code in the log.
A blob broker instead of a bucket
An install can also reach its store through a blob broker, and hold no storage credential at all. SetFORMATION_BLOB_BROKER_URL and
FORMATION_BLOB_BROKER_TOKEN in place of the variables above. Formation then
asks the broker for a short-lived signed address for each object and moves the
bytes directly to or from the store behind it. The contract is the
blob broker protocol.
An install has one blob store: setting a broker and a bucket together fails
startup.
For a hosting operator
There are two ways to give each install its own storage.- A bucket or scoped prefix per install. Provision one bucket per install,
or one prefix per install in a shared bucket with a key pair the store
itself restricts to that prefix, and set the
FORMATION_BLOB_S3_*variables when the install is deployed.FORMATION_BLOB_S3_PREFIXonly chooses where Formation writes. It is not a boundary: a key pair that can read the whole bucket can read every install’s objects. - A blob broker. Keep one store and one key pair that no install sees, run a broker that implements the blob broker protocol, and give each install the broker’s URL and its own token. This suits a store that cannot issue enough scoped key pairs for one per install.