# Building Your First Agent in AgentOS

### About this export

| Field | Value |
| --- | --- |
| **content_type** | course |
| **platform** | contentstack-academy |
| **source_url** | https://www.contentstack.com/academy/courses/building-your-first-agent-in-agentos |
| **language** | en |
| **product_area** | ai |
| **learning_path** | standalone |
| **course_id** | building-your-first-agent-in-agentos |
| **slug** | building-your-first-agent-in-agentos |
| **version** | 2026-06-06 |
| **last_updated** | 2026-06-08 |
| **status** | published |
| **keywords** | ["ai"] |
| **summary_one_line** | Building Your First Agent with Agent OS In this course, you'll move beyond agent concepts and build a working agent from start to finish using Agent OS. You'll learn how projects, triggers, tools, and instructions work t… |
| **total_duration_minutes** | 37 |
| **lessons_count** | 8 |
| **video_lessons_count** | 4 |
| **text_lessons_count** | 4 |
| **linked_learning_path** | standalone |
| **linked_assessment_ref** | LMS_UNCONFIGURED_COURSE_ASSESSMENT |
| **markdown_file_url** | /academy/md/courses/building-your-first-agent-in-agentos.md |
| **generated_at** | 2026-06-08T14:32:05.865Z |
| **intended_audience** | [] |
| **prerequisites** | [] |
| **related_courses** | [] |

> **Academy MD v3** — companion `.md` for Ask AI. Quizzes and graded assessments are **LMS-only**; this file never contains answer keys.

## Course Overview

| Metadata | Value |
| --- | --- |
| Catalog duration | 37m 29s |
| Released (if known) | 2026-06-06 |
| Product area | ai |

### Description

Building Your First Agent with Agent OS

In this course, you'll move beyond agent concepts and build a working agent from start to finish using Agent OS. You'll learn how projects, triggers, tools, and instructions work together to create intelligent workflows that can understand information, generate outputs, and take action.

Using a real-world content enrichment scenario, you'll build an agent that automatically analyzes newly created content, generates teasers, SEO metadata, and tags, updates Contentstack entries, and publishes content for review. Along the way, you'll learn how to select the right triggers, use tools effectively, write better instructions, and evaluate the quality of agent outputs.

By the end of this course, you'll have built, tested, and deployed a complete agent while gaining practical experience with the core workflows used to create AI-powered solutions in Agent OS.

### Learning objectives

1. Follow each lesson in order.
2. Practice in a training stack using placeholders **YOUR_STACK_API_KEY** and **YOUR_DELIVERY_TOKEN** in local `.env` files only.
3. Validate API responses against the official documentation.

### Topics covered

ai

## Course structure

```text
building-your-first-agent-in-agentos/
├── 01-understanding-projects · text · 1 min
├── 02-creating-a-project-and-agent · video · 241s
├── 03-understand-triggers · text · 1 min
├── 04-understanding-tools · text · 1 min
├── 05-configuring-triggers-and-tools · video · 439s
├── 06-writing-better-instructions · text · 1 min
├── 07-building-the-content-enrichment-agent · video · 410s
├── 08-testing-and-refining-your-agent · video · 409s
```

## Lessons

### Lesson 01 — Understanding Projects

<!-- ai_metadata: {"lesson_id":"01","type":"text","duration_minutes":1,"topics":["Understanding","Projects"]} -->

#### Lesson text

Before we create our first agent, it's helpful to understand the role projects play inside Agent OS.

When people first begin experimenting with agents, they often focus on the individual agent itself. That's understandable. After all, agents are the things that perform the work.

But in real organizations, agents rarely exist alone.

You might have one agent monitoring industry news, another reviewing support tickets, a third creating content drafts, and a fourth helping internal teams answer questions. As the number of agents grows, organization becomes increasingly important.

That's where projects come in.

Projects provide a way to group related agents together so they can be managed as a cohesive solution rather than as a collection of disconnected tools.

Think of a project as a container.

Inside that container are the agents, workflows, and capabilities that support a particular business objective.

For example, a marketing team might create a project focused on content operations. Inside that project could be agents responsible for research, content generation, and campaign support.

A support organization might create a separate project containing agents focused on ticket analysis, issue categorization, and knowledge management.

Projects help establish structure as your agent ecosystem grows.

### **Organizing for Scale**

When building your first agent, it's tempting to create projects with very broad names like:

*   AI Project
    
*   Agent Testing
    
*   New Project
    

Those names work when you're experimenting, but they become less useful as more agents are added.

Instead, consider organizing projects around business outcomes.

Examples include:

*   Content Operations
    
*   Customer Support Intelligence
    
*   Product Research
    
*   Marketing Insights
    

