Agent Data Overview
What is Agent Data?
Section titled “What is Agent Data?”Agent Data is a queryable store for JSON records produced by your agents. Each record is attached to a deployment_name
(the deployed agent) and an optional collection
(a logical bucket; defaults to default
). Use it to persist extractions, events, metrics, or any structured output, then search and aggregate across it.
Key concepts:
- deployment_name: the agent deployment identifier the data belongs to. Data access is authorized against that agent’s project.
- collection: a logical namespace inside an agent for organizing different data types or apps.
- data: your JSON payload, shaped by your app. SDKs provide typed wrappers.
Important behavior and constraints:
- Deployment required: The
deployment_name
must correspond to an existing deployment. Data is attached to that deployment and its project. - Local development: When running locally, use
deployment_name = _public
. Use distinctcollection
names to separate applications during local dev.
Backward compatibility: existing clients that send agent_slug
in request bodies will continue to work; the API will treat agent_slug
as an alias of deployment_name
.
- Access control: You can only read/write data for agents in projects you can access.
_public
data is visible across agents within the same project. - Filtering/Sorting: You can filter on any
data
fields, plus top‑levelcreated_at
andupdated_at
. Sorting supports comma‑separated specs; prefix data fields withdata.
(e.g.,data.name desc, created_at
). - Aggregation: Group by one or more data fields and optionally get per‑group counts and/or the first item.
Project scoping:
- You can scope requests to a specific project by providing the
Project-Id
header (UUID). This is especially useful if your API key has access to multiple projects.
SDKs and environments:
- The TypeScript SDK can be used in the browser. When your UI is deployed on LlamaCloud along with your agent, it is automatically authenticated. In other environments, provide an API key. You can also set
Project-Id
on the underlying HTTP client to pin all requests to a project. - The Python SDK is server‑side and uses your API key and optional base URL.
Next steps:
- TypeScript usage: see Agent Data (TypeScript)
- Python usage: see Agent Data (Python)