Live in 5 minutes
By the end of this guide a widget will be answering on your site, from your knowledge base, with citations. You only need to touch code at the embed step (copy-paste).
What is SemAgent?
SemAgent runs the same assistant on two surfaces, and both use the same knowledge base:
- The widget on your site — answers your visitors with citations, from a knowledge base built from your site and documents.
- Panel chat — you and your team ask your own content; it is not exposed to visitors.
This guide sets up the widget. Next: the Conversations screen and handing off to a human.
Quickstart: set up the Widget (5 min)
Running a Shopify store? Install SemAgent from the Shopify App Store: a sign-up that comes from a Shopify install asks for no card, and you turn the bubble on under App embeds in your theme instead of pasting code. Steps: Shopify & e-commerce.
1. Create an account and start the knowledge base
- Start your free trial at semagent.ai/register (7 days, 250 credits — card required, auto-billed when the trial ends, cancel anytime).
- In the panel, go to Content → Crawl and type your site URL into the Add a site box.
- Click Find and add. Your sitemap is found automatically and the first crawl starts; if you have a forum, its engine (Discourse, phpBB, XenForo, vBulletin, inSided) is auto-detected.
You can carry on while the crawl runs — the widget's knowledge grows as pages get indexed. More: Build your knowledge base.
2. Add the embed code to your site
Copy the code from the Embed code box on the Publishing → RAG Widget screen (your account's ID is already in it) and paste it just before your </body> tag:
<script src="https://semagent.ai/static/widget.js" data-tenant-id="your-slug" defer></script>
// app/layout.tsx import Script from "next/script"; <Script src="https://semagent.ai/static/widget.js" data-tenant-id="your-slug" strategy="lazyOnload" />
// Appearance → Theme Editor → footer.php // (or a "header/footer scripts" plugin) <script src="https://semagent.ai/static/widget.js" data-tenant-id="your-slug" defer></script>
3. Test it
- Refresh your site — the widget bubble appears at the bottom right.
- Ask a question your site does answer → you get a cited answer.
- Ask a question your site doesn't answer → the widget says it doesn't know instead of making something up. That's strict-KB grounding working.
That's it — your widget is live. For assistant name, tone, color and greeting: Widget setup & persona.
Core concepts
| Concept | Meaning |
|---|---|
| Tenant | Your isolated workspace — knowledge base, widget, channels and team members live here. |
| Knowledge base (KB) | A semantically searchable content pool built from crawled pages + uploaded documents. |
| Strict-KB grounding | The widget answers only from the KB, with citations; below a confidence threshold it says "I don't know". |
| Connector | A read-only link to Google Drive, Notion, Zendesk or your database; credentials in an encrypted vault. |
Next steps
- Build your knowledge base — crawl sources, forums, files, the quality loop.
- Widget Chat API — for building your own interface.
SemAgent