Skip to content
Digitalmohawk

01 / AI chatbot

Answers only from your own pages

An embeddable chatbot for community organisations. It answers from your own published pages and links to the page each answer came from. When it does not know, it says so and offers a person. It is running on this page if you want to try it.

Try it

It is running on this page

The chatbot in the corner is the thing described below, answering from this site's own content. Ask it something we have not written about and it will tell you it does not know.

The brief

We wanted to know how far you can get with an assistant that only answers from an organisation's own pages. So we built one and put it on this site. It is a prototype, not a product. The point was to find out what is actually involved.


What we built

  1. 01

    Answers come only from the organisation's own published pages, with a link to the source page under every answer

  2. 02

    Two checks sit between the question and the model: how well anything matched, and how much of the question the content covers. Below either, it says it does not know

  3. 03

    Distress is detected in code, before retrieval and before any model call, so handing over to a person is never the model's decision

  4. 04

    The offer of a person is always there. A visitor should not have to phrase something a particular way to reach a human

  5. 05

    Built to WCAG 2.2 AA. Keyboard operable, and the finished answer is announced once rather than read out letter by letter as it streams

  6. 06

    One script tag, rendered into a shadow root so the host site's CSS cannot break it and its own styles cannot leak out. 4.4 KB

  7. 07

    The model is added last and trusted least. It phrases an answer from passages it was handed, and decides nothing else


How it works

What happens to a questionA question first passes a distress check. If it signals distress the assistant stops immediately and hands over to a person, without calling a model. Otherwise the question is matched against the organisation’s own pages. If nothing matches well enough the assistant says it does not know, again without calling a model. Only a question that survives both checks reaches the model, which writes an answer using only the passages it was given, returned with a link to the page each came from.01Someone asks a questionTyped into the widget on your own site.02Does this signal distress?A rule in code, checked before anything else.03Match against your own pagesThe three closest passages, and how well they match.04Is any of it a good enough match?Two thresholds: relevance, and how much of the question we cover.05The model writes the answerFrom those passages only. Returned with a link to each source.YesStop. Hand to a person.No model is called.No“I could not find that.”No model is called.
Both exits sit above the model. Whether to hand someone over, and whether to admit it does not know, are decided in code before a model is involved, so they cannot be talked out of it, and a question the assistant should not answer costs nothing to refuse.
Where your content and credentials sitThe widget runs in the visitor’s browser and holds nothing but the question. It calls your own server, which holds the knowledge base and the API key. Your server sends only the three passages relevant to that one question on to the model. The full knowledge base and the API key never reach the browser, and the model never receives your content in bulk.01Visitor's browserOne script tag on yoursite. Holds the question,nothing else.02Your serverKnowledge base and APIkey live here, andnever leave it.03The modelSees three passages andone question. Never yourcontent in bulk.the question3 passagesNever crosses to the rightThe API key, the full knowledge base, and anything a visitor did not ask about.
Nothing is uploaded to a vendor and no index of your organisation is handed over. The model is called once per question, sees three paragraphs, and keeps nothing.

Screens

The chat panel, headed 'Digital Mohawk AI chat' with 'A person can help too' beneath it. A visitor has asked who owns the code when we finish; the reply says you own all the code and deliverables, and three source links sit under the answer.
An answer, with the pages it came from underneath it. The links are added by the retrieval step, not written by the model, so a citation cannot be invented.
The same panel. The visitor has asked whether the studio sells landlord insurance, and the reply says it could not find that in this site's published information, will not guess, and suggests asking a person.
The same question type it is meant to fail. Nothing matched well enough, so it says so, and this one never reaches the model, so it costs nothing.

Outcomes

  • Every answer traces back to a page on your own site, so staff can check what it told someone

  • Questions it should not answer are refused before the model is called, so they cost nothing and cannot produce a confident wrong answer

  • A person is one click away at every moment, not only when the right words are used

  • Behaviour is testable. A fixed question set runs against it, and about half those questions are ones it should refuse

  • It works on a site nobody rebuilt for it. The widget survives a hostile stylesheet and can adopt the host's palette