These names communicate purpose rather than technology.

Remember, users care about what a solution accomplishes, not how it was built.

### **Our Project**

Throughout this course, we'll build a Content Enrichment Agent.

This agent will monitor newly created articles, analyze their content, generate supporting metadata, update the entry, and notify the content team when enrichment is complete.

The goal isn't to replace content creators. The goal is to automate the repetitive tasks that often occur after an article has been written, such as creating teasers, generating SEO metadata, and assigning tags.

To support that workflow, we'll begin by creating a project specifically designed to house our agent.

While the project will initially contain a single Content Enrichment Agent, the structure we establish could easily support additional agents in the future, such as content review agents, taxonomy agents, publishing agents, or other content operations workflows.

By starting with a project, we're building the same way organizations typically build in production environments: with organization, scalability, and long-term maintainability in mind.

In the next lesson, we'll explore triggers and discuss how agents know when it's time to begin working.

#### Key takeaways

- Connect **Understanding Projects** 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.

### Lesson 02 — Creating a Project and Agent

<!-- ai_metadata: {"lesson_id":"02","type":"video","duration_seconds":241,"video_url":"https://cdn.jwplayer.com/previews/dLSUZWjq","thumbnail_url":"https://cdn.jwplayer.com/v2/media/dLSUZWjq/poster.jpg?width=720","topics":["Creating","Project","and","Agent"]} -->

#### Video details

#### At a glance

- **Title:** Creating a Project and Agent
- **Duration:** 4m 1s
- **Media link:** https://cdn.jwplayer.com/previews/dLSUZWjq
- **Publish date (unix):** 1780760400

#### Streaming renditions

- application/vnd.apple.mpegurl
- audio/mp4 · AAC Audio · 113685 kbps
- video/mp4 · 180p · 180p · 162732 kbps
- video/mp4 · 270p · 270p · 191293 kbps
- video/mp4 · 360p · 360p · 222682 kbps
- video/mp4 · 406p · 406p · 243331 kbps
- video/mp4 · 540p · 540p · 302547 kbps
- video/mp4 · 720p · 720p · 390416 kbps
- video/mp4 · 1080p · 1080p · 583948 kbps

#### Timed text tracks (delivery)

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

#### Video transcript

In the Foundations course, we spent time discussing what agents are and how they differ from automations and the types of problems that they're best suited to solve. Now, it's time to build one. So for this course, we're going to focus on a common challenge faced by content teams – content enrichment. Writing great content often takes a lot of time. Editors and marketers spend their energy researching topics, writing articles, and refining messaging. But after the article is written, there's often a second phase of work that still needs to happen. Someone needs to write a teaser. Someone needs to create SEO metadata. Someone needs to think about tags and categorization. These tasks are important, but they're also repetitive and often follow recognizable patterns. This is exactly the type of problems agents can help solve. Our goal is simple. When a new article is created in Content Stack, we'll have an agent automatically analyze the content and generate the supporting metadata needed to improve discoverability and organization. Before we build that workflow, we need a project and an agent. So here I am inside the CMS. I'm going to go into the stack that I want to work with. Inside this stack, we can come up to the right-hand corner into the App Switcher, and we can choose AgentOS. Now once AgentOS loads, the first thing that we want to do is create a new project. If you don't have any projects here, your screen might look a little bit different, but I have one called Market Intelligence already set up. What I want to do is create a new project. So in the top right-hand corner here, I'll select New Project. This will open up a dialog box where I can provide a project name and a description. I'm going to go ahead and call this Content Operations or Content Ops for short. You can provide a description and tags if necessary. In a real-world project, I would encourage you to spend some time on the description. You want this to be as easily understood in terms of what the project represents as possible. So now I'll come down here and click Create Project. Once the project is created, the next step, of course, is to create a new agent. To create a new agent, and right now I'm looking at a blank dashboard, I have two options. I can create a new automation or a new agent. Our focus right now is on agents specifically. If you want to learn more about creating automations, we have other materials in Academy for that. So right now I'm going to go ahead and click New Agent, and this will open up another dialog box where we have to give the agent a title and a description. And again, you want to be descriptive here because if anyone else comes in, you want them to have a good sense as to what this agent does. Now what this agent will do is enrich content. So I'll go ahead and type in enrichment, and again, I would come in here and give this a longer description if this wasn't a demo video. So now I can come over here and click Create Agent, and that will bring me into the builder. So right now we have a project and an agent. We have a place to organize our work and a container that will eventually perform our enrichment tasks. What we don't have yet is a way for the agent to know when it should begin working, and that's what we're going to take a look at next.

#### Key takeaways

- Connect **Creating a Project and 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.

### Lesson 03 — Understanding Triggers

