Answer Questions with Factual Web Search using Telegram, Tavily and GPT-5
π§ Telegram Search Assistant β Tavily + AI/ML API
This n8n workflow lets users ask questions in Telegram and receive concise, fact-based answers.
It performs a web search with Tavily, then uses AIMLAPI (GPT-5) to summarize results into a clear 3β4 sentence reply.
The flow ensures grounded, non-hallucinated answers.
π Features π© Telegram-based input β¨οΈ Typing indicator for better UX π Web search with Tavily (JSON results) π§ Summarization with AIMLAPI (openai/gpt-5-chat-latest) π€ Replies in the same chat/thread β Guardrails against hallucinations
π Setup Guide
-
π² Create Telegram Bot Talk to @BotFather Use /newbot β choose a name and username Save the bot token
-
π Set Up Credentials in n8n Telegram API**: use your bot token
Tavily**: add your Tavily API key
AI/ML API**: add your API key
Base URL: https://api.aimlapi.com/v1 -
π§ Configure the Workflow Open the n8n editor and import the JSON
Update credentials for Telegram, Tavily, and AIMLAPI
βοΈ Flow Summary
| Node | Function | |--------------------------|-----------------------------------------------| | π© Receive Telegram Msg | Triggered when user sends text | | β¨οΈ Typing Indicator | Shows βtypingβ¦β to user | | π Web Search | Queries Tavily with userβs message | | π§ LLM Summarize | Summarizes search JSON into a factual answer | | π€ Reply to Telegram | Sends concise answer back to same thread |
π Data Handling
By default: no data stored
Optional: log queries & answers to Google Sheets or a database
π‘ Example Prompt Flow
User sends:
When is the next solar eclipse in Europe?
Bot replies: The next solar eclipse in Europe will occur on August 12, 2026. It will be visible as a total eclipse across Spain, with partial views in much of Europe. The maximum eclipse will occur around 17:46 UTC.
π Customization
Add commands: /help, /sources, /news
Apply rate-limits per user
Extend logging to Google Sheets / DB
Add NSFW / profanity filters before search
π§ͺ Testing
Test end-to-end in Telegram (not just βExecute Nodeβ)
Add a fallback reply if Tavily returns empty results
Use sticky notes for debugging & best practices
π Resources
π AI/ML API Docs
π Tavily Search API
Related Templates
Reply to Outlook Emails with OpenAI
Who is this template for? This template is for any Microsoft Outlook user who wants a trained AI agent to reason and rep...
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments