This workflow implements a Telegram bot using n8n that connects users to an AI assistant powered by OpenRouter (LLMs), Zep and Postgres. It processes messages in real time and responds contextually using user-specific memory.


- β Telegram Bot Trigger
- π§ AI Agent powered by LangChain + OpenRouter (e.g., Mistral 7B)
- π₯ User input processed with Zep Graph API
- π§Ύ Fact extraction via Code Node
- π§ Long-term memory using:
- Zep memory vector store
- Postgres memory (optional)
- π€ Responses sent back to the user
- π§ Memory updates stored after each interaction
- n8n (workflow automation)
- Telegram Bot API
- OpenRouter API
- Zep (vector memory & user graph)
- LangChain Nodes for n8n
- Postgres DB (for hybrid memory)
- JavaScript (for fact extraction)
- Clone or import this workflow JSON into your n8n instance.
- Set up the following credentials in n8n:
- Telegram API
- Zep API
- OpenRouter API
- Start the Telegram bot and interact with it via chat.
- Incoming queries are enriched with facts from Zep, processed by LLMs, and memory is updated per session.