Animated data flow diagram

AI Q&A Agent with Perplexity API (v1)

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Perplexity AI API

Overview

Unlock AI-Powered Answers with this Perplexity Q&A Agent

This n8n workflow transforms into an AI Agent that connects directly to the Perplexity API, empowering you to get quick, intelligent answers to your pressing questions. Simply set a system prompt to guide the AI's persona (e.g., 'You are an expert n8n automation consultant'), provide your specific question in the user prompt, and optionally narrow the search to particular websites. The agent then utilizes Perplexity's advanced AI models to fetch comprehensive answers, complete with citations for easy verification. This is perfect for solopreneurs, founders, and CTOs who need rapid, AI-assisted research, competitive analysis, or even initial content generation.

Key Features & Benefits

  • Intelligent Q&A: Leverages Perplexity's advanced AI models (e.g., Sonar series) for accurate and context-aware responses.
  • Customizable AI Persona: Tailor the AI's role and tone using the system prompt for more relevant answers.
  • Focused & Fresh Research: Restrict searches to specific domains and filter by recency (e.g., using the 'month' filter) for targeted, up-to-date information.
  • Source Verification: Includes citations in the output, allowing you to trace the source of information for credibility.
  • Efficient Information Retrieval: Automates querying advanced AI models, saving significant time in research and analysis.
  • Clean & Ready Output: The workflow processes the raw API response to deliver a concise answer and a structured list of citations.

Use Cases

  • B2C E-commerce: Quickly analyze competitor product descriptions, features, or customer reviews by asking direct questions about their websites.
  • B2B SaaS: Generate initial research for competitive landscape documents, comparing your solution against others based on information from specified domains.
  • Founders & Solopreneurs: Rapidly gather information on market trends, potential technologies, or business strategies with AI-assisted Q&A.
  • CTOs & Heads of Automation: Evaluate new tools or APIs by querying Perplexity for summaries, comparisons, or implementation guides from trusted sources.
  • Content Teams: Kickstart articles or FAQs by asking Perplexity for summaries or key points on specific topics, then verifying with provided citations.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • Perplexity AI API Key. You can get one and add credits at https://www.perplexity.ai/settings/api.
  • Credentials for Perplexity API (Header Auth: Name 'Authorization', Value 'Bearer YOUR_API_KEY').

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Set up Perplexity Credentials: a. Go to https://www.perplexity.ai/settings/api to get your API Key (purchase credits if necessary). b. In the 'Perplexity Request' node within the workflow, click on 'Credential for HTTP Header Auth'. c. Select 'Create New Credential'. d. For the 'Name' field, enter Authorization. e. For the 'Value' field, enter Bearer YOUR_PERPLEXITY_API_KEY (replace YOUR_PERPLEXITY_API_KEY with your actual key). f. Save the credential.
  4. Customize Query Parameters: a. Open the 'Set Params' node. b. Modify the system_prompt to define the AI's behavior or expertise (e.g., "You are an n8n expert comparing automation tools."). c. Set the user_prompt to the question you want to ask (e.g., "What are the key differences between n8n and Zapier for a solopreneur?"). d. Optionally, update the domains field with a comma-separated list of websites to restrict the search (e.g., n8n.io,zapier.com).
  5. Activate the workflow.
  6. Run the workflow manually via the 'When clicking ‘Test workflow’' trigger or connect it to your desired trigger.

Tags:

AI AgentPerplexity AIQ&AResearch AutomationCompetitive AnalysisLLMContent GenerationProductivity

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation