Connect a model to an agent
1
Publish a materialized model
Only models whose live version is Materialized and has a snapshot can be
connected. See Build analytic models.
2
Open the agent's Data access tab
Open the agent and go to Data access. The Analytic models section lists the
models the agent can query. The same section is in the Agent Builder’s configuration
pane.
3
Pick and connect
Choose one or more models in Pick models… and click Connect model. Live
models appear in the list but cannot be picked until they are published as
materialized.
How the agent reads it
When an agent has at least one connected model, DataGen installs thedatagen-data
CLI and its skill into the agent’s sandbox at the start of each turn. The agent uses it
to find models, read their documentation and run SQL:
- Queries run in DuckDB inside the sandbox, reading the snapshot directly from
storage through short-lived signed URLs. Include
duckdbin the agent’s Sandbox Environment so it does not have to install it at run time. sqlprints up to 500 rows;--out results.parquet(or.csv,.json) writes every row to a file for analysis in Python.- Each query reads the live version’s current snapshot. After a scheduled or manual
refresh, the next query sees the new data.
describeshows when the snapshot was built. - Rows come back marked as untrusted data, and the skill tells the agent never to follow instructions found in them.
list, search, describe, sql and values. Commands that reach
sources or validate model SQL are reserved for the Data Builder. See the full
datagen-data CLI reference.
You do not need to tell the agent about the CLI: the skill describes it. Ask questions
in business terms:
Data scope is about files, not models
The Data access tab also has a Data scope setting. It limits which raw workspace files the agent may read (see Use files). It does not affect analytic models: an agent reads exactly the models connected in Analytic models, whatever its data scope.Use a model in an app
On deployments with the assets layer enabled, an app can read analytic models while it runs. Open the app, go to Tools & knowledge, and under Knowledge bases and analytic models the running app reads choose a model and click Connect. The published app reads the model’s published snapshot throughDATAGEN_ASSETS_URL, as the person who
opened the app. See Build an app.
Other ways to reach data
Next
datagen-data CLI reference
Commands, flags, limits and error messages.
Files
Upload the documents and spreadsheets your agents work with.