| name | perplexity-known-pitfalls |
| description | Identify and avoid Perplexity anti-patterns and common integration mistakes.
Use when reviewing Perplexity code, onboarding new developers,
or auditing existing integrations for best practices violations.
Trigger with phrases like "perplexity mistakes", "perplexity anti-patterns",
"perplexity pitfalls", "perplexity code review", "perplexity gotchas".
|
| allowed-tools | Read, Grep |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","perplexity","audit"] |
| compatibility | Designed for Claude Code |
Perplexity Known Pitfalls
Overview
Real gotchas when integrating Perplexity Sonar API. Perplexity uses an OpenAI-compatible chat endpoint but performs live web searches -- a fundamentally different paradigm from standard LLM completions. These pitfalls come from treating it like a regular chatbot.
Prerequisites
- Perplexity API key configured
- Understanding of OpenAI-compatible chat API format
Pitfalls
1. Using It as a Generic Chatbot
Perplexity searches the web per request. Using it for tasks that don't need web search wastes money.
response = call_perplexity("Write me a haiku about cats")
response = call_perplexity(
"What are the latest Next.js 15 features released this month?",
search_recency_filter="month"
)
2. Ignoring Citations
Perplexity returns [1], [2] markers in text with a separate citations array. Ignoring them loses the key value prop.
data = response.model_dump()
answer = data["choices"][0]["message"]["content"]
citations = data.get("citations", [])
print(answer)
import re
for i, url in enumerate(citations, 1):
answer = answer.replace(f"[{i}]", f"{i}")
3. Using Wrong SDK Import
There is no @perplexity/sdk or Python package. Use the standard OpenAI client.