A workflow demonstrating how to create and use a simple single-purpose agent.

Quick Start

1

Install Package

First, install the PraisonAI Agents package:

pip install praisonaiagents
2

Set API Key

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY=your_api_key_here
3

Create Script

Create a new file simple_agent.py:

from praisonaiagents import Agent

agent = Agent(instructions="You are a Markdown Agent, output in markdown format")
agent.start("Write a blog post about AI")

Understanding Single Agent

The Single Agent is the simplest form of PraisonAI agent:

  1. Simple Setup: Minimal configuration required
  2. Single Purpose: Focused on one specific task
  3. Direct Execution: Straightforward input-output flow
  4. No Dependencies: No external tools required

Features

Simple Setup

Minimal configuration needed.

Focused Task

Single-purpose execution.

Quick Start

Rapid implementation.

No Tools

No external dependencies.

Example Usage

# Example: Create a content generation agent
from praisonaiagents import Agent

# Create content agent
agent = Agent(
    instructions="You are a Content Generation Agent, create engaging content"
)

# Generate content
response = agent.start("""
    Write a short story about:
    - A future world
    - With advanced AI
    - And human collaboration
""")

# Save the story
with open('ai_story.txt', 'w') as f:
    f.write(response)

Next Steps

Was this page helpful?