# Agents in the AM
URL: https://docs.datarobot.com/en/docs/get-started/how-to/agents-am.html

> A walkthrough for creating an agentic workflow, configuring metrics, and chatting with it.

# Agents in the AM

This how-to illustrates the ease of creating [agentic workflows](https://docs.datarobot.com/en/docs/agentic-ai/index.html) in DataRobot. After you complete it, try some additional how-tos, listed [at the end](https://docs.datarobot.com/en/docs/get-started/how-to/agents-am.html#try-this-next).

In this walkthrough, you will:

1. Open a codespace and create a local environment.
2. Create and test an agent.
3. Send your agent to the Registry.
4. Configure metrics and connect to the playground.
5. Chat with the agent and review tracing.

#### Prerequisites

Download, and then unzip, the following file to try out the agentic functionality:

[Download demo data](https://datarobot-doc-assets.s3.us-east-1.amazonaws.com/agents+in+the+am.zip)

### 1. Log in and navigate to Workbench

Log in to DataRobot; you will land on the home page.

Navigate to Workbench and create a new Use Case.

Name it “Agents in the AM”.

### 2. Create a codespace

From the Use Case getting started page, navigate to codespaces by clicking Notebooks & codespaces:

Then, click to create a new codespace.

And start a new session.

### 3. Load files to the codespace

After the session initializes, drag-and-drop the unzipped file folder named `bloggeragent`, within the `storage` folder, that was downloaded as part of the [prerequisites](https://docs.datarobot.com/en/docs/get-started/how-to/agents-am.html#prerequisites).

### 4. Start a terminal session

Click the Terminal tile to start a terminal session in the codespace.

Change to the directory that contains the `bloggeragent` template: `cd storage/bloggeragent`.

> [!NOTE] Note
> Depending on your file structure, your command may be `cd bloggeragent`. Check the file browser hierarchy to confirm.

### 5. Create a local environment

To create the local environment:

1. Run task start .
2. When prompted, choose agent_crewai ( 1 ) to select the CrewAI agent.
3. Enter Y to install dependencies locally.

### 6. Test the local agent

Test the agent in your codespace. This is the same response as you will see in the playground, but faster. Use it to confirm that the agent is performing as expected. For example, try this command:

```
task agent:cli -- execute --user_prompt 'Hi, how are you?'
```

You can see the evolution of tasks:

And then the final response:

### 7. Deploy the agent

Send the agent to the Registry's workshop in preparation for deployment and monitoring.

1. Run task deploy to send the agent to the Registry.
2. Press Enter to create a new Pulumi stack.
3. Enter a stack name, such asagent_in_the_am_<LASTNAME>, andEnter. (.venv) [notebooks@kernel ~/storage/newsanalystagent]$ task deploy
Running pulumi up with [DEPLOY] mode
Using CPython 3.11.14 interpreter at: /usr/bin/python3
Creating virtual environment at: .venv
Built pulumi-datarobot==0.10.24
Installed 84 packages in 151ms
Please choose a stack, or create a new one:  [Use arrows to move, type to filter]
> <create a new stack>
4. When prompted, selectyesto accept and perform Pulumi updates. This process can take 3-5 minutes and is an excellent time to read up on how to take agents fromPOC to production.

### 8. Go to Registry

When you receive confirmation that the update was successful:

1. Go to Registry'sWorkshoptab.
2. Click the agent name to open the configuration area.

### 9. Configure metrics

Next, scroll down the panel to the Evaluation and moderation section and click Configure.

When you click to configure, the metric gallery opens.

For this exercise, configure the prompt and response tokens:

1. Click on the Prompt Tokens tile.
2. Click Add .
3. Open and add theResponse Tokensmetric in the same way. The configuration summary panel shows the newly added metrics.
4. Save the configuration.

### 10. Connect the agent to the playground

From the workshop, expand the Actions menu and select Connect to agentic playground.

Use the dropdown to select:

1. The Use Case you created in Step 1.
2. The playground that was created by DataRobot with the stack name you entered in Step 7.

Click Connect.

### 11. Chat with your agent

Once connected, the agentic playground opens. Enter a prompt and click Send to test the agent. Initial output generation can take 3-5 minutes, so while it is "thinking," learn about [syftr](https://www.datarobot.com/blog/pareto-optimized-ai-workflows-syftr/), DataRobot's  open-source framework for searching agentic workflow configurations to determine the optimal structure, components, and parameters for your data and use case.

### 12. Review tracing

From within the response window, click Review tracing.

Explore both the list and chart output.

**List:**
[https://docs.datarobot.com/en/docs/images/agents-am-21.png](https://docs.datarobot.com/en/docs/images/agents-am-21.png)

**Chart:**
[https://docs.datarobot.com/en/docs/images/agents-am-22.png](https://docs.datarobot.com/en/docs/images/agents-am-22.png)


### That's it!

Congratulations—you now have a working agent. Feel free to leave the platform; the codespace will terminate by itself. Find your agent at any time in the Workbench Playgrounds tile.

---
