This workflow sets up a conversational AI agent in n8n that can respond to user messages intelligently while leveraging external tools for enhanced knowledge and context. It integrates OpenAI’s GPT model with memory and external APIs (SerpAPI & Wikipedia) to provide accurate, contextual, and real-time responses.
The agent maintains recent conversation history, allowing it to generate context-aware replies and utilize external knowledge sources when necessary.
Key Features
- Conversational Trigger – Starts when a chat message is received.
- OpenAI Chat Model (GPT-4o-mini) – Powers natural language understanding and response generation.
- Buffer Memory – Stores the last 20 messages for contextual, flowing conversations.
- External Knowledge Tools:
- SerpAPI – Retrieves real-time web search results.
- Wikipedia Tool – Fetches factual information from Wikipedia.
- Agent Orchestration – Automatically decides when to use tools or memory for the best possible response.