> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Prompt Expander Agent • AI Agent SDK

> Prompt Expander Agent Module

# prompt\_expander\_agent

<Badge color="blue">AI Agent</Badge>

Prompt Expander Agent Module

This module provides the PromptExpanderAgent class for expanding short prompts
into detailed, comprehensive prompts for better task execution.

Unlike QueryRewriterAgent (which optimizes queries for search/retrieval),
PromptExpanderAgent focuses on enriching prompts for task execution.

Supported Expansion Strategies:

* **BASIC**: Simple expansion with clarity improvements
* **DETAILED**: Rich expansion with context, constraints, and examples
* **STRUCTURED**: Expansion with clear structure (task, format, requirements)
* **CREATIVE**: Expansion with creative flair and vivid language
* **AUTO**: Automatically selects the best strategy based on prompt analysis

Example:
from praisonaiagents import PromptExpanderAgent, ExpandStrategy

agent = PromptExpanderAgent()

# Basic expansion

result = agent.expand("write a movie script in 3 lines")
print(result.expanded\_prompt)

# Detailed expansion

result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
print(result.expanded\_prompt)

# With tools for context gathering

from praisonaiagents.tools import internet\_search
agent = PromptExpanderAgent(tools=\[internet\_search])
result = agent.expand("latest AI developments")

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.agent import prompt_expander_agent
```

## Classes

<CardGroup cols={2}>
  <Card title="ExpandStrategy" icon="brackets-curly" href="../classes/ExpandStrategy">
    Enumeration of available prompt expansion strategies.
  </Card>

  <Card title="ExpandResult" icon="brackets-curly" href="../classes/ExpandResult">
    Result of a prompt expansion operation.
  </Card>

  <Card title="PromptExpanderAgent" icon="brackets-curly" href="../classes/PromptExpanderAgent">
    Agent for expanding short prompts into detailed, comprehensive prompts.
  </Card>
</CardGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agents Concept" icon="robot" href="/docs/concepts/agents" />

  <Card title="Single Agent Guide" icon="book-open" href="/docs/guides/single-agent" />

  <Card title="Multi-Agent Guide" icon="users" href="/docs/guides/multi-agent" />

  <Card title="Agent Configuration" icon="gear" href="/docs/configuration/agent-config" />

  <Card title="Auto Agents" icon="wand-magic-sparkles" href="/docs/features/autoagents" />
</CardGroup>
