# Building Your First AI Agents

{% embed url="<https://www.youtube.com/watch?v=kt-I1017Q8U>" %}

This guide walks you through creating two AI agents in MindStudio: a **blog post generator** and a **Chrome extension-based summarizer**. Along the way, you'll learn about workflows, variables, prompt design, and agent publishing.

## Creating a New Agent

To start building:

1. Navigate to the **Build** tab in MindStudio.
2. Click **Create New Agent**.
3. You'll land inside the **AI Editor** on the *automations canvas*, where the workflow begins with a **Start** and **End** block.

## Exploring Workflows and Variables

Workflows consist of functional blocks connected in sequence. Key block types include:

* **User Input:** Creates form fields and stores input as variables.
* **Generate Text:** Sends prompts to an AI model and returns text.
* **Display Content:** Displays output within the workflow (for testing or UI).

### Working with Variables

Variables are created in form blocks and referenced using `{{ double curly braces }}`.

**Best practice for prompt formatting:**

Separate variables from instructions using custom tags.

Example:

```markdown
Write a blog post about the following topic:
<topic>{{topic}}</topic>
```

This improves clarity and avoids formatting or grammatical issues when users input long or complex text.

## Enhancing AI Prompts with Markdown Formatting

Use markdown formatting to improve the structure of the AI's output.

1. Add instructions:\
   `Make sure to use markdown formatting in your response.`
2. Provide a template using example tags:

```markdown
<example>
## Title of blog post  
A compelling hook...  

### Key Takeaways  
- Point one  
- Point two  

### Conclusion  
</example>
```

This gives the AI a clear outline to follow and leads to more consistent, polished outputs.

## Publishing Your Agent

To publish your agent:

1. Click the **root folder** to open agent settings.
2. Provide a **name**, and optionally add a **description**, **icon**, or **landing page**.
3. Click **Publish**.

You can preview and re-publish at any time. Agents are private until explicitly shared.

## Overview of AI Model Selection

Under **Model Settings**, you can:

* Choose from over 90 AI models by Anthropic, OpenAI, Google, Meta, and more.
* Adjust the **temperature** to control randomness:
  * Higher values = more variation
  * Lower values = more deterministic
* Set a **response size limit**, which defines the max output length.

Start with defaults and refine based on behavior and output quality.

## Creating & Publishing a Summarizing Agent

To build a Chrome extension-based summarizer:

1. Create a new agent.
2. In the **Start** block, change the **Run Mode** to `Browser Extension`.
3. Use the launch variable `page_content`.
4. Add a **Generate Text** block with a prompt like:

```markdown
Write a TLDDR summary for the following content:
<content>{{page_content}}</content>
```

5. Name and publish your agent (e.g., *Summarize Anything*).

Once published, this agent can summarize:

* Website content
* YouTube transcripts
* PDFs and documents

It becomes available inside the MindStudio Chrome extension automatically.

## Conclusion and Next Steps

You’ve now built:

* A **blog post generator** using structured markdown prompting.
* A **content summarizer** for the browser using launch variables.

Along the way, you learned:

* How to use variables and form inputs
* How to structure prompts for better output
* How to configure and select AI models
* How to publish and test your agents

These techniques will serve as your foundation for building more complex AI agents. Continue experimenting, iterating, and publishing as you expand your skills in future lessons.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://university.mindstudio.ai/1-core-building-principles/building-your-first-ai-agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
