🧠 Give Your AI Agent Chatbot Long Term Memory Tools Router
Configured with Agent, Chain LLM, Chat Trigger, Execute Workflow Trigger, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Files / media
- Transform
- Messaging
- AI & models
- Subworkflow
- Data store
- Routing
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When Executed by Another Workflow | Trigger | Execute Workflow Trigger | See node parameters |
| Save Long Term Memories | Files / media | Google Docs | update |
| Saved response | Transform | Edit Fields | See node parameters |
| Respond with long term memories | Transform | Edit Fields | See node parameters |
| Retrieve Long Term Memories3 | Files / media | Google Docs | get |
| Send Success Message to Telegram | Messaging | Telegram | See node parameters |
| Email Workflow Stats | Messaging | Gmail | See node parameters |
| OpenAI Chat Model2 | AI & models | OpenAI Chat Model | See node parameters |
| OpenAI Chat Model3 | AI & models | OpenAI Chat Model | See node parameters |
| 📤Send Memories to Telegram | Subworkflow | Tool Workflow | See node parameters |
| 📫Send Memories to Gmail | Subworkflow | Tool Workflow | See node parameters |
| 🧠Save Memories | Subworkflow | Tool Workflow | See node parameters |
| 🔎Retrieve Memories | Subworkflow | Tool Workflow | See node parameters |
| 🤯Window Buffer Memory | Data store | Memory Buffer Window | See node parameters |
| 🧠 AI Agent w/Long Term Memory | AI & models | Agent | See node parameters |
| 🤖OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Ⓜ️ When chat message received | Trigger | Chat Trigger | See node parameters |
| Prepare Telegram Message | AI & models | Chain LLM | See node parameters |
| Prepare Gmail Message | AI & models | Chain LLM | See node parameters |
| Retrieve Long Term Memories | Files / media | Google Docs | get |
| Memory Tool Router | Routing | Switch | See node parameters |
| Retrieve Long Term Memories2 | Files / media | Google Docs | get |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
gmailOAuth2googleDocsOAuth2ApiopenAiApitelegramApi
Workflow notes
Enhance Your AI Workflow with Long-Term Memory and Dynamic Tool Routing
Enhance Your AI Workflow with Long-Term Memory and Dynamic Tool Routing
This n8n workflow empowers your AI agent with long-term memory and a dynamic tools router, enabling it to provide intelligent, context-aware responses while seamlessly managing tasks across multiple tools. By combining memory persistence and modular tool routing, this solution enhances the capabilities of your AI agent, making it smarter, more efficient, and highly adaptable.
🚀 How It Works
🧠 Long-Term Memory Management
- The AI agent can save and retrieve memories using Google Docs as a storage system.
- Persistent memory allows the agent to recall past interactions, user preferences, and contextual details for personalized responses.
🛠️ Tools Router for Dynamic Task Management
- A tools router directs tasks to the appropriate tools based on the AI agent's instructions.
- Supported tools include:
- Save Memories: Store important data for future reference.
- Retrieve Memories: Access stored information when needed.
- Send Notifications via Gmail or Telegram: Share insights or updates with stakeholders.
🤖 AI-Powered Contextual Understanding
- The workflow integrates an OpenAI GPT-based model to process user inputs intelligently.
- The AI agent uses a window buffer memory for short-term context and leverages long-term memory when necessary.
📤 Multi-Channel Notifications
- Automatically send memory summaries or workflow updates via Gmail or Telegram for enhanced communication.
🔧 Setup Steps
🔑 Configure API Credentials
Set up API connections for:
- OpenAI (for AI processing).
- Google Docs (for long-term memory storage).
- Gmail/Telegram (for notifications).
⚙️ Customize Workflow Parameters
- Adjust the AI agent's system message to align with your specific use case or tone.
- Define routing rules in the tools router to suit your workflow needs.
🧪 Test & Deploy
- Test the workflow by interacting with the AI agent and verifying:
- Accurate memory saving/retrieval.
- Correct task routing via the tools router.
- Seamless notification delivery.
🧠 Give Your AI Agent Chatbot Long Term Memory Tools Router
🧠 Give Your AI Agent Chatbot Long Term Memory Tools Router
Purpose and structure
This folder contains the 🧠 Give Your AI Agent Chatbot Long Term Memory Tools Router workflow. Its executable nodes use agent, chainLlm, chatTrigger, executeWorkflowTrigger, gmail, googleDocs, lmChatOpenAi, memoryBufferWindow, set, switch, telegram, toolWorkflow. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When Executed by Another Workflow, Ⓜ️ When chat message received
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1950_Telegram_Googledocs_Automate_Triggered.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- 1️⃣ Save Memories
- 3️⃣ Send Memories to Telegram
- 4️⃣ Send Memories to Gmail
- 2️⃣ Retrieve Memories
- Short Term Chat Memory
- Cloud LLM
- 🧠 AI Agent Chatbot With Long Term Memory Tools
- 🛠️ Agentic Long Term Memory Management Tool Options
- 👍Try Me!
- 1️⃣ Save Long Term Memories Tool
- 2️⃣ Retrieve Long Term Memories Tool
- 3️⃣ Send Memories to Telegram Tool
- 4️⃣ Send Memories to Gmail Tool
- Memory Tool Router
- Receive Memory Tool Instructions from Agent
- 🛠️ Long Term Memory Tool Kit