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 desktop






