Automation library · Chat assistants

Build a chatbot with RAG

Started by an incoming Telegram message, and works across Google Docs and Telegram. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 23 steps: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAIRetrieval

23 stepsLarge: read it before trusting it with anything live
0Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 2Model 17Logic 2Service 2

The steps in the order they run, from what starts it.

  1. 1OpenAI Chat ModelLm Chat Open AiModel
  2. 2Embeddings OpenAIEmbeddings Open AiModel
  3. 3Document ChunkerText Splitter Recursive Character Text SplitterModel
  4. 4OpenAI Embeddings GeneratorEmbeddings Open AiModel
  5. 5When clicking "Execute Workflow"Manual triggerStarts it
  6. 6MongoDB Chat MemoryMemory Mongo Db ChatModel
  7. 7Embeddings OpenAI1Embeddings Open AiModel
  8. 8Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  9. 9Embeddings OpenAI3Embeddings Open AiModel
  10. 10Receive Message on TelegramTelegram triggerStarts it
  11. 11OpenAI Embeddings Generator1Embeddings Open AiModel
  12. 12Knowledge Base AgentAgentModel
  13. 13Search DocumentationVector Store Mongo DBAtlasModel
  14. 14Document Section LoaderDocument Default Data LoaderModel
  15. 15MongoDB Documentation InserterVector Store Mongo DBAtlasModel
  16. 16Google Docs ImporterGoogle DocsService
  17. 17Search Positive InteractionsVector Store Mongo DBAtlasModel
  18. 18Default Data LoaderDocument Default Data LoaderModel
  19. 19Search Negative InteractionsVector Store Mongo DBAtlasModel
  20. 20Submit embedded chat feedbackVector Store Mongo DBAtlasModel
  21. 21Send Message on Telegram, Wait for FeedbackTelegramService
  22. 22Map feedback dataCodeLogic
  23. 23Set feedback fields for collection storageSetLogic

How it's built

Starts on
An incoming Telegram message
Steps
23
Size
Large: read it before trusting it with anything live
Connects to
Google Docs, Telegram
Model
OpenAI
Retrieval
Answers are drawn from documents you supply, not from the model alone

Questions

What does it need to run?

An n8n account, plus your own Google Docs and Telegram accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 23 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 23 steps before you point it at anything that matters.