<!-- ai_metadata: {"lesson_id":"03","type":"text","duration_minutes":1,"topics":["Understanding","Triggers"]} -->

#### Lesson text

### **Learning Objectives**

By the end of this lesson, you will be able to:

*   Explain the purpose of triggers in Agent OS
    
*   Describe how triggers initiate agent execution
    
*   Understand common trigger patterns
    
*   Identify business events that make effective triggers
    
*   Explain why trigger selection is one of the most important design decisions when building an agent
    

### **What Is a Trigger?**

Every agent needs a way to know when it's time to begin working.

That's the role of a trigger.

A trigger is the event that starts an agent's workflow.

Without a trigger, an agent simply sits idle.

It may have instructions.

It may have tools.

It may be fully configured.

But until a trigger occurs, nothing happens.

Think of a trigger as the starting line for the entire execution process.

Once the trigger fires, the agent begins evaluating instructions, using tools, and producing outputs.

No trigger.

No execution.

### **How Agent Execution Begins**

Let's imagine a simple scenario.

Suppose we have a Content Enrichment Agent whose job is to:

*   Read newly created articles
    
*   Generate a teaser
    
*   Create SEO metadata
    
*   Suggest tags
    
*   Update the content entry
    
*   Notify the content team
    

The agent already knows how to perform those tasks.

The question is:

When should it perform them?

That's where the trigger comes in.

A trigger tells the agent:

"It's time to begin."

Once the trigger fires, the rest of the workflow can execute.

### **Trigger Thinking**

One of the easiest mistakes to make when designing agents is focusing immediately on the tools.

People often ask:

*   What integrations should I add?
    
*   What model should I use?
    
*   What capabilities does the agent need?
    

Those are important questions.

But before any of those things matter, the agent needs a way to start.

A useful design question is:

**What business event should cause this agent to run?**

For example:

*   A new content entry is created
    
*   A content entry is published
    
*   A support ticket is submitted
    
*   A file is uploaded
    
*   A user requests information
    
*   A scheduled time is reached
    

Each of these events could become a trigger.

The trigger should always align with the business objective you're trying to accomplish.

### **Why We're Using an Entry Created Trigger**

Throughout this course, we'll use a Contentstack Entry Created Event as our trigger.

This means the workflow begins whenever a new article is created.

Why is this a good trigger?

Because it aligns directly with the problem we're trying to solve.

Our agent's purpose is to enrich content.

Content enrichment should happen after the article has been written but before it moves further through the publishing process.

A newly created article represents the perfect moment for the agent to begin working.

The article exists.

The content is available.

The enrichment fields are often still empty.

The timing naturally supports the workflow we're trying to build.

This is an important design principle.

Good triggers are rarely chosen because they're technically interesting.

They're chosen because they occur at the right moment within a business process.

### **Trigger First, Everything Else Second**

As you begin building agents, remember this principle:

**Triggers define when work begins.**

**Tools define what work can be performed.**

**Instructions define what outcome should be achieved.**

All three are important.

But execution always starts with a trigger.

Without one, the rest of the agent never gets the opportunity to do its work.

That's why trigger selection is one of the first decisions you'll make when designing an agent.

It establishes the moment when your workflow moves from configuration into action.

### **Key Takeaways**

*   Triggers determine when an agent executes.
    
*   Every agent requires a trigger before it can perform work.
    
*   The trigger should align with the business event that initiates the workflow.
    
*   Contentstack Entry Created Events provide a natural trigger for content enrichment workflows.
    
*   Triggers define when work begins. Tools and instructions determine what happens next.
    

### **Next Lesson**

Next, we'll create our first project and begin building the Content Enrichment Agent that we'll use throughout the remainder of this course.

#### Key takeaways

- Connect **Understanding Triggers** 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.

### Lesson 04 — Understanding Tools

<!-- ai_metadata: {"lesson_id":"04","type":"text","duration_minutes":1,"topics":["Understanding","Tools"]} -->

#### Lesson text

### **Learning Objectives**

By the end of this lesson, you will be able to:

*   Explain the purpose of tools in Agent OS
    
*   Describe how tools expand an agent's capabilities
    
*   Distinguish between triggers, tools, and instructions
    
*   Understand how agents use tools to access and update information
    
*   Identify common categories of tools available in Agent OS
    

### **What Are Tools?**

If triggers tell an agent when to begin working, tools determine what the agent can do once it starts.

Tools provide access to systems, services, and actions outside of the agent itself.

Without tools, an agent can reason about information, but its ability to interact with the world is limited.

Think of tools as the agent's hands.

The agent can analyze information and make decisions, but tools allow it to retrieve data, update records, communicate with other systems, and complete tasks.

