workflows.fit
Back to n8n workflows
n8n templateFreeBy Do Thanh Vinh

Turn a GitHub knowledge base into a Telegram RAG bot with Qwen via OpenRouter

WHAT IT DOES This workflow turns a plain JSON file sitting in a GitHub repository into a fully functional Telegram chatbot with retrieval-augmented generation (RAG) — no Pinecone, no Qdrant, no vector database, no ext...

DevelopmentCommunicationHITLCore NodesAILangchainSticky NoteTelegram Trigger
Loading interactive preview...

Template notes

WHAT IT DOES

This workflow turns a plain JSON file sitting in a GitHub repository into a fully functional Telegram chatbot with retrieval-augmented generation (RAG) — no Pinecone, no Qdrant, no vector database, no extra subscription.

A user sends /ask <question> to your Telegram bot. The workflow pulls the knowledge base from GitHub, runs a local keyword-matching engine to find the most relevant chunks, feeds them as context to a Qwen 3 model via OpenRouter, and sends the answer back as a reply to the original message.

![GitHub Knowledge Base to Telegram Bot.png](fileId:6175)

HOW IT WORKS

1. Telegram Trigger Listens for messages starting with /ask. Anything shorter than 7 characters is rejected with an error message explaining the correct format.

2. Input Validation If a user sends just /ask without a question, or sends a message shorter than 7 characters, the workflow catches it immediately and replies with a clear instruction: "Please use: /ask <your question>". This prevents unnecessary API calls to GitHub and the LLM, and teaches the user the correct format on the first try.

3. GitHub File Fetch Pulls a JSON file from a GitHub repository using a Personal Access Token. If the file doesn't exist or the token is invalid, the user gets a specific error message instead of a silent failure or a generic n8n error. Same applies when the LLM returns an empty response — the user always gets a message, never silence.