This n8n workflow demonstrates how to create an agent using LangChain and SQLite. The agent can understand natural language queries and interact with a SQLite database to provide accurate answers. 💪 🚀 Setup Run the top part of the workflow once. It downloads the example SQLite database, extracts from a ZIP file and saves locally (chinook.db). 🗣️ Chatting with Your Data Send a message in a chat window. Locally saved SQLite database loads automatically. User's chat input is combined with the binary data. The LangChain Agend node gets both data and begins to work. The AI Agent will process the user's message, perform necessary SQL queries, and generate a response based on the database information. 🗄️ 🌟 Example Queries Try these sample queries to see the AI Agent in action: "Please describe the database" - Get a high-level overview of the database structure, only one or two queries are needed. "What are the revenues by genre?" - Retrieve revenue information grouped by genre, LangChain agent iterates several time before producing the answer. The AI Agent will store the final answer in its memory, allowing for context-aware conversations.
Tags
Related workflows
See all AI Automation→Slack chatbot powered by AI
This workflow offers an effective way to handle a chatbot's functionality, making use of multiple tools for information retrieval, conversation context storage, and message sending. It's a setup tailored for a Slack environment, aiming to offer an interactive, AI-driven chatbot experience. Note that to use this template, you need to be on n8n version 1.19.4 or later.
Handle WhatsApp sales inquiries with OpenAI, Pinecone, Google Calendar, and Slack
Quick overview This workflow handles inbound WhatsApp Business messages with an OpenAI-powered sales agent that uses Pinecone RAG for product answers and Google Calendar tools for scheduling, then either replies on WhatsApp or hands the conversation to Slack, with Slack-based error alerts. How it works Triggers on every inbound WhatsApp Business message and checks whether the payload contains a text body. Drops non-text messages (such as images or voice notes) and continues only with text conversations. Uses an OpenAI chat model with per-customer session memory to generate a concise sales reply and decide whether a human handoff is needed. Lets the agent query a Pinecone-backed product catalog via OpenAI embeddings to answer pricing, specs, and availability questions. Lets the agent check availability and book appointments in Google Calendar when the customer requests scheduling. Parses the agent’s HANDOFF flag and either posts the customer message plus draft reply to a Slack channel or sends the reply back to the customer on WhatsApp. Sends a Slack alert to an ops channel if any step in the workflow fails. Setup Connect WhatsApp Business Cloud credentials and set the WhatsApp Phon
AI agent chat
This workflow employs OpenAI's language models and SerpAPI to create a responsive, intelligent conversational agent. It comes equipped with manual chat triggers and memory buffer capabilities to ensure seamless interactions. To use this template, you need to be on n8n version 1.50.0 or later.