Skip to content
QwryAI
Documentation

Explore the documentation

Quick StartWelcome to QwryAI

Get started with QwryAI and discover how to build an AI support assistant trained on your business data.

Quick StartBuild Your First AI Agent

Create a support agent from your website, review its knowledge, and publish it to your site.

Quick StartBest Practices

Use these practices to improve answer quality, reduce failed handoffs, and keep your chatbot useful over time.

Quick StartResponse Quality

Improve how accurately and helpfully your chatbot answers customers.

AI Agent ManagementPlayground

Test and optimize your chatbot before deployment.

AI Agent ManagementData Sources

Add, train, and maintain the knowledge your agent uses to answer customer questions.

AI Agent ManagementDeploy

Add your chatbot to a website or ecommerce storefront.

AI Agent ManagementSettings

Choose the Copilot model, set a rate limit, and block spam and countries.

AI Agent ManagementEmail Settings

Configure email handoff and reply behavior for chatbot support workflows.

AI Agent ManagementLead Forms

Collect customer details directly inside the chat experience.

AI Agent ManagementIntegrations

Connect QwryAI with external platforms and business tools.

AI Agent ManagementDeveloper & Agent Access

Connect QwryAI to external AI tools, MCP clients, scripts, and CLI workflows.

AI Agent ManagementBackstage

Ask questions about your agent and workspace in a dedicated internal conversation.

AI Agent ManagementInstructions

Define your agent's behavior, guardrails, model, and response style.

AI Agent ManagementProcedures

Write a repeatable customer process with instructions, conditions, and actions.

AI Agent ManagementAction approvals

Review the exact input before an action performs a business write.

Pages

AI Agent Management

Deploy

Add your chatbot to a website or ecommerce storefront.

Before You Deploy

Deployment makes the chatbot available to customers, so complete the quality checks first. The chatbot should answer core questions, escalate correctly, and match the website where it will appear.

  • Data sources are processed.
  • Playground tests pass for common questions.
  • Appearance matches your brand.
  • Lead forms and escalation settings are configured.
  • Billing and usage limits are ready for expected traffic.

Deployment Method

  1. Open the selected chatbot.
  2. Go to Deploy.
  3. Copy the embed code.
  4. Paste the code into your website, theme, CMS, or tag manager.
  5. Publish your site changes.
  6. Open the live website and send a test message.
html
<!-- Paste before </body>. The embed key comes from Deploy > Chat bubble. -->
<script>
(function(){if(!window.qwryai||window.qwryai("getState")!=="initialized"){window.qwryai=(...arguments)=>{if(!window.qwryai.q){window.qwryai.q=[]}window.qwryai.q.push(arguments)};window.qwryai=new Proxy(window.qwryai,{get(target,prop){if(prop==="q"){return target.q}return(...args)=>target(prop,...args)}})}const onLoad=function(){const script=document.createElement("script");script.src="https://www.qwryai.com/widget/script/YOUR_EMBED_KEY";document.body.appendChild(script)};if(document.readyState==="complete"){onLoad()}else{window.addEventListener("load",onLoad)}})();
</script>

JavaScript API

The embed code loads the widget after your page has loaded, so it never slows the page down. The page controls the widget through window.qwryai, which works as soon as the embed code is on the page: calls made before the widget has loaded wait and run once it has. window.chatbot offers the same controls once the widget has loaded.

javascript
// Open, close, or toggle the chat window.
window.chatbot.open();
window.chatbot.close();

// Send a message on the visitor's behalf.
await window.chatbot.sendMessage("Where is my order?");

// Identify a signed-in visitor with a JWT signed on your server (see Identity Verification).
const { token } = await fetch("/api/qwryai-token").then((response) => response.json());
await window.qwryai("identify", { token });

// React to widget events.
window.chatbot.on("messageReceived", (message) => console.log(message));

// Register client-side tools for AI Actions.
window.qwryai("registerTools", {
  Read_current_page: async () => ({
    status: "success",
    data: { title: document.title },
  }),
  lookupCart: async (args, user) => ({ status: "success", data: { items: [] } }),
});

window.qwryai(command, payload) accepts the same commands as a single function, for example window.qwryai("open") or window.qwryai("identify", { token }).

Website bubble deployment
Open Deploy → Website widget to find the allowed domains and the agent’s installation script. Copy your own script from this panel.

Identity Verification

Identity verification tells the agent who a signed-in visitor is, so it can greet them by name and run actions on their account. Your server signs a short-lived JWT for the signed-in user with the agent's secret key, and the page passes that token to the widget. QwryAI checks the signature, so visitors cannot pretend to be someone else.

  1. Open Deploy > Website widget and copy the Secret key under Identity verification.
  2. Store it on your server as an environment variable, for example QWRYAI_IDENTITY_SECRET. Never put it in browser code or commit it.
  3. Add a server endpoint that signs a JWT (HS256, expiring within 1 hour) for the signed-in user.
  4. In the browser, fetch the token and call window.qwryai("identify", { token }) after the embed code.
  5. Call window.qwryai("logout") when the user signs out.
javascript
// --- SERVER CODE (Node.js) ---
const jwt = require("jsonwebtoken");

app.get("/api/qwryai-token", requireSignedInUser, (req, res) => {
  const token = jwt.sign(
    {
      user_id: req.user.id, // Required: your user's stable id
      email: req.user.email,
      name: req.user.name,
      plan: req.user.plan, // Saved when "plan" is a contact attribute in Settings > Attributes
    },
    process.env.QWRYAI_IDENTITY_SECRET,
    { algorithm: "HS256", expiresIn: "1h" },
  );
  res.json({ token });
});

// --- CLIENT CODE ---
const { token } = await fetch("/api/qwryai-token").then((response) => response.json());
await window.qwryai("identify", { token });
ClaimUse
user_idRequired. Your user's stable id; the contact is matched on it.
email, name, phoneFill the contact's details.
expRequired. Tokens are rejected after it; one hour is a good lifetime.
Anything elseSaved to the contact attribute with the same key, when it exists in Settings > Attributes (strings, numbers, booleans). Other claims are ignored.

Troubleshooting

ProblemWhat to check
Widget does not appearConfirm the embed code is complete, published, and not blocked by the site theme or CSP.
Wrong chatbot appearsConfirm the embed key belongs to the selected chatbot and workspace.
Widget appears but does not answerCheck chatbot active state, plan status, credits, and message limits.
Conversation missing in QwryAIConfirm the live domain uses the latest published script and the correct environment.
  • Confirm the embed code was copied completely.
  • Confirm the website change was published.
  • Check that the chatbot is active.
  • Make sure the embed key belongs to the correct chatbot.
  • Check browser console errors if the widget does not load.
Deployment areaLaunch check
Chat widgetDisplay name, initial message, suggested messages, placeholder, feedback, copy button, notices, footer, and embed method are configured.
Website embedThe script is published on the live customer-facing page, not only in a preview editor.
Connected channelsEmail, Slack, Zapier, WhatsApp, Messenger, Instagram, Telegram, and Shopify routes are tested separately when enabled.
AttachmentsImages, PDFs, file count, file size, PDF page count, and unsupported formats are handled before launch.