perplexity-search▌
davila7/claude-code-templates · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
AI-powered web search with real-time information and source citations via Perplexity models.
- ›Access five Perplexity models through a single OpenRouter API key, ranging from cost-effective Sonar to advanced Sonar Pro Search for complex multi-step analysis
- ›Ideal for finding current information beyond model knowledge cutoff, recent scientific literature, clinical trials, and domain-specific research with peer-reviewed sources
- ›Includes comprehensive query design guidance covering specifi
Perplexity Search
Overview
Perform AI-powered web searches using Perplexity models through LiteLLM and OpenRouter. Perplexity provides real-time, web-grounded answers with source citations, making it ideal for finding current information, recent scientific literature, and facts beyond the model's training data cutoff.
This skill provides access to all Perplexity models through OpenRouter, requiring only a single API key (no separate Perplexity account needed).
When to Use This Skill
Use this skill when:
- Searching for current information or recent developments (2024 and beyond)
- Finding latest scientific publications and research
- Getting real-time answers grounded in web sources
- Verifying facts with source citations
- Conducting literature searches across multiple domains
- Accessing information beyond the model's knowledge cutoff
- Performing domain-specific research (biomedical, technical, clinical)
- Comparing current approaches or technologies
Do not use for:
- Simple calculations or logic problems (use directly)
- Tasks requiring code execution (use standard tools)
- Questions well within the model's training data (unless verification needed)
Quick Start
Setup (One-time)
-
Get OpenRouter API key:
- Visit https://openrouter.ai/keys
- Create account and generate API key
- Add credits to account (minimum $5 recommended)
-
Configure environment:
# Set API key export OPENROUTER_API_KEY='sk-or-v1-your-key-here' # Or use setup script python scripts/setup_env.py --api-key sk-or-v1-your-key-here -
Install dependencies:
uv pip install litellm -
Verify setup:
python scripts/perplexity_search.py --check-setup
See references/openrouter_setup.md for detailed setup instructions, troubleshooting, and security best practices.
Basic Usage
Simple search:
python scripts/perplexity_search.py "What are the latest developments in CRISPR gene editing?"
Save results:
python scripts/perplexity_search.py "Recent CAR-T therapy clinical trials" --output results.json
Use specific model:
python scripts/perplexity_search.py "Compare mRNA and viral vector vaccines" --model sonar-pro-search
Verbose output:
python scripts/perplexity_search.py "Quantum computing for drug discovery" --verbose
Available Models
Access models via --model parameter:
- sonar-pro (default): General-purpose search, best balance of cost and quality
- sonar-pro-search: Most advanced agentic search with multi-step reasoning
- sonar: Basic model, most cost-effective for simple queries
- sonar-reasoning-pro: Advanced reasoning with step-by-step analysis
- sonar-reasoning: Basic reasoning capabilities
Model selection guide:
- Default queries →
sonar-pro - Complex multi-step analysis →
sonar-pro-search - Explicit reasoning needed →
sonar-reasoning-pro - Simple fact lookups →
sonar - Cost-sensitive bulk queries →
sonar
See references/model_comparison.md for detailed comparison, use cases, pricing, and performance characteristics.
Crafting Effective Queries
Be Specific and Detailed
Good examples:
- "What are the latest clinical trial results for CAR-T cell therapy in treating B-cell lymphoma published in 2024?"
- "Compare the efficacy and safety profiles of mRNA vaccines versus viral vector vaccines for COVID-19"
- "Explain AlphaFold3 improvements over AlphaFold2 with specific accuracy metrics from 2023-2024 research"
Bad examples:
- "Tell me about cancer treatment" (too broad)
- "CRISPR" (too vague)
- "vaccines" (lacks specificity)
Include Time Constraints
Perplexity searches real-time web data:
- "What papers were published in Nature Medicine in 2024 about long COVID?"
- "What are the latest developments (past 6 months) in large language model efficiency?"
- "What was announced at NeurIPS 2023 regarding AI safety?"
Specify Domain and Sources
For high-quality results, mention source preferences:
- "According to peer-reviewed publications in high-impact journals..."
- "Based on FDA-approved treatments..."
- "From clinical trial registries like clinicaltrials.gov..."
Structure Complex Queries
Break complex questions into clear components:
- Topic: Main subject
- Scope: Specific aspect of interest
- Context: Time frame, domain, constraints
- Output: Desired format or type of answer
Example: "What improvements does AlphaFold3 offer over AlphaFold2 for protein structure prediction, according to research published between 2023 and 2024? Include specific accuracy metrics and benchmarks."
See references/search_strategies.md for comprehensive guidance on query design, domain-specific patterns, and advanced techniques.
Common Use Cases
Scientific Literature Search
python scripts/perplexity_search.py \
"What does recent research (2023-2024) say about the role of gut microbiome in Parkinson's disease? Focus on peer-reviewed studies and include specific bacterial species identified." \
--model sonar-pro
Technical Documentation
python scripts/perplexity_search.py \
"How to implement real-time data streaming from Kafka to PostgreSQL using Python? Include considerations for handling backpressure and ensuring exactly-once semantics." \
--model sonar-reasoning-pro
Comparative Analysis
python scripts/perplexity_search.py \
"Compare PyTorch versus TensorFlow for implementing transformer models in terms of ease of use, performance, and ecosystem support. Include benchmarks from recent studies." \
--model sonar-pro-search
Clinical Research
python scripts/perplexity_search.py \
"What is the evidence for intermittent fasting in managing type 2 diabetes in adults? Focus on randomized controlled trials and report HbA1c changes and weight loss outcomes." \
--model sonar-pro
Trend Analysis
python scripts/perplexity_search.py \
"What are the key trends in single-cell RNA sequencing technology over the past 5 years? Highlight improvements in throughput, cost, and resolution, with specific examples." \
--model sonar-pro
Working with Results
Programmatic Access
Use perplexity_search.py as a module:
from scripts.perplexity_search import search_with_perplexity
result = search_with_perplexity(
query="What are the latest CRISPR developments?",
model="openrouter/perplexity/sonar-pro",
max_tokens=4000,
temperature=0.2,
verbose=False
)
if result["success"]:
print(result["answer"])
print(f"Tokens used: {result['usage']['total_tokens']}")
else:
print(f"Error: {result['error']}")
Save and Process Results
# Save to JSON
python scripts/perplexity_search.py "query" --output results.json
# Process with jq
cat results.json | jq '.answer'
cat results.json | jq '.usage'
Batch Processing
Create a script for multiple queries:
#!/bin/bash
queries=(
"CRISPR developments 2024"
"mRNA vaccine technology advances"
"AlphaFold3 accuracy improvements"
)
for query in "${queries[@]}"; do
echo "Searching: $query"
python scripts/perplexity_search.py "$query" --output "results_$(echo $query | tr ' ' '_').json"
sleep 2 # Rate limiting
done
Cost Management
Perplexity models have different pricing tiers:
Approximate costs per query:
- Sonar: $0.001-0.002 (most cost-effective)
- Sonar Pro: $0.002-0.005 (recommended default)
- Sonar Reasoning Pro: $0.005-0.010
- Sonar Pro Search: $0.020-0.050+ (most comprehensive)
Cost optimization strategies:
- Use
sonarfor simple fact lookups - Default to
sonar-profor most queries - Reserve
sonar-pro-searchfor complex analysis - Set
--max-tokensto limit response length - Monitor usage at https://openrouter.ai/activity
- Set spending limits in OpenRouter dashboard
Troubleshooting
API Key Not Set
Error: "OpenRouter API key not configured"
Solution:
export OPENROUTER_API_KEY='sk-or-v1-your-key-here'
# Or run setup script
python scripts/setup_env.py --api-key sk-or-v1-your-key-here
LiteLLM Not Installed
Error: "LiteLLM not installed"
Solution:
uv pip install litellm
Rate Limiting
Error: "Rate limit exceeded"
Solutions:
- Wait a few seconds before retrying
- Increase rate limit at https://openrouter.ai/keys
- Add delays between requests in batch processing
Insufficient Credits
Error: "Insufficient credits"
Solution:
- Add credits at https://openrouter.ai/account
- Enable auto-recharge to prevent interruptions
See references/openrouter_setup.md for comprehensive troubleshooting guide.
Integration with Other Skills
This skill complements other scientific skills:
Literature Review
Use with literature-review skill:
- Use Perplexity to find recent papers and preprints
- Supplement PubMed searches with real-time web results
- Verify citations and find related work
- Discover latest developments post-database indexing
Scientific Writing
Use with scientific-writing skill:
- Find recent references for introduction/discussion
- Verify current state of the art
- Check latest terminology and conventions
- Identify recent competing approaches
Hypothesis Generation
Use with hypothesis-generation skill:
- Search for latest research findings
- Identify current gaps in knowledge
- Find recent methodological advances
- Discover emerging research directions
Critical Thinking
Use with scientific-critical-thinking skill:
- Find evidence for and against hypotheses
- Locate methodological critiques
- Identify controversies in the field
- Verify claims with current evidence
Best Practices
Query Design
- Be specific: Include domain, time frame, and constraints
- Use terminology: Domain-appropriate keywords and phrases
- Specify sources: Mention preferred publication types or journals
- Structure questions: Clear components with explicit context
- Iterate: Refine based on initial results
Model Selection
- Start with sonar-pro: Good default for most queries
- Upgrade for complexity: Use sonar-pro-search for multi-step analysis
- Downgrade for simplicity: Use sonar for basic facts
- Use reasoning models: When step-by-step analysis needed
Cost Optimization
- Choose appropriate models: Match model to query complexity
- Set token limits: Use
--max-tokensto control costs - Monitor usage: Check OpenRouter dashboard regularly
- Batch efficiently: Combine related simple queries when possible
- Cache results: Save and reuse results for repeated queries
Security
- Protect API keys: Never commit to version control
- Use environment variables: Keep keys separate from code
- Set spending limits: Configure in OpenRouter dashboard
- Monitor usage: Watch for unexpected activity
- Rotate keys: Change keys periodically
Resources
Bundled Resources
Scripts:
scripts/perplexity_search.py: Main search script with CLI interfacescripts/setup_env.py: Environment setup and validation helper
References:
references/search_strategies.md: Comprehensive query design guidereferences/model_comparison.md: Detailed model comparison and selection guidereferences/openrouter_setup.md: Complete setup, troubleshooting, and security guide
Assets:
assets/.env.example: Example environment file template
External Resources
OpenRouter:
- Dashboard: https://openrouter.ai/account
- API Keys: https://openrouter.ai/keys
- Perplexity Models: https://openrouter.ai/perplexity
- Usage Monitoring: https://openrouter.ai/activity
- Documentation: https://openrouter.ai/docs
LiteLLM:
- Documentation: https://docs.litellm.ai/
- OpenRouter Provider:
How to use perplexity-search on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add perplexity-search
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches perplexity-search from GitHub repository davila7/claude-code-templates and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate perplexity-search. Access the skill through slash commands (e.g., /perplexity-search) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★30 reviews- ★★★★★Shikha Mishra· Dec 24, 2024
perplexity-search is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Tariq Diallo· Dec 4, 2024
perplexity-search fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Nikhil Anderson· Nov 23, 2024
perplexity-search is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Rahul Santra· Nov 15, 2024
perplexity-search fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Yusuf Jain· Oct 14, 2024
Solid pick for teams standardizing on skills: perplexity-search is focused, and the summary matches what you get after install.
- ★★★★★Pratham Ware· Oct 6, 2024
perplexity-search has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Yuki Sharma· Sep 21, 2024
Registry listing for perplexity-search matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Li Sanchez· Sep 17, 2024
perplexity-search fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Yash Thakker· Sep 13, 2024
perplexity-search reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Ishan Singh· Sep 13, 2024
Keeps context tight: perplexity-search is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 30