How to Build a No-Code Research AI Agent in n8n

TL;DR
A research AI agent can be built in n8n without code by connecting two services: OpenRouter, which supplies the model brain, and Perplexity, which gives the agent real-time web search. A chat message triggers the agent, it runs deep research, and returns a report with sources. The whole setup takes about 12 minutes.
Transcript
by the end of this video you'll have built your very own research AI agent without writing a single line of code and I think you guys will be shocked at how simple it is to set up i'm going to walk through the entire process with you guys step by step all of the connections all the credentials all the tough stuff like that i even went ahead and spu... Read More
Key Insights
- OpenRouter serves as the brain for the research agent, letting you connect to many different AI models including OpenAI, Perplexity, Qwen, Anthropic, and Google from a single credential inside n8n.
- Perplexity acts as the agent's research tool, described as a ChatGPT research tool on steroids, giving the agent the ability to search the internet in real time and pull accurate sources.
- An API key is essentially a password, so it must be kept secret because anyone who plugs in your key can consume the credits you are paying for in that account.
- Both OpenRouter and Perplexity require a credit balance in the account, because without credits the AI model brain and the web search tool will not function.
- The n8n build uses three connected pieces: a chat message trigger to communicate, an AI agent node, and the OpenRouter chat model plus Perplexity tool attached to it.
- GPT-4.1 Mini is chosen as the default chat model because it offers a good balance of being cheap but also powerful for the research agent's brain.
- Perplexity offers multiple models for different depths: Sonar and Sonar Pro for basic search, Sonar Deep Research for research, and Sonar Reasoning or Sonar Reasoning Pro for reasoning tasks.
- The 'let the model define this parameter' option lets the AI agent automatically fill in the Perplexity search query itself, so it decides what to type based on how you interact with it.
Install to Summarize YouTube Videos and Get Transcripts
Explore YouTube Video Summarizer or Get YouTube Transcript Extractor
Questions & Answers
Q: How do you build a research AI agent without code?
You build it in n8n by connecting two services. OpenRouter provides access to AI models that act as the agent's brain, and Perplexity gives the agent real-time internet search. You add a chat message trigger to communicate with the agent, attach an AI agent node, connect OpenRouter as the chat model, and add Perplexity as a tool. Then you send it a message and it responds with a research report. No code is required, only credentials and connections.
Q: What is OpenRouter used for in the AI agent?
OpenRouter serves as the brain for the research agent. It lets you connect to many different AI models from a single credential inside n8n, including models from OpenAI, Perplexity, Qwen, Anthropic, and Google. Once connected with an API key, the AI agent can use whichever chat model you choose to understand your requests and respond. In the video the presenter keeps it set to GPT-4.1 Mini as a balance of cheap but powerful.
Q: What does Perplexity do for the research agent?
Perplexity is the research tool the agent uses, described as a ChatGPT research tool on steroids. It gives the agent access to searching the internet in real time so it can pull accurate sources and return summaries with direct links. Inside n8n you connect it as a Perplexity tool with an API key, choose a model such as Sonar Deep Research, and the agent uses it to search the web and gather information before responding with a report.
Q: What is an API key and why keep it secret?
An API key is basically a fancy word for a password that lets one service connect to another. In this workflow you create keys in OpenRouter and Perplexity and paste them into n8n to authorize the connections. You must keep your API key secret because if someone else plugs in your key, they will be able to eat up the credits that you are paying for in your account. You also want to store it somewhere safe because the service will not show it again.
Q: Why do you need credits in OpenRouter and Perplexity?
Both services require a credit balance to function. In OpenRouter, credits represent how much money you have in your account, and if you do not have credits you will not be able to use the AI model as a brain. Similarly in Perplexity, under API billing you need some sort of credit balance, otherwise it will not be able to actually search the web. Without credits in either account, the agent cannot think or research.
Q: Which Perplexity model should you choose for research?
Perplexity offers several models suited to different needs. For basic search you can use Sonar Pro or Sonar. For research you can use Sonar Deep Research. For reasoning you can use Sonar Reasoning Pro or Sonar Reasoning. In the video the presenter selects Sonar Deep Research for in-depth analysis. The models differ in the depth and quality of research and also vary in pricing, so you choose based on your use case. Deep research takes longer than a basic web search.
Q: How does the agent know what to search for on Perplexity?
In the Perplexity tool settings there is a user message field where you would normally type what you want to search. Instead of filling this manually, you click the button that says 'let the model define this parameter.' This makes the AI agent smart enough to automatically fill in the search query itself based on the way you interact with it. So when you ask a question in chat, the agent decides what it would type into the search and runs the research on its own.
Q: Why give an AI agent a system message?
By default the system message is 'you are a helpful assistant,' but typically you want to give the agent specific instructions, such as telling it that it is an expert research agent with a tool to do research. The video shows the agent working without a custom system prompt to demonstrate how quick, easy, and smart it is by default. However, the presenter notes that once you do add a system prompt, the agent would get much, much smarter and more capable at its task.
Summary & Key Takeaways
-
The goal is to build a research AI agent in n8n with no code. Two services are needed: OpenRouter connects to different AI models to act as the brain, and Perplexity gives the agent real-time internet search. Communication happens by sending the agent a chat message.
-
The build starts by adding a chat message trigger, then an AI agent node. OpenRouter is connected as the chat model using an API key created at openrouter.ai under profile keys. After pasting the key and saving, the connection tests successfully and models like GPT-4.1 Mini become available.
-
Perplexity is added as a tool with its own API key from settings. Sonar Deep Research is selected for in-depth analysis, and the model defines its own query. When asked how to optimize sleep, the agent runs deep research, returns a full report, and shows the 20 sources it searched.
Read in Other Languages (beta)
Share This Summary 📚
Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator
Explore More Summaries from Nate Herk | AI Automation 📚






Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator