AI Agent with Long-Term Memory and Note Storage
detail.loadingPreview
An AI agent that leverages Langchain to manage chat interactions, store long-term memories, and organize notes using Google Docs, with optional Telegram notifications.
About This Workflow
This n8n workflow sets up an intelligent AI agent capable of maintaining context through long-term memory and structured note-taking. It utilizes Langchain for conversational AI and integrates with Google Docs for persistent storage of memories and notes. The agent responds to chat messages, processes information, and can optionally send notifications via Telegram.
Key Features
- Chat Trigger: Initiates the workflow upon receiving a chat message.
- Long-Term Memory Management: Stores and retrieves user-specific information in Google Docs for a personalized experience.
- Note Storage: Organizes specific instructions and reminders in Google Docs.
- AI Agent: Processes user input, decides on actions (saving memory/notes), and generates responses.
- Language Models: Supports multiple LLMs like GPT-4o-mini and DeepSeek-V3 Chat for advanced processing.
- Contextual Memory: Uses
memoryBufferWindowto maintain short-term conversational context. - Google Docs Integration: Leverages
googleDocsToolandgoogleDocsnodes for persistent data storage and retrieval. - Optional Telegram Notifications: Sends responses or alerts to a Telegram chat.
How To Use
- Configure Trigger: Set up the
When chat message receivednode with your desired chat platform integration. - Set Google Docs IDs: Replace
[Google Doc ID]inRetrieve Long Term Memories,Save Long Term Memories,Retrieve Notes, andSave Notesnodes with your actual Google Doc IDs for memory and note storage. - Configure LLMs: Ensure
gpt-4o-miniandDeepSeek-V3 Chatnodes are set up with valid credentials and desired model configurations. - Configure Memory: Set up the
Window Buffer Memorynode, ensuringsessionKeycorrectly references the incoming session ID. - Configure Tools: The
AI Tools Agentnode is crucial. Review itssystemMessageto customize the AI's behavior, rules, and available tools (Save Memory,Save Note). Ensure the references to retrieved memories ({{ $json.data[0].content }}) and notes ({{ $json.data[1].content }}) are correctly mapped from the preceding retrieval nodes. - Configure Output: The
Chat Responsenode prepares the final output. TheTelegram Responsenode is optional for sending messages to a Telegram chat. - Activate Workflow: Enable the workflow to start processing chat messages.
Apps Used
Workflow JSON
{
"id": "fc269009-2ed7-4178-9ce0-95d9c42d0809",
"name": "AI Agent with Long-Term Memory and Note Storage",
"nodes": 25,
"category": "AI",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: fc269009-2ed7...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Workflows
Discover more workflows you might like
Build an AI Documentation Expert Chatbot with Gemini RAG
This n8n workflow automates the creation of an AI-powered expert chatbot capable of answering questions based on your documentation. It intelligently ingests, cleans, and processes your knowledge base, preparing it for a Retrieval Augmented Generation (RAG) pipeline with Google Gemini.
Generate Multilingual Image Captions and Overlay
This workflow generates captions for images using Google Gemini and overlays them onto the image, with support for multilingual output.
LangChain Workflow Retriever Example
Demonstrates using LangChain's Retriever QA Chain to query data retrieved from another workflow.