For example, an agent might:

*   Read a content entry
    
*   Update metadata
    
*   Send a Slack message
    
*   Retrieve information from another system
    

Each of these capabilities is provided through a tool.

### **Triggers, Tools, and Instructions**

As you build agents, it's important to understand the relationship between triggers, tools, and instructions.

A trigger determines when the agent starts.

Instructions define what outcome the agent should achieve.

Tools provide access to the systems and actions required to achieve that outcome.

For example:

**Trigger**A new article is created.

**Instructions**Generate a teaser, SEO metadata, and tags.

**Tools**Retrieve the article, update the entry, and notify the content team.

Each component plays a different role.

The trigger starts the work.

The instructions describe the goal.

The tools provide the capabilities needed to accomplish that goal.

### **Tools Do Not Replace Reasoning**

One of the most common misconceptions about agents is that tools are what make them intelligent.

They are not.

The intelligence comes from the model's ability to analyze information, interpret context, and make decisions.

Tools simply provide access to information and actions.

Consider the difference between these two scenarios:

#### **Traditional Automation**

When a new article is created:

*   Copy value from Field A
    
*   Move value to Field B
    
*   Send notification
    

The workflow follows a predefined set of rules.

No interpretation occurs.

#### **Agent Workflow**

When a new article is created:

*   Retrieve the article
    
*   Analyze the content
    
*   Generate a teaser
    
*   Create SEO metadata
    
*   Suggest tags
    

The agent must understand the content before it can determine the appropriate output.

The tools enable access to the article and allow the results to be saved, but the reasoning happens between those steps.

### **The Tools We'll Use**

Throughout this course, we'll use several Contentstack and Slack tools.

#### **Get a Single Entry**

This tool allows the agent to retrieve the content entry that triggered the workflow.

The agent can access information such as:

*   Title
    
*   Headline
    
*   Article Body
    
*   Existing metadata
    

Without this tool, the agent would know that an article was created but would not have access to the content itself.

#### **Update Entry**

This tool allows the agent to write information back to Contentstack.

We'll use it to populate fields such as:

*   Teaser
    
*   SEO Title
    
*   SEO Description
    
*   Tags
    

The agent generates the content and then uses the tool to save the results.

#### **Slack**

This tool allows the agent to communicate with users and teams.

Throughout the course, we'll use Slack to:

*   Verify agent output
    
*   Review generated content
    
*   Confirm workflow execution
    

In real-world implementations, Slack is often used to notify stakeholders when agent-driven tasks are complete.

### **Choosing the Right Tools**

A useful question to ask when building an agent is:

**What information does the agent need, and what actions must it perform?**

The answer helps determine which tools should be added.

For example:

If an agent needs to read content:

*   Add a tool that retrieves content.
    

If an agent needs to update content:

*   Add a tool that writes data back to the system.
    

If an agent needs to notify users:

*   Add a communication tool.
    

Good tool selection starts with the business objective rather than the technology itself.

Focus on what the agent needs to accomplish, then choose the tools that support that outcome.

### **Key Takeaways**

*   Tools provide access to systems, services, and actions outside the agent.
    
*   Triggers determine when work begins.
    
*   Instructions define the desired outcome.
    
*   Tools provide the capabilities required to achieve that outcome.
    
*   Tools enable access to information, but reasoning is performed by the agent.
    
*   The right tools are determined by the business problem you're trying to solve.
    

### **Next Lesson**

Next, we'll combine triggers and tools to build the first working version of our Content Enrichment Agent and verify that it can retrieve, understand, and summarize content automatically.

#### Key takeaways

- Connect **Understanding Tools** 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.

### Lesson 05 — Configuring Triggers and Tools

<!-- ai_metadata: {"lesson_id":"05","type":"video","duration_seconds":439,"video_url":"https://cdn.jwplayer.com/previews/B7pzchp8","thumbnail_url":"https://cdn.jwplayer.com/v2/media/B7pzchp8/poster.jpg?width=720","topics":["Configuring","Triggers","and","Tools"]} -->

#### Video details

#### At a glance

- **Title:** Working with Triggers and Tools
- **Duration:** 7m 19s
- **Media link:** https://cdn.jwplayer.com/previews/B7pzchp8
- **Publish date (unix):** 1780760409

#### Streaming renditions

- application/vnd.apple.mpegurl
- audio/mp4 · AAC Audio · 113548 kbps
- video/mp4 · 180p · 180p · 155670 kbps
- video/mp4 · 270p · 270p · 177397 kbps
- video/mp4 · 360p · 360p · 202471 kbps
- video/mp4 · 406p · 406p · 218945 kbps
- video/mp4 · 540p · 540p · 262816 kbps
- video/mp4 · 720p · 720p · 342255 kbps
- video/mp4 · 1080p · 1080p · 475644 kbps

