# Testing and Refining Your Agent

### About this export

| Field | Value |
| --- | --- |
| **content_type** | lesson |
| **platform** | contentstack-academy |
| **source_url** | https://www.contentstack.com/academy/courses/building-your-first-agent-in-agentos/testing-and-refining-your-agent |
| **course_slug** | building-your-first-agent-in-agentos |
| **lesson_slug** | testing-and-refining-your-agent |
| **markdown_file_url** | /academy/md/courses/building-your-first-agent-in-agentos/testing-and-refining-your-agent.md |
| **generated_at** | 2026-06-08T14:32:06.258Z |

> Part of **[Building Your First Agent in AgentOS](https://www.contentstack.com/academy/courses/building-your-first-agent-in-agentos)** on Contentstack Academy. **Academy MD v3** — structured for retrieval; no quiz or assessment keys.

<!-- ai_metadata: {"lesson_id":"08","type":"video","duration_seconds":409,"video_url":"https://cdn.jwplayer.com/previews/RtvQpzsW","thumbnail_url":"https://cdn.jwplayer.com/v2/media/RtvQpzsW/poster.jpg?width=720","topics":["Testing","and","Refining","Your","Agent"]} -->

#### Video details

#### At a glance

- **Title:** Testing and Refining Agents
- **Duration:** 6m 49s
- **Media link:** https://cdn.jwplayer.com/previews/RtvQpzsW
- **Publish date (unix):** 1780760405

#### Streaming renditions

- application/vnd.apple.mpegurl
- audio/mp4 · AAC Audio · 113706 kbps
- video/mp4 · 180p · 180p · 161243 kbps
- video/mp4 · 270p · 270p · 186505 kbps
- video/mp4 · 360p · 360p · 212616 kbps
- video/mp4 · 406p · 406p · 231710 kbps
- video/mp4 · 540p · 540p · 283331 kbps
- video/mp4 · 720p · 720p · 361018 kbps
- video/mp4 · 1080p · 1080p · 510628 kbps

#### Timed text tracks (delivery)

- **thumbnails:** `https://cdn.jwplayer.com/strips/RtvQpzsW-120.vtt`

#### Video transcript

At this point, we've assembled all the major components of our solution. We have a trigger, we have tools, we have instructions, and we have a workflow that can enrich content automatically. Now it's time to evaluate the results. One of the most important lessons in agent development is understanding that your first output is rarely your final output. Building an agent is an iterative process. You review the results, you identify opportunities for improvement, you refine the instructions. Then you test again. This cycle is where many of the biggest quality improvements occur. For example, maybe in this case the SEO tags aren't as descriptive as we'd like. Maybe there's too many of them. Maybe there's not enough of them. Again, maybe the description for the SEO isn't exactly doing the job we want it to do. And if we scroll up towards the top, maybe we're not thrilled with the teaser. Now, if we do look at the work that the agent has performed here, I will admit it's pretty good, but that's not saying there isn't room for improvement. So again, let's just quickly take a look at how we could go about modifying this agent to get even better results. So again, in the App Switcher, I'm going to come over and choose Agent OS. I'm going to go into the Content Ops project. I'm going to find the agent that I built, which is Enrichment. And what I'd like to do is edit this agent. This will bring me to the next screen. I will have to click the Edit Agent button up here towards the top to be able to do that. You'll notice what we've provided in terms of instructions is fairly generic. Generate SEO title, we could be more descriptive there. Generate SEO description, again, we could give more context as we create these instructions, ultimately providing better results in the end. So I don't need to come in here and type this out for you. I'm pretty sure you have better things to do than watch me type on a keyboard. But imagine if you wanted three to five tags. You could type generate three to five tags, reusable across articles, useful for content discovery. That's a much better representation of an instruction that you may want to provide an agent. And again, remember, the tools we used were just the simple tools that I wanted to use for this demonstration. But you should spend time exploring these tools to see what's available to you. For example, we updated an entry. Maybe you want to publish that entry. Now, I wouldn't recommend publishing it on a live production server, but you may want to publish it to a staging server and then send that Slack notification to say, hey, this article was updated. These fields were changed and we published it onto the staging server. Take a look, review it so that human can actually publish it to the real world. Again, all you have to do is come over here and select publish entry and come in here and configure this particular tool. In this case, I would select my content stack account. If I want, I could come over and select the stack. It probably makes sense in this case. So I'd come over and choose Agent OS Academy. If you have a branch, you could select that as well. Again, I only have one. And of course, the content type is important here. We're working with articles. So I would want to specify that. We've been successful by just telling the agent to use the article that triggered the workflow. So, again, I can come over and click save. And if we want, we can type in another instruction here to publish the entry. Now, remember, I'm working on the staging environment. I'm not working on the production environment. I set that up earlier when I built this agent. But if I just type in publish, that command will now execute. So again, let's just save this. If we want, we can make a modification here. We didn't really get too specific in terms of the Slack message that we were going to send. So here I could type in include details about what was updated, what needs to be reviewed, and where the article is located. And maybe I want to publish this before we send that Slack message. So I'll just change the order here. Probably doesn't matter. But I'll go ahead and save this. And after saving it, I can come over and publish it. Again, this is now version 3. We can return back to the entry editor. So I'm going to come over to the CMS, go into the stack, and click entries. And I'm going to create a new entry. And of course, it's going to be an article. I'll go ahead and click proceed. Now again, I do have this other tab open where I can just copy some content. So again, you don't have to watch me type all this information out. But I'm just going to paste this in. And after pasting it, I will save it, which should trigger the agent for the agent to do its thing. So I have it copied. I'll come back over and paste it into the article body. I'll save it. And remember, what's happening is the agent is coming in and it's going to make changes to the teaser, to the tags. It's going to publish the article this time. And it's going to send a notification through Slack. And there it is. It published the document and it's giving us more details here in Slack with this notification. And again, we can come back to the CMS just to verify that those things did happen. Again, you may need to exit out of this and then return back to the article so you can essentially refresh it. So I'll just go ahead and do that. And when I open the article, sure enough, it has a teaser. If I scroll down, you'll notice it also has the SEO information as well as the tags. So there you go. That's how you create agents. More importantly, remember what you set up is not set in stone. You can always go back and make modifications after the fact.

#### Key takeaways

- Connect **Testing and Refining Your Agent** back to your stack configuration before moving to the next module.
- Capture one concrete artifact (screenshot, Postman call, or code snippet) that proves the step works in your environment.
- Re-read the delivery versus management boundary for anything you changed in the entry model.

## Supplement for indexing

### Content summary

Testing and Refining Your Agent. Testing and Refining Your Agent in Building Your First Agent in AgentOS (building-your-first-agent-in-agentos).

### Retrieval tags

- Testing
- and
- Refining
- Your
- Agent
- building-your-first-agent-in-agentos
- lesson 08
- Testing and Refining Your Agent
- building-your-first-agent-in-agentos lesson

### Indexing notes

Index this lesson as a primary chunk tagged with lesson_id "08" and topics: [Testing, and, Refining, Your, Agent].
Parent course slug: building-your-first-agent-in-agentos. Use asset_references URLs as thumbnail hints in search results when present.
Never surface LMS quiz content or assessment answers from this file.

### Asset references

| Label | URL |
| --- | --- |
| Video thumbnail: Testing and Refining Your Agent | `https://cdn.jwplayer.com/v2/media/RtvQpzsW/poster.jpg?width=720` |

### External links

| Label | URL |
| --- | --- |
| Contentstack Academy home | `https://www.contentstack.com/academy/` |
| Training instance setup | `https://www.contentstack.com/academy/training-instance` |
| Academy playground (GitHub) | `https://github.com/contentstack/contentstack-academy-playground` |
| Contentstack documentation | `https://www.contentstack.com/docs/` |
