AI Chatbot Agent: Long-Term Memory, Notes & Telegram Integration
Integrates with:
Overview
Unlock Personalized & Context-Aware Conversations with this AI Agent
This workflow deploys a sophisticated AI chatbot agent designed to remember past interactions and manage specific notes, providing a highly personalized and context-aware conversational experience. It connects to Telegram for user interaction and leverages Google Docs as a persistent long-term memory and note storage, making it an invaluable tool for solopreneurs, founders, and teams looking to automate information recall and provide intelligent assistance.
The agent utilizes powerful Large Language Models (LLMs) like OpenAI's GPT-4o-mini and can be configured to use others like DeepSeek via an OpenAI-compatible API. It intelligently decides when to save memories or notes, and uses this stored information to inform its responses, making interactions more relevant and efficient over time.
Key Features & Benefits
- AI-Driven Automation: Employs advanced LLMs (e.g., OpenAI GPT-4o-mini, DeepSeek) for natural and intelligent dialogue through a Langchain agent setup.
- Persistent Long-Term Memory: Automatically saves and retrieves key information from past conversations using Google Docs, enabling the agent to 'remember' users and context across sessions.
- Structured Note-Taking: Allows users to instruct the agent to save specific pieces of information as notes, also stored in Google Docs for easy access and organization.
- Seamless Telegram Integration: Interact with your AI agent directly through Telegram, a popular and accessible messaging platform.
- Context-Aware Responses: Delivers more relevant and personalized answers by tapping into its knowledge base of past memories and notes.
- Customizable Agent Behavior: Fine-tune the agent's personality, operational rules, and how it uses its memory and note-taking tools via a detailed system prompt in the Langchain Agent node.
- Efficient Session Management: Includes window buffer memory to keep track of recent conversation history for immediate context.
Use Cases
- Building a personalized AI assistant for solopreneurs to manage tasks and recall information.
- Creating a customer support chatbot that remembers user history for faster resolution.
- Automating information capture from conversations for knowledge base building in Google Docs.
- Developing a research assistant that logs findings and summaries directly from chats.
- Enhancing team collaboration by having an AI agent manage shared notes and memories.
Prerequisites
- OpenAI API Key (e.g., for gpt-4o-mini).
- (Optional) DeepSeek API Key if you wish to use the DeepSeek model (configured as an OpenAI-compatible credential).
- Google Cloud Project with Google Docs API enabled and OAuth2 credentials configured.
- A Telegram Bot Token and the target Chat ID for receiving agent responses.
- Ensure Langchain related nodes are available and correctly configured.
Setup Instructions
- Download the workflow JSON file.
- Import the workflow into your workflow automation platform.
- Configure the 'When chat message received' (Langchain Chat Trigger) node. This often creates a webhook URL you'll use to send messages to the agent.
- Set up Google Docs: Create two separate Google Docs – one for 'Long Term Memories' and one for 'Notes'.
- Configure Google Docs Nodes: In your workflow automation platform, add your Google Docs OAuth2 credentials. Then, in the workflow, update the following nodes: 'Retrieve Long Term Memories', 'Save Long Term Memories', 'Retrieve Notes', and 'Save Notes'. In each of these, replace the placeholder
[Google Doc ID]
in the 'Document URL' field with the respective URL or ID of the Google Docs you created in step 4. - Configure LLM Credentials:
- OpenAI: Select your OpenAI API Key credential in the 'gpt-4o-mini' node.
- DeepSeek (Optional): If using DeepSeek, ensure you have a credential configured for it (often using the OpenAI node type with DeepSeek's base URL and API key). Select this credential in the 'DeepSeek-V3 Chat' node. You may need to switch the LLM connection in the 'AI Tools Agent' node if you change the primary model.
- Configure Telegram: Select your Telegram Bot API credential in the 'Telegram Response' node and update the 'Chat ID' field with the specific chat you want the agent to respond to.
- Customize Agent Persona: Open the 'AI Tools Agent' node. Carefully review and tailor the 'System Message' in the 'Options' tab. This prompt is crucial for defining your agent's behavior, personality, memory handling, and note-taking rules.
- Memory Configuration: Adjust settings in the 'Window Buffer Memory' node (e.g.,
contextWindowLength
) as per your conversational needs. - Test the workflow thoroughly by sending messages to the chat trigger endpoint and observing responses in Telegram and data storage in Google Docs.
- Activate the workflow when ready.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation