anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
An n8n chat in Portuguese for comparing company health insurance plans. An AI agent remembers each visitor in Postgres, finds the three cheapest plans in a MySQL table and can call two web APIs. A starter you fill with your own data.
Health plan quote chatbot with Postgres memory and tools is an n8n workflow in the Business 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.
Chat message
It starts when a visitor sends a message in the chat, which a front end of your own can extend with:
A chat reply with the cheapest plans a tool found, or a note that nothing matched
What you need before you start.
Language model
Runs gpt-5.6-terra for the profile step and for the quote agent.
NeedsOpenAI API key
Database
Keeps the chat memory in a table named aimessages, one thread per session.
NeedsA Postgres database
Database
Holds the Products table that the quote agent searches for plans.
NeedsA MySQL database and a user that can only read
Checked by Mindket on 13 Nov 2026
This n8n workflow is a chat that helps visitors compare health insurance plans for companies, in Portuguese. A public chat takes the visitor’s message. If a front end sent the visitor’s profile, an agent saves it to memory first. A quote agent then answers, with the last thirty interactions from a Postgres table. It can search a MySQL table for the three cheapest plans by city, number of lives and the holder’s age, and it can call two web APIs. Thirteen nodes do the work, beside one sticky note.
Insurance brokers and benefits platforms that already hold a table of plans and prices and want a chat on top of it. Skip it if you have no such table or API. This is a starter, and the tables, the two APIs and the agent’s instructions are yours to supply.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Insurance | Brokers | Let a visitor describe a company and get the cheapest matching plans | A broker’s site shows three plans for a twelve-life company, cheapest first. |
| Benefits | Platform teams | Answer plan questions from an operator information service | A platform’s chat looks up an operator’s details when a visitor asks. |
| Human resources | HR consultancies | Give clients a first look at group plan prices | A consultancy lets a client try ages and group sizes before a call. |
| Agencies | Builders of chatbots | Start a client project from a chat that already has memory and tools | An agency swaps in the client’s table and the two APIs. |
You need solid n8n and a database for this one: three kinds of credential, a MySQL table with a set of columns and two APIs of your own. The workflow’s own sticky note gives no setup time.
Any n8n that can reach OpenAI, a Postgres database and a MySQL database will run it. The chat opens inside n8n until you publish it and share the chat address.
leadData profile and a session_id to the chat’s webhook from your front endDownload saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Three accounts and two web addresses 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 |
| Postgres | A database for the chat memory, where aimessages is created if missing |
| MySQL | A Products table with the columns the query uses, and a user that can only read it |
| Web APIs | An address for each of the two tools, or a decision to delete them |
workflow.json.Profile Chat Model and Assistant Chat Model.Postgres Chat Memory and Postgres Chat Memory1.Products in Database.Knowledge Base, replace <YOUR_QUOTE_API_HOST> with your quote service. In External API, replace <YOUR_LOOKUP_API_HOST> with your lookup service. With neither, delete the tool and its line in the system message.Save Lead Profile and Quote Assistant and rewrite them.A visitor writes in the chat. The agent asks for what a tool needs, such as the city and the holder’s age, then searches the table and lists what it finds. From your own front end, a first message can also carry leadData, a profile the agent saves to memory.
| To change | Where |
|---|---|
| How the agent talks and what it must do | The system message in Quote Assistant |
| The profile sentence | The text in Edit Fields1 |
| The query and its modality | Products in Database |
| The greeting | The initial message in Chat Trigger |
| The tools’ addresses and descriptions | Knowledge Base and External API |
| The models | Profile Chat Model and Assistant Chat Model |
A visitor writes that a company of twelve people in São Paulo needs a plan and that the holder is 35. The agent calls the table tool with the city, the state, twelve lives and the age.
The tool returns up to three plans, cheapest for that age first. The agent lists them in Portuguese with their prices. If the table has no match, it says so and does not invent a plan.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here an agent is a node that decides which tool to call. Test with the Chat button, watch which tool the agent picks in the run, and compare its answer with your table.
For experts. Two agents share one memory table, and the tools are plain nodes.
| Node | What it does | What to know |
|---|---|---|
If | Checks that the message carries a leadData object | The second condition compares two empty values and always passes |
Postgres Chat Memory | Memory for Quote Assistant, window of thirty | Its key is session_id followed by sessionId, so send one of the two |
Products in Database | A MySQL tool that runs a query with values the model fills in | The values are written into the SQL text, so use a read-only user |
External API | An HTTP Request tool that sends a POST with a JSON body | It fills {name} and {birthdate}, the single-brace placeholders |
The Assistants steps were rebuilt, and the system messages are ours.
gpt-5.6-terra. The author’s instructions were not in the file, so the two system messages are Mindket’s drafts to rewriteleadData and no session_id. The profile step needs a front end of your ownEdit Fields2 leaves out sessionId, so a front end that sends both ids would start a new memory on the next messageExternal API sends a name and a birth date to your service. Check your duties, for example under Brazil’s LGPDPME and the state in Knowledge Base to SPAn n8n chat in Portuguese for comparing health insurance plans for companies. An AI agent remembers each visitor in a
Postgres table. It can search a MySQL table of plans for the three cheapest matches by city, number of lives and the holder's
age, and it can call two web APIs. It is a starter: the tables and the two APIs are yours to supply, and the two system
messages are short drafts to rewrite.
workflow.json: the workflow as n8n exports it, thirteen nodes and one sticky note. It holds no credential.README.md: these notes.Save Lead Profile and Quote Assistant, each with a model node on gpt-5.6-terra:Profile Chat Model and Assistant Chat Model.Products in Daatabase is now Products in Database, and its description was written for it.Knowledge Base was filler text. It now says what the tool looks up. Its address pointed at thehttps://<YOUR_QUOTE_API_HOST>/widget/info.External API called a private host. It is now https://<YOUR_LOOKUP_API_HOST>/findByNameAndBirthDate. Its body wrote{{json.name}}, which n8n reads as an expression and cannot resolve. It now uses {name} and {birthdate}, the single-bracegpt-5.6-terra.aimessages is created on first use when it does not exist.Products, and a user that can only read it. The query uses these columns: cityQuery,state, modality, removed, minLifeAmount, maxLifeAmount, createdAt and ten price columns from priceAtAge0To18 topriceAtAge59To199.workflow.json.Profile Chat Model and Assistant Chat Model.Postgres Chat Memory and Postgres Chat Memory1.Products in Database.Knowledge Base, replace <YOUR_QUOTE_API_HOST> with your quote service. In External API, replace<YOUR_LOOKUP_API_HOST> with your lookup service. If you have neither, delete the tool and its line in the system message ofQuote Assistant.Save Lead Profile and Quote Assistant and rewrite them.Chat Trigger takes a visitor's message. It is public, and it opens with a Portuguese greeting.If checks whether the message carries a leadData object. Without one, the message goes straight to Quote Assistant.Edit Fields1 turns the profile into a sentence: name, age, city, state, profession, education, entity, device,Save Lead Profile stores it in memory and confirms in one line.Edit Fields2 puts the visitor's own message and session_id back, and passes them to Quote Assistant.Quote Assistant answers with Postgres Chat Memory, which keeps the last thirty interactions. It can callProducts in Database, Knowledge Base and External API.Products in Database returns the three cheapest plans in the modality PME for the city, state, number of lives and theQuote Assistant.Edit Fields1.Products in Database, including the modality and the number of results.Chat Trigger.Knowledge Base and External API.Profile Chat Model and Assistant Chat Model.leadData and no session_id, so theQuote Assistant. A front end can post both fields at the top level of itssession_id and the chat's own sessionId. Edit Fields2 leaves sessionId out, so a front end thatProducts in Database writes values the model fills in straight into its SQL text. Give it a user that can only read theExternal API sends a name and a birth date to your lookup service. Check what your privacy duties allow, for examplePME, and the state in Knowledge Base is fixedSP. Change them for yours.NOTICE.md 642 B README.md 7 KB workflow.json 13 KB
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
perplexity-ai · Kit
Picks the best option for a decision from text and images, such as which team should handle a request, with a probability for each choice, for developers who b…
numind · Kit
Reads documents as text or images and fills a JSON template with the fields you ask for, or converts the pages to Markdown. A 4B model for teams that process s…
nace-ai · Kit
Scores yes or no, multiple choice and rating questions about a document in one pass, with a probability for every option. An 8B decision model from Nace.AI tha…