A workflow demonstrating how the Recommendation Agent can analyze preferences and generate personalized recommendations.

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 recommendation_system.py:

from praisonaiagents import Agent, Tools
from praisonaiagents.tools import duckduckgo

# Create Recommendation Agent
recommendation_agent = Agent(
    name="RecommendationEngine",
    role="Recommendation Specialist",
    goal="Generate personalized recommendations based on preferences",
    instructions="You are a Recommendation Agent",
    tools=[duckduckgo]
)

# Get recommendations
response = recommendation_agent.start(
    "Recommend me a good movie to watch in 2025"
)

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

Understanding Recommendation System

The Recommendation Agent uses multiple approaches to generate personalized suggestions:

  1. Content Search: Uses DuckDuckGo to find current options
  2. Preference Analysis: Understands user preferences
  3. Recommendation Generation: Creates personalized suggestions
  4. Content Filtering: Filters based on relevance and quality

Features

Personalization

Tailored recommendations based on preferences.

Real-time Data

Up-to-date content and information.

Multi-domain

Recommendations across various categories.

Content Filtering

Quality-based content selection.

Example Usage

# Example: Get personalized recommendations
from praisonaiagents import Agent, Tools
from praisonaiagents.tools import duckduckgo

agent = Agent(instructions="You are a Recommendation Agent", tools=[duckduckgo])
agent.start("Recommend me a good movie to watch in 2025")

Next Steps

Was this page helpful?