#### Timed text tracks (delivery)

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

#### Video transcript

Okay, so we created a project and an agent. Now we're going to connect that agent to a real-world event. In our example, that event is the creation of a new article. Imagine an editor just completed writing an article. The core content is complete, but many of the enrichment fields remain empty. There's no teaser, there's no SEO description, and we don't have any tags. Before our agent can help, it needs to access that content. This lesson focuses on establishing that connection. We'll configure a trigger that responds when a new article is created. We'll then retrieve the article and verify that the agent can understand what was written. This is an important milestone. At this stage, we're not trying to modify content yet. We're simply proving that the agent can identify the content article, retrieve it, and reason about its content. So let's get into it. The first thing we have to do is we have to select a trigger. Again, a trigger is the thing that's going to make this agent do something. So on the right-hand side, we see there's all sorts of different triggers. We're going to go into CMS, and specifically what we want to do is find when an entry is created, and that's this first option right here. So I'll go ahead and select it. We need to tie our content stack account to this trigger, so I'll go ahead and click Add New Account. I'm going to have to authorize this, so I'll go ahead and click Proceed. It's going to tell me all the things that I'm authorizing for, and this looks good for our purposes. So again, I'll click Authorize. It may take a second. It has to log in, make sure that you are you, and then you'll have to select an organization. So I'll come over here and select that organization, and I have to give it a name. Content stack number one is default. For our purposes, that's fine, but again, you could be more specific here. Obviously, you want it to represent the name of the account that you're working with. I'll go ahead and click Save. Once I click Save, I can then come over and choose the stack that I want to work with. In this case, I'm going to choose this AgentOS Academy stack. I'm going to be working with the main branch. Now I have to select the content type. The type of content I'm working with is an article, so I'll go ahead and select that. You can also select an environment. In this case, maybe we want the agent to publish to the preview or the development server. It's completely up to you. I'll select Preview in this case, and once you're done, you can come over and click Save. That is the trigger. Now I want to show some way that this is actually working. I'm going to add a tool. I'll come over here and click Add. The tool that I want to use in this case is Slack. I use Slack here at Content Stack, so I'm going to go ahead and select it. After selecting it, I'm going to have to link it to my account, so I'm going to go ahead and have Slack use my credentials. Again, I'll go ahead and click Proceed. Again, it's just showing me everything that it's going to have access to. Again, I'm going to authorize that. It'll take a second. It'll have to come over, and you're going to have to verify that this is, in fact, okay. I'm going to allow this. I then have to set the account name. I'm going to call this Slack CS for Content Stack. Again, I'm a Content Stack employee. That's why I'm using Content Stack's Slack. So I'll go ahead and click Save, and then what we have to do is figure out how we want to send this message. In this case, I want to specify a particular channel, so instead of letting AI select the data, I'm going to add custom data. Then I can click this button here to open up a window, giving me the ability to select a particular channel. Now, there's all sorts of different channels here within the Content Stack instance of Slack, so I'm just going to load a few here until I think I find the channel that I want to work with. Then after loading enough, I can come up here and search the data. I'll go ahead and start typing in the name of the channel that I'm looking for, which is Slack Integration Testing. With that selected, that channel becomes visible. Now, in terms of the message and everything else, I'm going to let AI select this information as necessary. So I'll now come over and click Save. Once I click Save, I can then add some instructions for the agent, and it's just going to be in plain language. So I'm going to go ahead and type in, when a new article is created, and then I'm just going to give it a list of things to do. One, retrieve the article that triggered the workflow. Two, read the title, headline, and article body. Three, summarize the article. Four, send a message in Slack. And then you can come over and click Save. That's going to save the agent. And then in order for this agent to do anything, for it to listen for this event, we're going to have to publish it. So go ahead and click Publish. Again, you'll get a dialog box saying this action is going to publish the enrichment agent, which is what we want. So go ahead and click Publish. And now our agent is running, and it's listening for this entry created event. So now we can come back to the CMS. I'm going to go ahead and do that. And I'm going to come into AgentOS Academy. I'm going to then come into Entries. And from here, we're going to create a new entry. And this, of course, will be an article. I'll go ahead and click Proceed. And then I'm going to add the title. It will be Pacific Northwest Getaway. I just so happen to have text stored on my clipboard for the article body. I'm just going to paste that article. And once I'm done, I'm going to come over and click Save. And then that entry is saved. And now what I need to do is come over to Slack. And you'll notice I have a new notification telling me that the article Pacific Northwest Gateway was published. And I have a summary of what that article says. So the agent is doing its job. We're able to detect when an article is created. The agent is able to evaluate what the material inside the article represents. And it's able to do something with it, which in this case is just send a Slack notification. But we're well on our way to having this agent perform an enrichment protocol on entries that we create within Content Stack.

