AI Document Assistant via Telegram + Supabase

For Telegram, this workflow enables users to upload PDF documents and interact with an AI assistant that answers questions based on the document's content. It leverages Google Gemini for intelligent responses and Supabase for efficient document storage and retrieval. Users can also access real-time weather information, enhancing the overall experience. The system processes documents seamlessly, creating a searchable knowledge base and delivering responses in a user-friendly format.

7/8/2025
28 nodes
Complex
fo1othuy0rxxpbjjhcgcsab27xdcfycfnfkp0tdshxjdwiogqxemqnrn4xlexs1irlzgltwjo60sk1dmfmh2im2phjbozkxpghpux9kkaqplyivrtshettl48vrqmyivmanualcomplexlangchainopenweathermaptooltelegramtriggertelegramextractfromfilesticky noteaggregatesplitoutadvancedcommunicationbotfilesstoragelogicrouting
Categories:
Communication & MessagingComplex WorkflowManual TriggeredWeb Scraping & Data Extraction
Integrations:
LangChainOpenWeatherMapToolTelegramTriggerTelegramExtractFromFileSticky NoteAggregateSplitOut

Target Audience

Target Audience


- Individuals and Professionals looking to interact with their documents in a conversational manner via Telegram.
- Students and Researchers who need to quickly extract information from PDF documents and ask questions about them.
- Small Business Owners who want to automate customer inquiries related to uploaded documents.
- Developers interested in leveraging no-code solutions and integrating AI capabilities into their applications.
- Data Analysts who need real-time data insights, such as weather information, alongside their document queries.

Problem Solved

Problem Solved


This workflow addresses the challenge of efficiently querying and retrieving information from PDF documents. Users can upload documents and ask questions about their content directly through a Telegram bot. It eliminates the need for manual searching and allows for instant, AI-generated responses, enhancing productivity and information accessibility. Additionally, it provides real-time data integration, such as weather updates, ensuring users have comprehensive information at their fingertips.

Workflow Steps

Workflow Steps


1. Telegram Trigger: The workflow is initiated when a user sends a message to the Telegram bot.
2. Command Router: The bot determines whether the message contains a document or text. If a document is detected, it proceeds to download the file; otherwise, it routes to the AI Agent for text processing.
3. Download File: If a document is uploaded, the bot downloads it for processing.
4. Extract from File: The content of the PDF is extracted for further analysis.
5. Embedding Generation: The extracted text is converted into embeddings using the Google Gemini model, which allows for efficient searching and retrieval.
6. Save Embeddings: The generated embeddings are stored in a Supabase vector store, creating a searchable knowledge base.
7. AI Agent Interaction: For text queries, the AI Agent generates responses based on user input and the knowledge base.
8. Handle Formatting: The response is formatted to ensure compatibility with Telegram's messaging system, including HTML escape sequences.
9. Send Response: The bot sends the formatted response back to the user, ensuring clarity and readability. If the response exceeds Telegram's character limit, it is split into multiple messages.
10. Dynamic Weather Data: If requested, the bot can also fetch and include current weather data in its responses.

Customization Guide

Customization Guide


- Change API Credentials: Update the API credentials for Telegram, Google Gemini, and Supabase with your own authentication details to ensure connectivity.
- Modify Response Structure: Adjust the formatting and structure of responses generated by the AI Agent to suit your branding or communication style. You can customize HTML tags and message splitting logic.
- Add Additional Integrations: Enhance the bot's functionality by integrating more APIs, such as news or stock data, to provide users with a broader range of information.
- Adjust Embedding Models: Experiment with different embedding models available in the Google Gemini suite to improve the accuracy of document retrieval based on your specific use cases.
- Personalize User Interactions: Tailor the conversational flow by modifying the AI Agent's system messages and prompts to better align with your target audience's needs.