Guides

Build a custom AI chatbot for personalized support

Personalized support means the chatbot knows who is asking and what they did. Learn the three layers: verified identity, page and account context, and live data lookups.

By the Askocto team · · 4 min read

A personalized support chatbot answers with the customer's own information, such as their plan, their order or the page they are stuck on, instead of generic text. You build it in three layers: verify who the customer is, pass useful context from your site or app, and let the chatbot look up live data. Each layer adds value and each has a safety rule. This guide covers all three, with a code example for the website.

What personalization means in support

Compare two answers to "Where is my order?".

  • Generic: "You can track your order using the link in your confirmation email."
  • Personal: "Your order 4821 left our warehouse yesterday and is with the carrier. Here is the tracking link. It should reach you by Thursday."

The second is better because it uses data about this customer. But showing a customer's data to the wrong person is worse than showing nothing. So identity comes first.

Layer 1: verify who the customer is

If your chatbot lives on a page where customers are signed in, you already know who they are. The chatbot must know too, and it must be sure. If it simply trusts a user id sent from the browser, anyone could change that id and see another person's data.

The safe pattern is identity verification. Your server signs the user id with a secret, and the chatbot checks the signature. With Askocto, the embed script exposes identify, and your server computes an HMAC-SHA256 of the user id with the agent's identity secret and sends it as userHash.

// Server: compute the hash (Node)
import crypto from "node:crypto";
const userHash = crypto
  .createHmac("sha256", process.env.OCTO_IDENTITY_SECRET)
  .update(user.id)
  .digest("hex");
// Browser: after the page renders the values from your server
window.askocto.identify({
  userId: "usr_1042",
  userHash: "<value from your server>",
  name: "Dana",
  email: "dana@example.com",
  metadata: { plan: "pro" },
});

Keep the secret on your server only, never in page source. The identity verification guide in the docs shows the full flow.

Layer 2: pass context from your site or app

Once the user is known, add context about what they are doing. The setContext call attaches an object that the agent can use in its answers.

window.askocto.setContext({
  page: "billing",
  plan: "pro",
  seatsUsed: 8,
  seatsAvailable: 10,
});

Useful context includes:

  • The page or screen, so "this button does not work" has a meaning.
  • The plan and role, so answers match what the customer can actually do.
  • Recent events, such as a failed payment or a completed setup step.
  • The language the customer uses in your product.

Send only what helps answer questions. Fewer fields are easier to keep accurate, and you avoid sending data the agent does not need.

Layer 3: let the chatbot look up live data

Context on the page goes stale. For facts that change, such as order status or subscription state, let the chatbot ask your systems. In Askocto these are Actions: a connection like Shopify or Stripe, or a custom action that calls your own API over HTTP.

Design each lookup with care:

  1. Scope it to the verified user. The action receives the user id and returns only that person's data.
  2. Return what is needed. An order status, not a full customer record.
  3. Make it read-only first. Add write actions later, one at a time, with limits.
  4. Handle failure. If the system is down, the chatbot should say so and offer a person, not invent an answer.

The related guide on connecting an AI agent to your helpdesk and CRM covers the wiring for the systems your team already uses.

Write personalization into procedures

Data alone does not produce good answers. You also decide how to use it, and a procedure is the place to say so.

Order status
1. Look up the customer's latest order with the order lookup action.
2. If the order has shipped, share the carrier and the tracking link.
3. If it has not shipped and is over 3 days old, apologize once,
   give the expected ship date, and offer to pass it to the team.
4. Never share another customer's order details.

See how to write procedures for an AI support agent for the format.

Personal does not mean intrusive

Match the level to the customer's expectation:

  • Using a name and plan is normal.
  • Mentioning something the customer has not shared in this conversation can feel uncomfortable, even if it is on their account.
  • Do not infer sensitive things such as health or finances from behavior.

Tell customers in your privacy notice which data the assistant uses. If you operate in a regulated area, ask your privacy adviser to review the data you send. This is not legal advice.

Test with real customer scenarios

Create three test users: one on a free plan, one on a paid plan and one with a problem, such as a failed payment. Ask each the same ten questions. Check that:

  • Answers differ where they should.
  • The chatbot never shows one user's data to another.
  • The chatbot behaves well when a field is missing.

The testing guide shows how to build and replay the test set. When you are ready to try this, the widgets feature page shows interactive components you can add, such as order tracking cards.

Frequently asked questions

How does a chatbot know who the customer is?

Your site passes a user id to the chat widget, and your server signs it so the chatbot can verify it. Without the signature, treat the visitor as anonymous.

Is it safe to show order details in chat?

Yes, if identity is verified and the lookup is scoped to that user. Never display account data to an unverified visitor.

What data should I pass to the chatbot?

Only what improves answers: plan, role, page and a few recent events. Avoid sending sensitive fields the agent does not need.

Can personalization work without logins?

Partly. The chatbot can use the page and language, and it can ask for an order number and email to look things up. Treat that as lower trust and show less.

Train an agent on your own help center

Askocto answers the repeat questions across chat, email and voice and hands the hard ones to your team.

Keep reading

All articles
Guidesai chatbot tone of voice
Oct 12, 20266 min read

AI chatbot tone of voice: how to define and test it

A practical way to set your AI chatbot's tone of voice: pick a few traits, write example replies, set rules for angry customers and humor, and review real transcripts every week.

Read article
Guidesai chatbot hallucinations
Jun 9, 20266 min read

AI chatbot hallucinations: how to stop made-up answers

AI chatbot hallucinations usually trace back to gaps, conflicts and missing rules. Ground answers in your content, teach the bot to say it does not know and review failures weekly.

Read article
Guideschatbot gdpr compliance
Jun 4, 20266 min read

GDPR and AI support chatbots: a pre-launch checklist

Map the data, pick a lawful basis, write the widget notice, set retention, choose a region, restrict access and plan for deletion requests. A checklist to run before launch.

Read article