#### Key takeaways

- Connect **Configuring Triggers and Tools** 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.

### Lesson 06 — Writing Better Instructions

<!-- ai_metadata: {"lesson_id":"06","type":"text","duration_minutes":1,"topics":["Writing","Better","Instructions"]} -->

#### Lesson text

By the end of this lesson, you will be able to:

*   Explain the role instructions play in agent behavior
    
*   Understand how instruction quality impacts output quality
    
*   Write clearer, more effective instructions for common agent tasks
    
*   Identify opportunities to refine instructions and improve results
    
*   Apply instruction-writing best practices when building agents
    

### **Why Instructions Matter**

If triggers determine when work begins and tools determine what capabilities are available, instructions determine what outcome the agent is trying to achieve.

Instructions are how we communicate our expectations to the agent.

They provide direction.

They define objectives.

They establish constraints.

Without instructions, an agent has no clear understanding of what success looks like.

Consider the difference between these two requests:

**Generate tags for this article.**

and

**Generate 3-5 specific tags that accurately represent the primary themes of the article. Avoid generic tags unless they are central to the content.**

Both requests ask the agent to generate tags.

One provides significantly more guidance.

As a result, the quality of the output is often very different.

### **Instructions Are Not Procedures**

One of the most important ideas to understand is that instructions are not the same thing as traditional programming.

When writing instructions, you are usually defining outcomes rather than individual steps.

For example, a traditional workflow might specify:

*   Read the article
    
*   Identify key themes
    
*   Generate a teaser
    
*   Create SEO metadata
    
*   Save the results
    

An agent is often capable of determining many of those steps on its own.

Instead of focusing exclusively on procedure, focus on the desired result.

For example:

**Generate a teaser, SEO title, SEO description, and tags that accurately represent the content of the article.**

This gives the agent a goal while allowing it to determine how best to achieve that outcome using the available tools.

### **Good Instructions Provide Context**

Agents generally perform better when they understand the purpose behind a task.

Instead of simply saying:

**Generate a teaser.**

Consider providing additional context:

**Generate a teaser that summarizes the article while encouraging readers to continue reading.**

Now the agent understands not only what to generate, but why it is generating it.

This additional context often improves quality significantly.

### **Good Instructions Define Constraints**

Constraints help establish expectations.

For example:

#### **Weak Instruction**

Generate an SEO description.

#### **Better Instruction**

Generate an SEO description between 140 and 160 characters.

The second version provides a measurable target.

Similarly:

#### **Weak Instruction**

Generate tags.

#### **Better Instruction**

Generate 3-5 specific tags that improve content discovery. Avoid generic tags unless they are central to the article.

The additional guidance reduces ambiguity and improves consistency.

### **Refinement Is Part of the Process**

One of the most common misconceptions about agents is that the first output should always be perfect.

In reality, building agents is often an iterative process.

You review the output.

You identify opportunities for improvement.

You adjust the instructions.

Then you test again.

For example, imagine our Content Enrichment Agent generates these tags:

*   Technology
    
*   AI
    
*   Content
    

These tags aren't incorrect.

But they're not particularly useful.

We might refine our instructions by adding:

**Generate tags that are specific, reusable across multiple articles, and useful for content discovery. Avoid overly broad categories unless they are central to the article.**

The result is often a much stronger set of tags.

Notice what changed.

We didn't modify the trigger.

We didn't change the tools.

We simply improved the instructions.

### **A Simple Framework for Writing Instructions**

When creating instructions, consider the following framework:

#### **Outcome**

What should the agent accomplish?

Example:

Generate a teaser and SEO metadata.

#### **Context**

Why is the agent performing this task?

Example:

The metadata should improve discoverability and help readers understand the article.

#### **Constraints**

What rules should the agent follow?

Example:

Generate an SEO description between 140 and 160 characters.

When all three elements are present, the agent has a much clearer understanding of what success looks like.

### **The Instructions We'll Use**

For our Content Enrichment Agent, we'll ask the agent to:

*   Retrieve the article that triggered the workflow
    
*   Analyze the content
    
*   Generate a teaser
    
*   Generate an SEO title
    
*   Generate an SEO description
    
*   Generate tags
    
*   Update the content entry
    
*   Notify the team when enrichment is complete
    

As we continue building, we'll refine these instructions and observe how those refinements influence the final output.

### **Key Takeaways**

*   Instructions define the outcome an agent should achieve.
    
*   Better instructions generally produce better results.
    
