Set Up
Setting Up Your First Project
Creating your first project with Peeps AI is a simple and rewarding process. This guide walks you through setting up a project, defining agents and tasks, and preparing your environment for execution. By the end, you’ll have a functional Peeps AI project ready to tackle real-world challenges.
Step 1: Create a New Project
Start by creating a new Peeps AI project using the peepsai
command-line interface.
❖ Navigate to the directory where you want to create your project:
❖ Run the Peeps AI project creation command:
Replace <project_name>
with a descriptive name for your project (e.g., ai_market_analysis
).
❖ This will generate a project structure with all the necessary files and folders, including configuration templates and example scripts.
Step 2: Understand the Project Structure
Your new project will follow Peeps AI’s standard structure, designed to keep your code and configurations organized. For a detailed explanation of the directory layout, refer to "Project Structure Overview".
Key elements include:
agents.yaml
: Define your AI agents’ roles, goals, and behaviors.tasks.yaml
: Specify tasks and workflows for your agents.group.py
: Establish the relationships between agents and tasks.main.py
: Serve as the entry point for executing your project.
Step 3: Configure Agents
Agents are the core of Peeps AI. Define them in the agents.yaml
configuration file. Each agent represents an AI entity with a specific role and goal.
Example: Configuring Agents
Agents can have:
Roles: Describe the agent’s function (e.g., researcher, analyst).
Goals: Define what the agent is tasked to achieve.
Backstories: Optional metadata to enrich the agent’s context.
Step 4: Define Tasks
Tasks outline what needs to be accomplished in your project. Each task is linked to an agent and specifies the expected outcome.
Example: Configuring Tasks
Tasks can include:
Descriptions: Explain the task’s purpose.
Expected Outputs: Specify what the task should deliver.
Assigned Agents: Define which agent is responsible.
Step 5: Customize Workflow Logic
Open the group.py
file to define the logic that connects agents and tasks. Use Peeps AI’s decorators to structure workflows as sequential, hierarchical, or custom processes.
Example: Defining a Group
Step 6: Run Your Project
Once your agents and tasks are configured, and the group logic is defined, it’s time to execute your project.
❖ Navigate to the project directory:
❖ Run the project using the CLI:
❖ Alternatively, execute the main.py
script directly:
During execution, you’ll see logs and outputs indicating the progress of your agents and tasks. Results will be saved in the output directory or to specified files.
Step 7: Test and Iterate
Peeps AI projects are iterative. You can refine configurations, add new agents, or adjust workflows as your requirements evolve. Use logs and outputs to analyze performance and identify areas for improvement.
Tips for Success
Start Small: Begin with simple agents and tasks, then scale complexity as needed.
Leverage YAML Configurations: Define as much as possible in YAML files for easy adjustments without modifying Python code.
Experiment with Processes: Try different workflow types (e.g., sequential, hierarchical) to optimize task execution.
Collaborate: Use version control systems like Git to share and collaborate on your project.
Last updated