# Module 6: Hands-on Lab: Building Your First Agent

This module is a practical, step-by-step guide to building your first AI agent in the raiaAI Launch Pad. We will apply the concepts you've learned in the previous modules to create a simple but functional customer support agent.

{% embed url="<https://youtu.be/2YnolPYSfX4>" %}

**Objective:** To build a basic support agent that can answer questions from a small knowledge base and escalate to a human when necessary.

**Materials:**

* Access to the raiaAI Launch Pad
* A sample knowledge base file (provided)
* The instruction template from the raia training materials

**Step 1: Create a New Agent**

1. Log in to the raiaAI Launch Pad.
2. Click on the "Create Agent" button.
3. Name your agent according to the raiaLabs naming convention: "Support Agent - Training - \[Your Name]".
4. Select GPT-4o as the model.
5. Click "Create".

**Step 2: Upload the Knowledge Base**

1. Navigate to the "Training" tab of your new agent.
2. Under "Knowledge Base", click "Upload Files".
3. Upload the provided sample knowledge base file (`training_faq.md`).
4. Wait for the file to be processed and indexed by the vector store.

**Step 3: Create the Instructions**

1. Navigate to the "Instructions" tab.
2. We will use Manus to help us write the instructions. Open a new Manus session and use the following prompt:

**Step 4: Review and Paste the Instructions**

1. Review the instructions generated by Manus. Check that all the requirements from the prompt have been met.
2. Copy the markdown-formatted instructions.
3. Paste them into the "Instructions" field in the raiaAI Launch Pad.

**Step 5: Test Your Agent**

1. Navigate to the "Test" tab.
2. Ask your agent questions based on the `training_faq.md` file. For example:

* "What is the return policy?"
* "How much does the SmartWidget cost?"
* "My SmartWidget won't turn on. What should I do?"

1. Verify that the agent is providing accurate answers and citing the knowledge base file.

**Step 6: Test the Escalation Procedure**

1. Now, test the escalation rules you defined in the instructions. For example:

* "I want to speak to a human."
* "I am extremely frustrated with your service."

1. Verify that the agent responds with the correct escalation message.

**Congratulations!** You have successfully built and tested your first AI agent. This hands-on experience is the foundation upon which you will build more complex and sophisticated agents for our clients. In the next module, we will explore some advanced techniques for prompt engineering.


---

# 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://docs.raiaai.com/ai-training/partner-training/raia-labs-training/part-1-prompt-engineering/module-6-hands-on-lab-building-your-first-agent.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.