*   Focus on outcomes rather than detailed procedures whenever possible.
    
*   Context helps agents understand why a task is being performed.
    
*   Constraints help improve consistency and quality.
    
*   Refinement is a normal part of agent development.
    

### **Next Lesson**

Next, we'll apply these principles as we transform our article summary workflow into a complete Content Enrichment Agent that generates metadata, updates content entries, and prepares content for review.

#### Key takeaways

- Connect **Writing Better Instructions** 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.

### Lesson 07 — Building the Content Enrichment Agent

<!-- ai_metadata: {"lesson_id":"07","type":"video","duration_seconds":410,"video_url":"https://cdn.jwplayer.com/previews/UNhFuPVm","thumbnail_url":"https://cdn.jwplayer.com/v2/media/UNhFuPVm/poster.jpg?width=720","topics":["Building","the","Content","Enrichment","Agent"]} -->

#### Video details

#### At a glance

- **Title:** Building the Enrichment Agent
- **Duration:** 6m 50s
- **Media link:** https://cdn.jwplayer.com/previews/UNhFuPVm
- **Publish date (unix):** 1780760396

#### Streaming renditions

- application/vnd.apple.mpegurl
- audio/mp4 · AAC Audio · 113583 kbps
- video/mp4 · 180p · 180p · 157704 kbps
- video/mp4 · 270p · 270p · 180860 kbps
- video/mp4 · 360p · 360p · 205662 kbps
- video/mp4 · 406p · 406p · 222614 kbps
- video/mp4 · 540p · 540p · 271838 kbps
- video/mp4 · 720p · 720p · 349696 kbps
- video/mp4 · 1080p · 1080p · 492358 kbps

#### Timed text tracks (delivery)

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

#### Video transcript

So far, we've proven that our agent can identify a new article, retrieve its content, and understand what it contains. That's useful, but summaries aren't our ultimate goal. The real business challenge we're trying to solve is content enrichment. Every article needs supporting metadata. Teasers help readers understand what an article is about. SEO titles and descriptions improve discoverability. Tags help organize content and improve search experiences. These tasks are valuable, but they're also repetitive. This is exactly the kind of work agents are well-suited to assist with. Rather than asking editors to manually create these assets for every article, we'll have our agent generate them automatically. The editor focuses on creating content. The agent focuses on enriching it. So let's come back to AgentOS and continue working with the agent that we set up. So here, inside the ContentOps project, you'll notice if I move over to Agents up here in the top, we can then come over to the right-hand side, and you'll see three dots here for Actions. Go ahead and click Edit Agent. This brings us back to the Builder. What we want to do here is add some more tools, because right now, all we're doing is sending a Slack message. So what we really want to do is we want to update the article with a generated teaser, an SEO title, an SEO description, and also generate tags and then update the entry. So first things first, we need to come over to Tools and add a tool. But we need to make sure that we're in the editing mode. Right now, we're not. So I have to come over here and click Edit Agent. Once you're in the editing mode, you can click the Add button next to Tools over here on the right. Again, we're going to come into the CMS. What we want to do is update an entry. So down here towards the bottom, you can see Update an Entry. With this selected, again, we have to choose our content stack account. I already connected it, so it's available here in the drop-down menu. This stack is going to be the stack that we're working with now. So I'll go ahead and select that, which is AgentOS Academy. Again, the branch, we could let AI select it, because I think we only have a main branch. But I'll go ahead and choose that manually. The content type, again, is going to be the article content type. So I'll come over and manually select that. And then in terms of the entry and everything else, I'm going to let AI select that data. So now I can come over and click Save. And once you save it, you're going to have to then update the instructions, because we want more than just a Slack message. We want the agent to actually go in there and update the entry. So let's go ahead and update this. Retrieving the article that triggered the workflow is right. We do want it to read this information. Now what we want to do is have it generate a teaser between, let's say, 30 and 50 words. So you have to go ahead and type that in. Then we need to update the teaser field of the article. So I'll go ahead and type that in. We also want it to generate an SEO title, an SEO description, and also generate tags. So I'll go ahead and add all those instructions in here as well. The last thing that we want to do is we still want to get confirmation in Slack. So I'll just go ahead and type in send Slack message. So I think we're good. We can then come over and save this. And then once it's saved, we can publish it. I'm going to go ahead and publish this. This will be v2. You can see that we have version 2 now. Then I'm going to come back to the app switcher. And in the app switcher, I'm going to come over to the CMS. I'm going to come into the AgentOS Academy stack. I'm going to come back to entries. And then I'm going to create a new entry. So I'm going to come over here and click new entry. And of course, it's going to be an article because that's what we're looking for. I'll go ahead and click proceed. This is going to bring me into the entry editor. I actually have a tab here of articles that I can just copy and paste. So I'm just going to come over here and copy this title and paste it into the entry. And then I'm going to do the same thing for the actual article body. I'm going to select all of this here. Scroll down a little bit. With all that's selected and copied to the clipboard, I can return back to the entry and paste the article body. And then I can come over and click save. I'm going to jump over to Slack and wait for that notification to pop up right here. It should be a little bit different now in terms of what the message is. And there it is. So it's giving us some information about it. We didn't ask for anything specific. So the agent actually decided what it was going to send for this message. So it looks like it was successful. But let's come back into the CMS and check it out. So I'm going to go ahead and just come away from this for a second and then return back to it just to make sure it's refreshed. And here we have a teaser now that we didn't have before. So that's been updated. If I scroll down into this entry, I can see that I have an SEO title. I also have an SEO description. And if I scroll down, it has also been tagged successfully. So the agent is doing its job. It analyzed the article. It identified themes. It generated new content. And it updated the entry automatically. And this is really a great example of how agents can augment human work. The editor still owns the message, the story, and the expertise. The agent helps complete the repetitive enrichment tasks that support publication and discoverability.

