Reasoning & Sources





Pattern
Sources & Citations
Chat with source citations using Perplexity's Sonar model. Answers include clickable links for fact-checking.
IntermediateOct 2025View the full pattern on desktop


Problems solved
- Answer questions with citation-backed Perplexity Sonar responses
- Stream clickable source links for fact-checking
- Smooth word-chunked token streaming for readable answers
Use cases
- Research assistants with citations
- Fact-checking chat experiences
- News and information verification tools
- Educational tutors that show sources
AI SDK APIs
streamTextconvertToModelMessages
Tags
aichatai-sdksourcescitationsperplexity
Requirements
- Node.js
- 24+
- Memory
- 512MB
- Other
- Perplexity API key
Environment variables
PERPLEXITY_API_KEYGet key
External services
perplexity
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktopRelated patterns


Reasoning
Chat that shows AI's step-by-step reasoning. Includes decision trees, logical breakdowns, and explanatory tooltips.
aichat+4
View pattern β


Basic Chat Interface
Chat interface with streaming responses and message history. Includes typing indicators and message status tracking.
aichat+2
View pattern β



