AI Agents
Build an intelligent agent that learns from conversations and executes tasks
8 nodes
338
196
Automatic trigger
Workflow Description
An automation that creates a smart agent receiving user commands via chat trigger, retaining context with sliding-window memory, using OpenAI to understand intent, executing designated tools through the agent, and storing results in MongoDB for continuous learning and task tracking.
How it works
- 1.Receive user message through chat trigger endpoint
- 2.Store conversation context in sliding-window memory for continuity
- 3.Send interaction to OpenAI model for intent analysis and reasoning
- 4.Identify and execute the appropriate tool via the AI agent
- 5.Persist task outcome and response in MongoDB database
Use cases
- Customer support agent that learns from historical interaction patterns
- Project assistant receiving voice commands and creating automated tasks
- Interactive data analyst answering complex questions with full context
Requirements
- Valid OpenAI API key with sufficient usage quota
- MongoDB database with read and write permissions configured
- Chat trigger enabled and properly authenticated in n8n instance
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
OpenAI
MongoDB
Memory
Chat Trigger
Tool
AI Agent
Details
Trigger
Automatic trigger
Nodes
8
Apps
6
Views
338
Downloads
196
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (8)
OpenAI Chat Model
OpenAI
MongoDBAggregate
Mongo Db Tool
Window Buffer Memory
Memory Buffer Window
When chat message received
Chat Trigger
insertFavorite
Tool Workflow
AI Agent - Movie Recommendation
Agent
Sticky Note
Sticky Note
Sticky Note1
Sticky Note