> For the complete documentation index, see [llms.txt](https://made-is-docs.gitbook.io/made.is-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://made-is-docs.gitbook.io/made.is-docs/creating-an-agent.md).

# Creating an Agent

A **MADE.is Agent** is a modular and flexible unit designed to execute Python scripts in a cloud environment managed by **MADE.is**. Agents are the building blocks of automation, allowing developers to focus on their application logic without worrying about deployment or server management.

***

**Key Components of a MADE.is Agent**

An agent in **MADE.is** is composed of the following core elements:

1. **Script**
   * The **Python script** is the heart of the agent.
   * It must include a `main` function, which serves as the entry point for execution.
   * The `main` function can either:
     * Take no parameters: `def main():`
     * Accept a `request` parameter: `def main(request):`
   * Example of a simple script:

     Copy

     ```
     def main():
         return "Hello, World!"
     ```
2. **Requirements**
   * These are the **Python packages** that your script depends on for successful execution.
   * Dependencies must be listed in the format used by `pip`, e.g., `requests==2.26.0`.
   * Example of a requirements file:

     Copy

     ```
     requests==2.26.0
     pandas==1.3.3
     ```
3. **Environment Variables**
   * These are optional **key-value pairs** that provide configuration values to your script at runtime.
   * Environment variables are ideal for sensitive data like API keys or dynamic values that may vary between executions.
   * Example of environment variables:

     Copy

     ```
     OPENAI_API_KEY=sk-...
     DATA_PATH=/home/user/data
     ```

***

**How to Create a MADE.is Agent**

Creating an agent in **MADE.is** is a simple process, and you can do it via the **MADE.is UI**. Follow these steps:

1. **Access the UI**
   * Log in to your **MADE.is** account and navigate to the **Agents** section.
   * Click on **Create Agent** to begin.
2. **Provide Agent Components**
   * **Script:** Upload or paste your Python script in the code editor provided. Ensure it includes a `main` function.
   * **Requirements:** List any dependencies required by your script. These will be installed automatically during the build process.
   * **Environment Variables:** Add any configuration variables your script needs. This step is optional.
3. **Save and Build the Agent**
   * After providing all necessary details, save the agent.
   * **MADE.is** will automatically start the build process, which includes:
     * Installing dependencies.
     * Packaging the script into a containerized environment.
   * Once the build is complete, the agent will be ready for execution.

***

**Why Use MADE.is Agents?**

* **Cloud-Native Execution:** Run your Python scripts in a secure, scalable environment without managing servers.
* **Modularity:** Each agent is independent, making it easy to manage and scale multiple workflows.
* **Ease of Use:** The UI and SDK provide intuitive interfaces for creating, managing, and executing agents.
* **Flexibility:** Supports a variety of use cases, from automation to complex data processing tasks.

***

With **MADE.is** Agents, developers can focus on building solutions while **MADE.is** handles the heavy lifting of deployment and infrastructure. Let me know if you'd like more details or examples!
