Perplexity Agent Search
Use the Perplexity Agent API to perform real-time web searches and get grounded answers.
Workflow
To perform a web search:
- Identify the user's research or search query.
- Execute the
scripts/search.pyscript with the query. - Present the
answerfrom the JSON response to the user.
Example
To search for "latest AI developments":
python3 scripts/search.py "What are the latest developments in AI?"
Important
- Requires
PERPLEXITY_API_KEYto be set in the environment. - Uses the
pro-searchpreset for high-quality, researched results. - Returns a JSON object with
success,answer, and themodelused.