#### Key takeaways

- Connect **Building the Content Enrichment 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.

### Lesson 08 — Testing and Refining Your Agent

<!-- 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.

## Resources & references

| Page | Companion Markdown |
| --- | --- |
| /courses/building-your-first-agent-in-agentos/understanding-projects | /academy/md/courses/building-your-first-agent-in-agentos/understanding-projects.md |
| /courses/building-your-first-agent-in-agentos/creating-a-project-and-agent | /academy/md/courses/building-your-first-agent-in-agentos/creating-a-project-and-agent.md |
| /courses/building-your-first-agent-in-agentos/understand-triggers | /academy/md/courses/building-your-first-agent-in-agentos/understand-triggers.md |
| /courses/building-your-first-agent-in-agentos/understanding-tools | /academy/md/courses/building-your-first-agent-in-agentos/understanding-tools.md |
| /courses/building-your-first-agent-in-agentos/configuring-triggers-and-tools | /academy/md/courses/building-your-first-agent-in-agentos/configuring-triggers-and-tools.md |
| /courses/building-your-first-agent-in-agentos/writing-better-instructions | /academy/md/courses/building-your-first-agent-in-agentos/writing-better-instructions.md |
| /courses/building-your-first-agent-in-agentos/building-the-content-enrichment-agent | /academy/md/courses/building-your-first-agent-in-agentos/building-the-content-enrichment-agent.md |
| /courses/building-your-first-agent-in-agentos/testing-and-refining-your-agent | /academy/md/courses/building-your-first-agent-in-agentos/testing-and-refining-your-agent.md |

## Supplement for indexing

### Content summary

Building Your First Agent with Agent OS In this course, you'll move beyond agent concepts and build a working agent from start to finish using Agent OS. You'll learn how projects, triggers, tools, and instructions work t… Building Your First Agent with Agent OS In this course, you'll move beyond agent concepts and build a working agent from start to finish using Agent OS. You'll learn how projects, triggers, tools, and instructions work together to create intelligent workflows that can understand information, generate outputs, and take action. Using a real-world content enrichment scenario, you'll build an agent that automatically analyzes newly created content, generates teasers, SEO metadata, and tags, updates Contentstack entries, and publishes content for review. Along the way, you'll learn how to select th

### Retrieval tags

- ai
- building-your-first-agent-in-agentos
- Understanding
- Projects
- Creating
- Project
- and
- Agent
- Triggers
- Tools
- Configuring
- Writing
- Better
- Instructions

### Indexing notes

Chunk at each "### Lesson NN — Title" heading; copy lesson_id and topics from the preceding HTML comment into chunk metadata for RAG filters.
Course slug: building-your-first-agent-in-agentos. Union of lesson topic tokens: Understanding, Projects, Creating, Project, and, Agent, Triggers, Tools, Configuring, Writing, Better, Instructions, Building, the, Content, Enrichment, Testing, Refining, Your.
Do not embed or retrieve LMS-only quiz items or mastery exam answer keys from this export.

### Asset references

| Label | URL |
| --- | --- |
| Video thumbnail: Creating a Project and Agent | `https://cdn.jwplayer.com/v2/media/dLSUZWjq/poster.jpg?width=720` |
| Video thumbnail: Configuring Triggers and Tools | `https://cdn.jwplayer.com/v2/media/B7pzchp8/poster.jpg?width=720` |
| Video thumbnail: Building the Content Enrichment Agent | `https://cdn.jwplayer.com/v2/media/UNhFuPVm/poster.jpg?width=720` |
| 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/` |
