AI Agents

Build an AI Agent with Conversation Memory

13 nodes 324 194 Automatic trigger
Download

Workflow Description

Automation that creates an intelligent agent remembering conversation history for coherent dialogue. Combines OpenAI language models with dynamic memory buffers, enabling the agent to understand context and provide contextually relevant responses across interactions.

How it works

  1. 1.Trigger the agent via Chat Trigger or manual invocation when a message arrives
  2. 2.Store the user's message in the conversation memory buffer for context retention
  3. 3.Send the full conversation history to OpenAI for intelligent processing and response generation
  4. 4.Log the agent's reply back into memory for future reference and continuity
  5. 5.Return the response to the user while maintaining the complete conversation record

Use cases

  • Create customer support chatbots that recall previous interactions and order history
  • Build personal assistants that improve responses by learning from past conversations
  • Develop multi-turn Q&A systems that maintain context across extended dialogues

Requirements

  • Valid OpenAI API key with appropriate permissions
  • Chat channel or webhook endpoint to receive incoming messages
  • Adequate storage capacity for maintaining conversation logs

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Memory OpenAI Read Write File AI Agent Chat Trigger

Details

Trigger Automatic trigger
Nodes 13
Apps 5
Views 324
Downloads 194

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (13)

/

Window Buffer Memory

Memory Buffer Window

#1

OpenAI Chat Model

OpenAI

#2

When clicking "Test workflow"

Manual Trigger

#3

Get chinook.zip example

HTTP Request

#4

Extract zip file

Compression

#5

Save chinook.db locally

Read Write File

#6

Load local chinook.db

Read Write File

#7

Sticky Note

Sticky Note

#8

Sticky Note1

Sticky Note

#9

Combine chat input with the binary

Set

#10

Sticky Note2

Sticky Note

#11

AI Agent

Agent

#12

Chat Trigger

Chat Trigger

#13