artifacts_enabled is set on an agent, files it produces during a run — a chart, a
CSV, a generated report — are kept per session. The same store also holds what a user
uploads to that session. One bucket, one API, one tab.
Layout
Every artifact — generated or uploaded — lives under the same key scheme:input and output are the only two segments that matter to a reader: an upload and a
generated file can share the same filename in the same session without colliding, because
the segment tells them apart. Versions are integers, oldest first; the API always resolves
the highest one unless told otherwise.
A third kind, legacy, covers files written before this layout existed
(uploads/{agent}/{filename}, no session). Nothing writes there any more, but existing
files are not migrated — they stay reachable through the same endpoints, tagged
accordingly.
An upload sent without a session (an agent-wide attachment, not tied to a
conversation) is stored under the literal session
_shared rather than left
unscoped.Tags
Every entry the API returns carries akind:
Endpoints
/api/artifacts/library only answers when the deployment stores artifacts on S3
(STORAGE_MODE=s3, see Configuration). On the local-disk backend it
returns {"items": [], "supported": false} — use the per-session endpoint instead.Previews
The file extension decides how an artifact is rendered: syntax highlighting for code, a rendered preview for.html, and a PDF viewer for .pdf. Anything else falls back to
plain text, or is reported as binary if it does not decode as UTF-8.
