Automation library · Chat assistants

Create an AI knowledge base assistant with Ollama and PGVector

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

LargeCalls a model: a local modelRetrieval

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

The flow

Starts it 2Model 8Logic 4Service 8

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

  1. 1On form submissionForm triggerStarts it
  2. 2Embeddings OllamaEmbeddings OllamaModel
  3. 3Default Data LoaderDocument Default Data LoaderModel
  4. 4Ollama Chat ModelLm Chat OllamaModel
  5. 5Embeddings Ollama1Embeddings OllamaModel
  6. 6Telegram TriggerTelegram triggerStarts it
  7. 7IfIfLogic
  8. 8Postgres PGVector StoreVector Store PGVectorModel
  9. 9Question and Answer ChainChain Retrieval QaModel
  10. 10Postgres PGVector Store1Vector Store PGVectorModel
  11. 11Form1FormService
  12. 12FormFormService
  13. 13No Operation, do nothingNo OpLogic
  14. 14Send a text messageTelegramService
  15. 15Vector Store RetrieverRetriever Vector StoreModel
  16. 16SwitchSwitchLogic
  17. 17No Operation, do nothing1No OpLogic
  18. 18Extract from FileExtract From FileService
  19. 19Extract from File1Extract From FileService
  20. 20Extract from File2Extract From FileService
  21. 21Extract from File5Extract From FileService
  22. 22Extract from File4Extract From FileService

How it's built

Starts on
An incoming Telegram message
Steps
22, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Telegram
Model
a local model
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 Telegram account, and a key for a local model. 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 a local model. 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 22 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 22 steps before you point it at anything that matters.