Skip to content

strands-perplexity

strands-perplexity is a real-time web search tool powered by the Perplexity Search API with citation support, regional filtering, and multi-query capabilities.

Terminal window
pip install strands-perplexity
from strands import Agent
from strands_perplexity import perplexity_search
agent = Agent(tools=[perplexity_search])
# Search the web
agent("What are the latest developments in AI?")
# Research a topic
agent("Find recent papers on quantum computing breakthroughs")
# Get current information
agent("What happened in tech news today?")
  • Real-time Web Search: Access ranked web search results from Perplexity’s continuously refreshed index
  • Citations Included: Every result includes URLs for proper attribution
  • Regional Search: Filter results by country using ISO country codes
  • Language Filtering: Filter results by language using ISO 639-1 codes
  • Domain Filtering: Include or exclude specific domains from results
  • Multi-query Support: Execute up to 5 related queries in a single request
Terminal window
PERPLEXITY_API_KEY=your_api_key # Required

Get your API key at: Perplexity API Settings