Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Recommendation agent with web search for personalized suggestions.
Simple
Agents: 1 — Single agent analyzes preferences and generates recommendations.
Workflow
- Receive user preferences
- Search for current options
- Generate personalized recommendations
Setup
pip install praisonaiagents praisonai duckduckgo-search
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="Recommender",
instructions="Provide personalized suggestions based on preferences.",
tools=[duckduckgo]
)
result = agent.start("Recommend 5 sci-fi movies from 2024")
print(result)
Run — CLI
praisonai "Recommend good books about AI" --web-search
Run — agents.yaml
framework: praisonai
topic: Recommendations
roles:
recommender:
role: Recommendation Specialist
goal: Generate personalized recommendations
backstory: You are an expert at finding great content
tools:
- duckduckgo
tasks:
recommend:
description: Recommend 5 sci-fi movies from 2024
expected_output: A list of recommendations
Serve API
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="Recommender",
instructions="You are a recommendation agent.",
tools=[duckduckgo]
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Recommend podcasts about technology"}'
Advanced Workflow (All Features)
Agents: 1 — Single agent with memory, persistence, structured output, and session resumability.
Workflow
- Initialize session for preference tracking
- Configure SQLite persistence for recommendation history
- Search and recommend with structured output
- Store preferences in memory for personalization
- Resume session for refined recommendations
Setup
pip install praisonaiagents praisonai duckduckgo-search pydantic
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent, Task, AgentTeam, Session
from praisonaiagents import duckduckgo
from pydantic import BaseModel
class Recommendation(BaseModel):
category: str
items: list[str]
descriptions: list[str]
ratings: list[str]
session = Session(session_id="rec-001", user_id="user-1")
agent = Agent(
name="Recommender",
instructions="Generate structured recommendations.",
tools=[duckduckgo],
memory=True
)
task = Task(
description="Recommend 5 sci-fi movies from 2024 with ratings",
expected_output="Structured recommendations",
agent=agent,
output_pydantic=Recommendation
)
agents = AgentTeam(
agents=[agent],
tasks=[task],
memory=True
)
result = agents.start()
print(result)
Run — CLI
praisonai "Recommend sci-fi movies" --web-search --memory --verbose
Run — agents.yaml
framework: praisonai
topic: Recommendations
memory: true
memory_config:
provider: sqlite
db_path: recommendations.db
roles:
recommender:
role: Recommendation Specialist
goal: Generate structured recommendations
backstory: You are an expert at finding great content
tools:
- duckduckgo
memory: true
tasks:
recommend:
description: Recommend 5 sci-fi movies from 2024
expected_output: Structured recommendations
output_json:
category: string
items: array
descriptions: array
ratings: array
praisonai agents.yaml --verbose
Serve API
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="Recommender",
instructions="Generate structured recommendations.",
tools=[duckduckgo],
memory=True
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Recommend books", "session_id": "rec-001"}'
Monitor / Verify
praisonai "test recommendations" --web-search --verbose
Cleanup
Features Demonstrated
| Feature | Implementation |
|---|
| Workflow | Personalized recommendation generation |
| DB Persistence | SQLite via memory_config |
| Observability | --verbose flag |
| Tools | DuckDuckGo search |
| Resumability | Session with session_id |
| Structured Output | Pydantic Recommendation model |
Next Steps