Configuration

Configuration for Agents and Tasks

Peeps AI uses YAML files for configuring agents and tasks, making it easy to define roles, behaviors, and workflows in a structured, human-readable format. This approach decouples logic from code, enabling quick adjustments without altering the underlying Python scripts. In this guide, you’ll learn how to configure agents and tasks to bring your Peeps AI project to life.


Understanding YAML in Peeps AI

YAML (Yet Another Markup Language) is a lightweight data serialization format that Peeps AI uses to configure agents and tasks. It allows for clean, hierarchical definitions of components, ensuring clarity and ease of use.

  • Agents Configuration (agents.yaml): Specifies the roles, goals, and metadata for your AI agents.

  • Tasks Configuration (tasks.yaml): Defines the tasks agents perform, including their descriptions, expected outputs, and associated agents.


Configuring Agents in agents.yaml

Agents are the core entities in Peeps AI, responsible for carrying out specific roles within a project. The agents.yaml file is where you define each agent’s purpose and attributes.

Example: Basic Agent Configuration

researcher:
  role: "AI Researcher"
  goal: "Conduct advanced market analysis"
  backstory: "A seasoned researcher with expertise in data analysis and trend forecasting"

Key Elements:

  • role: A concise description of the agent’s function.

  • goal: The primary objective the agent seeks to achieve.

  • backstory (optional): Additional context or metadata to enhance the agent’s persona.

Example: Adding Multiple Agents


Configuring Tasks in tasks.yaml

Tasks represent the actions or workflows that agents must execute. The tasks.yaml file defines each task’s description, expected outputs, and the agent assigned to it.

Example: Basic Task Configuration

Key Elements:

  • description: A detailed explanation of what the task involves.

  • expected_output: Specifies what the task should produce upon completion.

  • agent: The name of the agent responsible for the task (matches the key in agents.yaml).

Example: Defining Multiple Tasks


Advanced Configurations

Parameterized Tasks Tasks can include placeholders for dynamic inputs, allowing greater flexibility.

Example: Parameterized Task

When executing this task, you can provide the sector value dynamically (e.g., "technology" or "finance").

Task Dependencies Tasks can be defined in a way that one depends on the output of another. While the dependencies are managed programmatically in group.py, the task definitions can include hints.

Example: Task Dependency

Tags for Categorization Add tags to group or filter tasks based on specific criteria.

Example: Categorized Tasks


Best Practices for YAML Configuration

Keep It Simple Start with basic configurations and add complexity as needed. Test individual agents and tasks before expanding.

Use Descriptive Names Choose meaningful names for agents and tasks to improve readability and maintainability.

Validate Syntax YAML files are sensitive to indentation and formatting. Use a linter or online validator to ensure correctness.

Leverage Comments Use comments (#) to document configurations and provide context for future reference.

Example: Adding Comments


Testing Your Configurations

After defining agents and tasks in YAML, verify the configurations by running a test in your Peeps AI project:

❖ Load and print agents:

❖ Check tasks by listing their details:

These simple tests ensure your configurations are correctly loaded and ready for execution.


Next Steps

With your agents and tasks configured, you’re ready to define the workflow logic in your group.py file. Continue to the next section, “Customize Workflow Logic,” to learn how to orchestrate tasks and agents effectively.

Last updated