{"slug": "building-minyut-an-embeddable-rag-chatbot-in-one-script-tag", "title": "Building Minyut: An Embeddable RAG Chatbot in One Script Tag", "summary": "Minyut is an embeddable RAG chatbot that can be integrated via a single script tag, built to prevent AI hallucinations by constraining answers to uploaded content. The chatbot processes queries for websites built on Webflow, WordPress, Shopify, React, and plain HTML, using Supabase for storage and HuggingFace for embeddings. Minyut employs Shadow DOM for cross-site compatibility and offers fixed monthly pricing to avoid billing uncertainty.", "body_md": "A client needed their customers to be able to query a 40-page policy document without reading through it.\n\nWe built the first version of what became **Minyut** in a weekend.\n\nIt used a basic embedding approach, answered from an OpenAI endpoint, and—in testing—confidently responded to questions that had no answer in the document at all.\n\nIt made things up.\n\nFluently.\n\nCompletely wrong.\n\nThat was the founding problem.\n\nEvery document chatbot we tested made things up. Not because the models were bad, but because they weren't constrained to answer only from the documents.\n\nMinyut is built around a single architectural decision:\n\nEvery answer must come from uploaded content—or the chatbot says, \"I don't know.\"\n\nEverything else follows from that constraint.\n\nToday, Minyut processes queries for chatbots embedded on Webflow sites, WordPress installs, Shopify stores, React apps, and plain HTML pages.\n\nDocuments are stored in Supabase's Mumbai region, and the widget can be embedded with a single script tag in under ten minutes.\n\nHere's how it's built.\n\nStandard AI chatbots answer from their training data.\n\nFor general knowledge, that's exactly what you want.\n\nFor support chatbots, legal documents, policy manuals, product specifications, and consultancy websites, accuracy becomes a liability issue rather than a convenience feature.\n\nA chatbot that invents policy details isn't a support tool.\n\nIt's a liability.\n\nThe solution is **Retrieval-Augmented Generation (RAG)**.\n\nAt query time:\n\nIf the answer isn't present in the uploaded documents, the chatbot says so.\n\nThe language model can only answer as well as the passages you retrieve.\n\nGood retrieval is most of the battle.\n\nDocuments arrive as:\n\nFile limits:\n\nAfter extraction, documents are chunked.\n\nEach sentence became its own chunk.\n\nRetrieval was precise but context disappeared.\n\nExample:\n\n**Question:** What is the refund window?\n\nRetrieved:\n\nRefunds are processed in 7 days.\n\nTechnically correct.\n\nPractically useless.\n\nContext improved.\n\nRetrieval consistency did not.\n\nShort and long paragraphs behaved very differently during similarity search.\n\nCurrent strategy:\n\nThe overlap ensures sentences crossing chunk boundaries remain complete in at least one retrieved section.\n\nFor Minyut's document types, answer quality improved significantly.\n\nEach chunk is embedded using:\n\n`sentence-transformers/all-MiniLM-L6-v2`\n\nvia the HuggingFace Inference API.\n\nThe model generates:\n\nVectors are stored in:\n\ninside Supabase.\n\nThe hard problem wasn't loading a script.\n\nIt was ensuring the widget worked everywhere.\n\nDifferent host websites bring:\n\nOur first approach used scoped CSS.\n\nIt failed repeatedly.\n\nExamples:\n\nThe solution was Shadow DOM.\n\nThe widget creates a completely isolated DOM tree.\n\nHost styles cannot leak in.\n\nWidget styles cannot leak out.\n\n``` js\nconst host = document.createElement('div');\ndocument.body.appendChild(host);\n\nconst shadow = host.attachShadow({\n  mode: 'open'\n});\n```\n\nEverything lives inside the shadow root.\n\nStyle conflicts effectively disappear.\n\nThe widget is delivered as a single async script:\n\n```\n<script async src=\"https://minyut.com/widget.js\"></script>\n```\n\nAdvanced users can control behavior through:\n\n```\nwindow.__minyut__\n```\n\nincluding:\n\nMinyut's stack is intentionally simple.\n\nHandles:\n\nHosts:\n\nHandles subscription billing.\n\nProvides embedding generation.\n\nHandles language model inference.\n\nDocuments are stored in:\n\nBring Your Own Key support allows users to connect:\n\nKeys are encrypted using AES-256.\n\nWe never need to operate GPU infrastructure ourselves.\n\nAt Minyut's current scale, that's exactly the tradeoff we want.\n\nThe most common complaint about chatbot SaaS products isn't quality.\n\nIt's billing uncertainty.\n\nUsage-based pricing creates anxiety.\n\nA traffic spike should not become a surprise invoice.\n\nMinyut uses fixed monthly plans.\n\nUsers receive notifications at:\n\nNothing fails silently.\n\nUnlimited queries through the user's own OpenAI or Groq key.\n\nWe handle:\n\nUsers pay model providers directly.\n\nWe spent weeks comparing language models.\n\nThe bigger factor was chunk size and overlap.\n\nFix retrieval before optimizing inference.\n\nScoped CSS eventually breaks.\n\nShadow DOM doesn't.\n\nOnce we switched, CSS-related issues effectively disappeared.\n\nThe users who want BYOK are often the most engaged.\n\nThey build real systems.\n\nSupporting them from the start avoids painful architectural changes later.\n\nMinyut started as an attempt to solve a simple problem:\n\nHow do you build a chatbot that answers only from documents and refuses to invent information?\n\nThe answer ended up being a combination of:\n\nThe result is a chatbot that can be embedded on almost any website using a single script tag and answer only from uploaded content.\n\nThat's exactly what we set out to build.\n\nNo.\n\nMinyut is designed specifically for document-grounded responses.\n\nIf the information isn't present in uploaded content, the chatbot says it doesn't know.\n\nThe widget has been tested on:\n\nBecause it uses Shadow DOM isolation, it works reliably across virtually any platform that permits custom JavaScript.", "url": "https://wpnews.pro/news/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag", "canonical_source": "https://dev.to/flux8labs/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag-c1h", "published_at": "2026-06-18 05:50:00+00:00", "updated_at": "2026-06-18 05:51:12.481743+00:00", "lang": "en", "topics": ["large-language-models", "ai-products", "developer-tools", "ai-infrastructure", "ai-agents"], "entities": ["Minyut", "OpenAI", "Supabase", "HuggingFace", "Webflow", "WordPress", "Shopify", "Groq"], "alternates": {"html": "https://wpnews.pro/news/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag", "markdown": "https://wpnews.pro/news/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag.md", "text": "https://wpnews.pro/news/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag.txt", "jsonld": "https://wpnews.pro/news/building-minyut-an-embeddable-rag-chatbot-in-one-script-tag.jsonld"}}