HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/PraisonAI/docs/agents/planning.mdx
---
title: "Planning Agent"
sidebarTitle: "Planning"
description: "Learn how to create AI agents for trip planning and itinerary generation."
icon: "calendar"
---

```mermaid
flowchart LR
    In[Request] --> Search[Web Search]
    Search --> Analyzer[Options Analyzer]
    Analyzer --> Generator[Plan Generator]
    Generator --> Out[Itinerary]
    
    style In fill:#8B0000,color:#fff
    style Search fill:#2E8B57,color:#fff
    style Analyzer fill:#2E8B57,color:#fff
    style Generator fill:#2E8B57,color:#fff
    style Out fill:#8B0000,color:#fff
```

A workflow demonstrating how the Planning Agent can search for travel options and create detailed itineraries.

## Quick Start

<Steps>
    <Step title="Install Package">
        First, install the PraisonAI Agents package:
        ```bash
        pip install praisonaiagents
        ```
    </Step>

    <Step title="Set API Key">
        Set your OpenAI API key as an environment variable:
        ```bash
        export OPENAI_API_KEY=your_api_key_here
        ```
    </Step>

    <Step title="Create Script">
        Create a new file `travel_planner.py`:
        ```python
        from praisonaiagents import Agent, Tools
        from praisonaiagents.tools import duckduckgo

        # Create Planning Agent
        planning_agent = Agent(
            name="TravelPlanner",
            role="Travel Planning Specialist",
            goal="Create comprehensive travel plans and itineraries",
            instructions="You are a Planning Agent",
            tools=[duckduckgo]
        )

        # Generate travel plan
        response = planning_agent.start(
            "I want to go to London next week, find me a good hotel and flight"
        )
        
        # Save plan
        with open('travel_plan.txt', 'w') as f:
            f.write(response)
        ```
    </Step>
</Steps>

## Understanding Travel Planning

The Planning Agent combines multiple capabilities to create comprehensive travel plans:

1. **Web Search**: Uses DuckDuckGo to find current travel options
2. **Options Analysis**: Evaluates and compares different choices
3. **Plan Generation**: Creates detailed itineraries
4. **Recommendations**: Provides personalized suggestions

## Features

<CardGroup cols={2}>
  <Card title="Flight Search" icon="plane">
    Finds and compares flight options.
  </Card>
  <Card title="Hotel Booking" icon="hotel">
    Recommends suitable accommodations.
  </Card>
  <Card title="Itinerary Creation" icon="calendar-days">
    Generates detailed travel schedules.
  </Card>
  <Card title="Real-time Data" icon="clock">
    Uses current pricing and availability.
  </Card>
</CardGroup>

## Example Usage

```python
# Example: Create a weekend trip plan
from praisonaiagents import Agent, Tools
from praisonaiagents.tools import duckduckgo

agent = Agent(instructions="You are a Planning Agent", tools=[duckduckgo])
agent.start("I want to go London next week, find me a good hotel and flight")
```

## Next Steps

- Learn about [Prompt Chaining](/features/promptchaining) for complex travel planning
- Explore [Evaluator Optimizer](/features/evaluator-optimiser) for improving recommendations
- Check out the [Research Agent](/agents/research) for detailed destination research