Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
An n8n workflow that downloads the Texas Tax Code, stores its sections in Qdrant with Mistral embeddings and adds a chat. An OpenAI agent answers from the closest sections and can fetch a section or chapter by name.
Texas tax code assistant with Qdrant, Mistral and OpenAI is an n8n workflow in the Legal category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Manual start
It starts when you click Test workflow in n8n, and it loads the law. The chat part starts separately when someone writes a message. The load takes:
A Qdrant collection of the code’s sections, and chat answers that name the chapter and section they came from
What you need before you start.
Language model
Runs gpt-5.6-terra for the agent, which decides which tool to call and writes the answer.
NeedsOpenAI API key
Embeddings
Turns each section and each question into a vector with mistral-embed.
NeedsMistral API key
Vector database
Stores the sections with their chapter and section labels, and finds the closest ones to a question or the ones for a given section or chapter.
NeedsA Qdrant server n8n can reach, and its API key if it asks for one
Checked by Mindket on 13 Nov 2026
This n8n workflow builds a chat assistant for the Texas Tax Code. The first part downloads the code from the state’s public statutes site as a zip of 56 chapter PDFs and reads the text. It cuts each chapter into its sections, about 2,000 in all, and stores them in a Qdrant vector store with Mistral embeddings. The second part is a chat with an OpenAI agent that has two tools. One finds the four sections closest to a question. The other fetches a section or a whole chapter by its number or name. Each answer names the chapter and section it came from. Thirty-one nodes do the work, beside seven sticky notes.
Builders who want to see retrieval over a long legal text with the section as the unit, not the raw page. Skip it if you need current law or legal advice. The answers come from a copy loaded on the day you run it.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Legal | Paralegals | Look up the section behind a question about a Texas tax | A paralegal asks who must pay the franchise tax and reads the sections the agent cites. |
| Accounting | Bookkeepers | Find which chapter covers a tax before reading it in full | A bookkeeper asks the agent for every section of one chapter. |
| Software | n8n builders | Reuse the pattern of sections with metadata for another long document | A builder swaps the zip address and the patterns for another code of laws. |
| Education | Students | Ask plain questions of a statute and see where the answer sits | A student reads the cited section beside the chat answer. |
You need a fair amount of n8n: three credentials, a Qdrant server, a long first run and a save before the tools work. The workflow’s own sticky notes give no setup time.
Any n8n that can reach OpenAI, Mistral, your Qdrant server and the state’s statutes site will run it.
http://qdrant:6333 suits a Docker setup with a service named qdrantOpenAI Chat ModelDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Three accounts and a Qdrant server cover every step.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| OpenAI | An API key that can use gpt-5.6-terra |
| Mistral | An API key for embeddings |
| Qdrant | A server n8n can reach, with its API key if it asks for one |
workflow.json.Embeddings Mistral Cloud and Get Mistral Embeddings.Qdrant Vector Store, Use Qdrant Search API1 and Use Qdrant Scroll API. In the two HTTP nodes, change http://qdrant:6333 if your Qdrant is elsewhere.OpenAI Chat Model.texas_tax_codes fill in Qdrant.Click Test workflow once to load the code, then use the chat. Ask in plain words, or ask for a section or chapter by name. The agent calls the question tool for open questions and the lookup tool for a known section or chapter. Memory keeps the last five exchanges of each chat session.
| To change | Where |
|---|---|
| The agent’s rules | The system message in AI Agent |
| The source | Get Tax Code Zip File, with the patterns in Extract From Chapter |
| How many passages a question reads | The limit in Use Qdrant Search API1 |
| The model | OpenAI Chat Model |
| The piece size | The chunk size in Recursive Character Text Splitter |
After the load, you ask who must pay the franchise tax. The agent calls its question tool, which embeds the question with Mistral and asks Qdrant for the four closest sections.
The agent writes an answer from those sections and names the chapter and section number of each. You can then ask for one section in full, and the agent calls its lookup tool with that number.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This file holds two flows in one. The upper one loads the law once. The lower one is what the agent’s tools run. Start with the load and watch Qdrant fill, then try the chat.
For experts. Both tools call the workflow they sit in, and a route field picks the branch.
| Node | What it does | What to know |
|---|---|---|
Extract From Chapter | Cuts each chapter’s text into sections with three regular expressions | They fit this site’s layout, and four sections stay inside the one before |
Content Chunking @ 30k Chars | Cuts long sections into pieces of up to 30,000 characters | It rounds up, so the longest section keeps its end |
Ask Tool and Search Tool | Tool Workflow nodes that call this workflow with a route | Save the workflow first, since they call it by id |
Use Qdrant Scroll API | Filters on a section or a chapter and pages through the matches | The chapter name must match the stored name exactly |
The load is long, the chat is public and the data is a snapshot.
OpenAI Chat Model set no model, so n8n would use gpt-5-mini, which OpenAI shuts down on 11 December 2026. Mindket’s copy calls gpt-5.6-terra, the replacement on OpenAI’s deprecations page, read on 12 November 2026https://tcss.legis.texas.gov/resources/Zips/TX.pdf.zip, read on 12 November 2026An n8n workflow in two parts. The first downloads the Texas Tax Code from the state's public statutes site, cuts it into its
sections and stores each one in a Qdrant vector store, using Mistral embeddings. The second is a chat with an OpenAI agent that
has two tools. One answers a question from the closest sections. The other fetches a section, or a whole chapter, by its number
or name. The agent names the chapter and section it used.
workflow.json: the workflow as n8n exports it, thirty-one nodes and seven sticky notes. It holds no credential.README.md: these notes.https://tcss.legis.texas.gov/resources/Zips/TX.pdf.zip, the address in the site's own download list, read on 12 November 2026.\nSec\.\nA[0-9]{1,4}[A-Z]?\.[0-9]{1,5}[A-Z]?\.AA.Map To Sections took the chapter from the first PDF for every section, so every section carried the same chapter name. It nowContent Chunking @ 30k Chars.OpenAI Chat Model set no model, so n8n used its default for that node version, gpt-5-mini, which OpenAI shuts down on 11gpt-5.6-terra, the replacement on OpenAI's deprecations page, read on 12 November 2026.Search Tool showed a section as Sec 1.01. The stored labels are bare numbers such as 1.001, so the exampleworkflow.json.Embeddings Mistral Cloud and Get Mistral Embeddings.Qdrant Vector Store, Use Qdrant Search API1 and Use Qdrant Scroll API.http://qdrant:6333 if your Qdrant is somewhere else. The collection name texas_tax_codesQdrant Vector Store.OpenAI Chat Model.Get Tax Code Zip File downloads the zip, Extract Zip Files unpacks it and Files as Items makes one item per PDF.Extract PDF Contents reads the text of each one.Extract From Chapter, which also builds the list of labels.Map To Sections pairs each label with its title and text and adds the chapter name. Next, Sections To ListOnly Valid Sections drops the empty ones.For Each Section... takes five sections at a time. Long sections are cut into big pieces by Content Chunking @ 30k CharsSplit Out Chunks.Qdrant Vector Store embeds and stores them. Recursive Character Text Splitter cuts each piece to 2000 characters, andDefault Data Loader adds the metadata chapter, section, title and content_order. Then 1sec waits one second and theWhen chat message received passes each message to AI Agent, with Window Buffer Memory and OpenAI Chat Model. The agent
has two tools, and each one runs the lower part of this workflow through Execute Workflow Trigger and Switch.
Ask Tool (query_tax_code_knowledgebase) sends the question to Get Mistral Embeddings, then to Use Qdrant Search API1,Get Ask Response returns them as a table of chapter, section, title and content.Search Tool (get_tax_code_section) takes a section or a chapter. Use Qdrant Scroll API filters on metadata.sectionmetadata.chapter otherwise, and pages through the matches 100 at a time. Get Search Responsecontent_order and returns them under a short header.AI Agent.Get Tax Code Zip File, together with the patterns in Extract From Chapter, which fit this site's layout only.Use Qdrant Search API1.OpenAI Chat Model.Recursive Character Text Splitter.content_order is the item's position in the batch. Pieces cut from one 30,000-character chunk share a number, soSearch Tool can return them in a different order from the one in the law.TAX CODE CHAPTER 171. FRANCHISE TAX. The agent can only give itNOTICE.md 678 B README.md 7 KB workflow.json 30 KB
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
rizzoaiacademy · Kit
A small CPU-friendly model that finds 22 kinds of personal data in Italian legal text, including codice fiscale and partita IVA, for reversible anonymization.…
perplexity-ai · Kit
Finds personal data in chat conversations and masks it, using a 600M-parameter encoder with a token tagger and a sensitivity score. It suits teams that clean c…
OpenMed · Kit
Finds and masks personal data in text, across 55 fine-grained categories such as names, contact details and IDs. It suits teams that redact text before sharing…