# Using Artifacts with Agents (https://www.agentenvframework.com/docs/artifacts/with-agents)

> Give your agent files and skills using artifacts

1. `load_artifact` puts `q3-workpapers` in `assistant`, and the universe `acme` in `analyst`, as files.
2. `prompt_agent` asks each agent about the files it was given.
3. Each agent reads its files, and writes a file of its own to `/app/artifact`.
4. `collect_artifacts` stores each agent’s file in the registry, as a new artifact.

Parts of the scene:

- **A file artifact universe**: `q3-workpapers`: `q3-numbers.csv` and `notes.md`, from Creating your artifacts. A `load_artifact` step with `agent_name` copies them into `assistant`, at `/tmp/file_artifacts`.
- **An environment universe**: `acme`, the universe from Creating your artifacts. Loaded into an agent, it arrives as files, one folder per environment name: `email/emails.json` and `contacts/contacts.json`.
- **assistant**: An A2A agent that a `deploy_agent` step started. It holds only what its own steps load, `q3-workpapers`, and writes its answer to `/app/artifact`, where `collect_artifacts` looks by default.
- **analyst**: A second agent in the same task, with an `agent_name` of its own. It gets `acme` rather than the Q3 files, so it can read the inbox and the contacts book without an env.
- **The assistant’s prompt**: A `prompt_agent` step that names `assistant`. It asks about the Q3 files, and to save the answer as `/app/artifact/q3-summary.md`.
- **The analyst’s prompt**: A second `prompt_agent` step, for `analyst`. It asks about the inbox in `email/emails.json`, and the agent saves its list as `/app/artifact/follow-ups.md`.
- **A collected artifact**: `q3-summary.md`, stored by `collect_artifacts` as a new file artifact universe named for the run. It is versioned like any artifact you put, so a judge or a later run can load it.
- **Another collected artifact**: The analyst’s `follow-ups.md`, from a second `collect_artifacts` step. Its `universe_id_suffix`, `-analyst`, keeps it from taking the same id as the first.

Loading artifacts into an agent is how you give it the files and skills a task needs. Dana's
email asks for the Q3 numbers, which are Acme's files rather than the state of any env, so this page
loads them into `assistant`, the agent working in the `email` instance, with a skill for sending
them. The steps form one task, which [Tasks and steps](https://www.agentenvframework.com/docs/tasks.md) covers.

## Load files into the agent

The Q3 numbers are `q3-workpapers`, the file artifacts from
[Creating your artifacts](https://www.agentenvframework.com/docs/artifacts/creating.md#file-artifacts). A `load_artifact` step with
`agent_name` copies an artifact into that agent's container. These steps seed the `email` instance,
deploy `assistant` next to it and give it the files:

```json title="task.json (steps 1 to 4)"
[
  {"id": "deploy", "type": "deploy_env", "env_id": "email", "env_version": 1},
  {"id": "seed", "type": "load_artifact", "env_id": "email",
   "artifact_id": "acme-email", "artifact_version": 2,
   "depends_on": [{"task_step_id": "deploy"}]},
  {"id": "agent", "type": "deploy_agent", "a2a_agent_id": "my-agent",
   "agent_name": "assistant", "env_ids": ["email"],
   "depends_on": [{"task_step_id": "seed"}]},
  {"id": "workpapers", "type": "load_artifact", "agent_name": "assistant",
   "artifact_id": "q3-workpapers", "artifact_version": 1,
   "depends_on": [{"task_step_id": "agent"}]}
]
```

The files land in `/tmp/file_artifacts`, as `q3-numbers.csv` and `notes.md`, and
`destination_path` puts them somewhere else. The same step takes a single file artifact too, or an
environment universe, which an agent gets as one folder per environment name: the demo's second
agent, `analyst`, gets `acme` as `email/emails.json` and `contacts/contacts.json`.

## Skills

Skills are modeled as artifacts: a stored skill is versioned like any other artifact, and a task
pins the version it gives an agent. [Skills](https://www.agentenvframework.com/docs/agents/skills.md) covers writing one,
[storing it](https://www.agentenvframework.com/docs/agents/skills.md#store-a-skill) and
[adding it in a task](https://www.agentenvframework.com/docs/agents/skills.md#skills-in-a-task). This task's `add_skills` step gives
`assistant` the skill `q3-report`, and a second skill that says where the `q3-workpapers` files are:

```json title="task.json (step 5)"
{"id": "skills", "type": "add_skills", "agent_name": "assistant",
 "skills": [{"skill_artifact_id": "q3-report", "skill_artifact_version": 1}],
 "file_artifact_universe_ids": ["q3-workpapers"],
 "depends_on": [{"task_step_id": "workpapers"}]}
```