Overview
Theperplexity_ask tool provides fast, AI-generated answers to questions using the Sonar Pro model with real-time web search. It’s the fastest and most cost-effective option for general Q&A, summaries, and explanations.
This tool uses the sonar-pro model, which balances speed, quality, and cost for everyday queries.
Use Cases
- Quick factual questions
- Summaries and explanations
- General knowledge queries
- Current events and news
- Product comparisons
- How-to guides
Parameters
Array of conversation messages in OpenAI format.Each message must have:
role: One of"system","user", or"assistant"content: The message text (string)
Filter search results by how recent they are.Options:
"hour", "day", "week", "month", "year""hour": Very recent news (last 60 minutes)"day": Today’s updates (last 24 hours)"week": This week’s content"month": This month’s content"year": This year’s content
"day"Restrict or exclude specific domains from search results.
- Include domains:
["wikipedia.org", "arxiv.org"] - Exclude domains:
["-reddit.com", "-pinterest.com"](use-prefix)
["github.com", "stackoverflow.com"]Control how much web context is retrieved for answering.Options:
"low", "medium", "high""low"(default): Fastest, uses minimal context"medium": Balanced speed and context"high": Most comprehensive, slower
"medium"Response Format
The tool returns an AI-generated text response with inline citation references:AI-generated answer with numbered citation references
[1], [2], etc.Citations are appended at the end in the format:Example Response
Usage Examples
Common Patterns
Breaking News Queries
Get the latest information on current events:Academic Research
Focus on scholarly sources:Product Comparisons
Get unbiased comparisons without marketing sites:Advanced Usage
System Prompts
Use system messages to guide the response format:Combining Filters
Use multiple filters for precise results:Tips and Best Practices
Comparison with Other Tools
| Feature | perplexity_ask | perplexity_research | perplexity_reason |
|---|---|---|---|
| Model | sonar-pro | sonar-deep-research | sonar-reasoning-pro |
| Speed | Fast (< 5s) | Slow (30s+) | Medium (5-15s) |
| Depth | Standard | Comprehensive | Analytical |
| Best For | Quick Q&A | Deep research | Logic & reasoning |
| Recency Filter | Yes | No | Yes |
| Domain Filter | Yes | No | Yes |
| Context Size | Adjustable | High (default) | Adjustable |
perplexity_ask is the fastest and most cost-effective option. Use perplexity_research only when you need comprehensive, multi-source analysis.Error Handling
Common errors and solutions:- Invalid messages array: Ensure each message has
roleandcontentfields - Invalid role: Must be
"system","user", or"assistant" - Empty content: Message content cannot be empty or null
- Invalid recency filter: Must be one of:
hour,day,week,month,year - Invalid context size: Must be one of:
low,medium,high
Related Tools
Search Tool
Get raw search results without AI synthesis
Research Tool
Conduct deep, comprehensive multi-source research
Reason Tool
Use advanced reasoning for complex analytical tasks
Tools Overview
Compare all available tools and their capabilities