Agent Presets
Pre-configured agents for common patterns. Get started instantly without manual configuration.
Overview
Agent presets provide ready-to-use agents for common AI tasks. Instead of manually configuring temperature, instructions, and capabilities, simply choose a preset and start using it immediately.
Available Presets
researcher
Purpose: Deep investigation and information gathering
agent = Agent.from_preset("researcher")
result = agent.run("Explain the latest developments in quantum computing")
Configuration: - Temperature: 0.3 (balanced creativity/analysis) - Thinking: Enabled (step-by-step reasoning) - Instructions: Focus on thorough research, evidence-based answers - Use cases: Research tasks, analysis, investigation
critic
Purpose: Constructive analysis and improvement suggestions
agent = Agent.from_preset("critic")
result = agent.run("Review this essay and suggest improvements")
Configuration: - Temperature: 0.2 (analytical and precise) - Thinking: Enabled (structured critique process) - Instructions: Provide balanced feedback with specific suggestions - Use cases: Code review, content critique, analysis
summarizer
Purpose: Concise information extraction and summarization
agent = Agent.from_preset("summarizer")
result = agent.run("Summarize this 10-page article into key points")
Configuration: - Temperature: 0.0 (deterministic output) - Thinking: Disabled (direct summarization) - Instructions: Extract key information, maintain factual accuracy - Use cases: Document summarization, meeting notes, article abstracts
planner
Purpose: Strategic task breakdown and planning
agent = Agent.from_preset("planner")
result = agent.run("Create a project plan for launching a mobile app")
Configuration: - Temperature: 0.2 (structured thinking) - Thinking: Enabled (step-by-step planning) - Instructions: Break down complex tasks into actionable steps - Use cases: Project planning, task management, strategy
coder
Purpose: Clean, production-ready code generation
agent = Agent.from_preset("coder")
result = agent.run("Write a secure login function in Python")
Configuration: - Temperature: 0.0 (consistent code output) - Thinking: Enabled (reasoning about code design) - Instructions: Write clean, documented, secure code - Use cases: Code generation, refactoring, debugging
writer
Purpose: Creative content generation and writing
agent = Agent.from_preset("writer")
result = agent.run("Write a compelling blog post about AI ethics")
Configuration: - Temperature: 0.7 (creative writing) - Thinking: Disabled (direct content generation) - Instructions: Create engaging, well-structured content - Use cases: Blog posts, marketing copy, creative writing
assistant
Purpose: General-purpose helpful assistant
agent = Agent.from_preset("assistant")
result = agent.run("Help me organize my daily schedule")
Configuration: - Temperature: 0.3 (helpful and informative) - Thinking: Disabled (direct assistance) - Instructions: Be helpful, truthful, and comprehensive - Use cases: General questions, advice, explanations
translator
Purpose: Accurate, natural language translation
agent = Agent.from_preset("translator")
result = agent.run("Translate this French text to English")
Configuration: - Temperature: 0.1 (precise translation) - Thinking: Disabled (direct translation) - Instructions: Provide accurate, natural translations - Use cases: Language translation, localization
Workflow Presets
New in YosrAI v0.2.1, workflow presets provide complete, ready-to-run architectures using Conductors and Pipelines.
content-pipeline
Type: Pipeline
Purpose: Linear content factory (Research → Outline → Write → Edit)
yosrai new workflow BlogFactory --preset content-pipeline
Features: - 4 sequential steps - Specialized role separation - Automatic data passing
deep-research-team
Type: Conductor
Purpose: Strategic planning and execution for complex research
yosrai new workflow ResearchTeam --preset deep-research-team
Features: - Planning Mode: Enabled (breaks down tasks first) - Parallel Skills: Strategist, Analyst, Executor - Best for broad, multi-subtask inquiries
resilient-service
Type: Conductor
Purpose: Reliable integration with external services
yosrai new workflow ServiceManager --preset resilient-service
Features: - Resilience: Retries (3x) and Timeout (5s) configured - Simulates robust API handling - Good pattern for production integrations
collaborative-brain
Type: Conductor
Purpose: Team sharing a common knowledge base
yosrai new workflow KnowledgeBase --preset collaborative-brain
Features: - Shared Memory: All agents read/write to same vector store - Learner (store) and Expert (retrieve) roles - Best for RAG applications
Usage
Basic Usage
from yosrai import Agent
# Create preset agent
researcher = Agent.from_preset("researcher")
# Use immediately
result = researcher.run("What are the benefits of renewable energy?")
print(result)
Customizing Presets
# Override model
researcher = Agent.from_preset("researcher", model="anthropic/claude-3")
# Override temperature
creative_writer = Agent.from_preset("writer", temperature=0.9)
# Add tools to preset
from yosrai.toolkit import WebToolkit
tools = WebToolkit().get_tools()
researcher = Agent.from_preset("researcher", tools=tools)
Preset Discovery
from yosrai import list_agent_presets
# List all available presets
presets = list_agent_presets()
for preset in presets:
print(f"{preset['name']}: {preset['description']}")
print(f" Temperature: {preset['temperature']}")
print(f" Thinking: {preset['thinking']}")
print(f" Tags: {', '.join(preset['tags'])}")
print()
Custom Presets
Creating Custom Presets
from yosrai import register_agent_preset
# Define custom preset configuration
custom_preset = {
"instructions": "You are a financial analyst specializing in cryptocurrency markets.",
"model": "openai/gpt-4o",
"temperature": 0.1,
"thinking": True,
"reflection": True,
"tags": ["finance", "crypto", "analysis"]
}
# Register the preset
register_agent_preset("crypto_analyst", custom_preset)
# Use the custom preset
analyst = Agent.from_preset("crypto_analyst")
result = analyst.run("Analyze Bitcoin's recent price movements")
Preset Configuration Schema
preset_config = {
"instructions": str, # Agent's system prompt
"model": str, # Default model (optional)
"temperature": float, # Sampling temperature (0.0 to 1.0)
"thinking": bool, # Enable chain-of-thought (optional)
"reflection": bool, # Enable self-critique (optional)
"tags": List[str] # Categorization tags (optional)
}
Advanced Custom Presets
# Team-specific presets
register_agent_preset("backend_developer", {
"instructions": "You are a senior backend developer using Python, FastAPI, and PostgreSQL.",
"model": "openai/gpt-4o",
"temperature": 0.0,
"thinking": True,
"reflection": True,
"tags": ["development", "python", "backend", "api"]
})
# Domain-specific presets
register_agent_preset("medical_consultant", {
"instructions": "You are a medical consultant providing evidence-based health advice.",
"model": "openai/gpt-4o",
"temperature": 0.1,
"thinking": True,
"reflection": True,
"tags": ["medical", "health", "consultation"]
})
CLI Integration
Creating Agents with Presets
# Create new agent using preset
yosrai new agent MyResearcher --preset researcher
# Create with custom model
yosrai new agent MyResearcher --preset researcher --model anthropic/claude-3
# List available presets
yosrai new list-presets
Interactive Chat with Presets
# Chat with preset agent
yosrai chat --preset researcher
# Save conversation
yosrai chat --preset writer --save-session story_draft.json
Best Practices
Choosing the Right Preset
- Research tasks →
researcher(thorough investigation) - Code generation →
coder(clean, documented code) - Content creation →
writer(creative writing) - Analysis/Review →
critic(constructive feedback) - Planning →
planner(task breakdown) - General questions →
assistant(helpful answers) - Translation →
translator(accurate translation)
Customization Guidelines
- Keep temperature low (0.0-0.3) for analytical tasks
- Enable thinking for complex reasoning tasks
- Use reflection for self-improving outputs
- Add domain-specific instructions for specialized presets
Performance Considerations
- Lower temperature = More consistent results
- Thinking enabled = Better reasoning but slower
- Reflection enabled = Improved quality but slower
- Choose appropriate model based on task complexity
Examples
Research Workflow
from yosrai import Agent, Workflow
# Create specialized agents
researcher = Agent.from_preset("researcher")
summarizer = Agent.from_preset("summarizer")
writer = Agent.from_preset("writer")
# Build research pipeline
pipeline = Workflow("ResearchReport")
pipeline.start(researcher).then(summarizer).then(writer)
# Execute research
result = pipeline.run("Create a report on AI safety concerns")
Code Review Process
from yosrai import Agent
# Create review team
coder = Agent.from_preset("coder")
critic = Agent.from_preset("critic")
# Generate code
code = coder.run("Write a Python function to validate email addresses")
# Review code
feedback = critic.run(f"Review this code for security and best practices: {code}")
print(f"Code: {code}")
print(f"Review: {feedback}")
Content Creation Pipeline
from yosrai import Agent
# Content creation team
researcher = Agent.from_preset("researcher")
writer = Agent.from_preset("writer")
critic = Agent.from_preset("critic")
# Research topic
research = researcher.run("Research the benefits of meditation for productivity")
# Write initial draft
draft = writer.run(f"Write a blog post about: {research}")
# Get feedback
feedback = critic.run(f"Review and suggest improvements for: {draft}")
# Revise based on feedback
final = writer.run(f"Revise this draft based on feedback: {draft}\\n\\nFeedback: {feedback}")
print(f"Final article: {final}")
Custom Domain Presets
# Register domain-specific presets
register_agent_preset("data_scientist", {
"instructions": "You are an expert data scientist specializing in machine learning and statistical analysis.",
"model": "openai/gpt-4o",
"temperature": 0.1,
"thinking": True,
"tags": ["data", "ml", "statistics", "analysis"]
})
register_agent_preset("ux_designer", {
"instructions": "You are a UX designer creating intuitive, user-centered digital experiences.",
"model": "openai/gpt-4o",
"temperature": 0.3,
"thinking": True,
"tags": ["design", "ux", "ui", "user-experience"]
})
# Use in projects
data_scientist = Agent.from_preset("data_scientist")
ux_designer = Agent.from_preset("ux_designer")