Conversational AI Research Agent with n8n, OpenAI, Wikipedia & SerpAPI
Integrates with:
Overview
Unlock Dynamic Q&A and Research with this AI Agent
This n8n workflow deploys a sophisticated AI Agent designed for interactive research and Q&A. It's powered by OpenAI's gpt-4o-mini
for intelligent conversation and uses built-in tools to access Wikipedia for factual lookups and SerpAPI for real-time web searches. The agent remembers the context of your conversation (the last 20 messages) thanks to its window buffer memory, allowing for natural, follow-up questions. Start a chat manually within n8n, and the agent will use its tools to find and synthesize the information you need, streamlining your research process.
Key Features & Benefits
- Intelligent Conversationalist: Leverages OpenAI's
gpt-4o-mini
to understand queries and provide human-like, relevant responses. - Knowledge at its Fingertips: Utilizes Wikipedia for quick access to encyclopedic information and SerpAPI for broader, current web search results.
- Context-Aware Dialogue: Maintains a memory of the last 20 messages, ensuring coherent and meaningful ongoing conversations.
- Interactive Q&A: Engage directly with the agent through n8n's manual chat trigger for on-demand information retrieval.
- Efficient Research Automation: Dramatically reduces manual effort by automatically gathering and processing information from multiple sources.
- Adaptable & Expandable: Easily configure the AI model, memory settings, and integrate additional tools to tailor the agent to your specific needs.
Use Cases
- **B2C E-commerce:** Quickly answer customer queries about product specifications or company policies by sourcing information from public web data or internal wikis (if adapted).
- **B2B SaaS:** Assist sales and support teams by providing instant research on potential leads, market trends, or competitor information directly within their workflow.
- **Content Creation:** Help marketing teams brainstorm ideas, gather facts, and draft initial content by conversing with the agent and leveraging its research capabilities.
- **Internal Knowledge Base Q&A:** (With adaptation) Connect to internal documentation to provide employees with quick answers to their questions.
- **Solopreneurs & Founders:** Accelerate market research, competitor analysis, and idea validation by directly querying the AI agent.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key with access to
gpt-4o-mini
or a similar model. - SerpAPI API Key (optional, if web search beyond Wikipedia is desired).
- Ensure the n8n Langchain node collection (
@n8n/n8n-nodes-langchain
) is installed or available in your n8n instance.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Configure the 'Chat OpenAI' node: Select your OpenAI credential from the dropdown. You can adjust the model (
gpt-4o-mini
is default) and other parameters like temperature in the 'Options' section. - Configure the 'SerpAPI' tool node: If you have a SerpAPI API key, select or create a SerpAPI credential in the node. If not, the agent will rely on Wikipedia and its internal knowledge for responses.
- Review the 'Window Buffer Memory' node: The
Context Window Length
is set to 20 by default, meaning the agent will remember the last 20 messages. Adjust if needed. - (Optional) Add or modify tools: Connect other Langchain tools to the 'AI Agent' node to expand its capabilities (e.g., custom tools for your specific APIs or databases).
- Activate the workflow.
- To start a conversation, manually execute the 'On new manual Chat Message' node. n8n will open a dialog where you can type your message. This message is then passed as input to the 'AI Agent' node for processing.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation