Build a tax code assistant with Qdrant, Mistral.ai and OpenAI
Needs changesWhat this workflow does
This AI workflow has 31 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects Embeddings Mistral Cloud, Qdrant Vector Store and OpenAI Chat Model. It also calls statutes.capitol.texas.gov and api.mistral.ai over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).
- Get Tax Code Zip File (HTTP Request): calls statutes.capitol.texas.gov
- AI Agent: runs an AI agent, with model: OpenAI Chat Model; 2 tools (Ask Tool, Search Tool); memory: Window Buffer Memory
- Switch: routes items into 2 branches
- Extract Zip Files (Compression): uses Compression
- Get Mistral Embeddings (HTTP Request): calls api.mistral.ai (POST)
- Use Qdrant Scroll API (HTTP Request): calls an HTTP API (POST)
- Files as Items (Split Out): splits a list into separate items
- Use Qdrant Search API (HTTP Request): calls an HTTP API (POST)
- Get Search Response (Edit Fields (Set)): sets 1 field: response
- Extract PDF Contents (Extract from File): extracts data from a file (pdf)
…plus 10 more steps. See the full node list below.
Services it uses
HTTP calls to: statutes.capitol.texas.gov, api.mistral.ai
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (20)
- Manual Trigger
n8n-nodes-base.manualTrigger - Embeddings Mistral Cloud
@n8n/n8n-nodes-langchain.embeddingsMistralCloud - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - HTTP Request
n8n-nodes-base.httpRequest - Compression
n8n-nodes-base.compression - Split Out
n8n-nodes-base.splitOut - Extract from File
n8n-nodes-base.extractFromFile - Edit Fields (Set)
n8n-nodes-base.set - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Filter
n8n-nodes-base.filter - Qdrant Vector Store
@n8n/n8n-nodes-langchain.vectorStoreQdrant - AI Agent
@n8n/n8n-nodes-langchain.agent - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Wait
n8n-nodes-base.wait - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Switch
n8n-nodes-base.switch
From the author
This n8n workflows builds another example of creating a knowledgebase assistant but demonstrates how a more deliberate and targeted approach to ingesting the data can produce much better results for your chatbot. In this example, a government tax code policy…