Skip to contentSkip to content
The teardown · a cornerstone

An AI that costs nothing to run.
Here is every part of it.

Ask Lee is not a large language model. It is a truth entity: it knows one domain, answers by rules from a checked record, and says when it doesn’t know. It runs on an ordinary web server, its engine is a 16 KB file, and it gets better when its mistakes are fed back. This page takes it apart.

In plain words

What this page says, for a business owner.

  • Ask Lee answers from your own checked record. It does not make up new sentences.
  • It costs nothing extra per question, because no AI company is paid to answer.
  • When the record does not hold the answer, it says so.
  • It gets better when its mistakes are fed back in, and a person checks every change.

The rest of this page is for builders: every part, with the code.

£0a question to run: no AI company, no API key, no AI chips
16 KBthe whole engine, one PHP file. The word file it learns from: 1.2 KB
80wiki articles it reads, cut into 1,670 passages
70% → 93%its exam score, before and after it was fed its own mistakes

Measured on 23 November 2026 on our test copy of this site. About 100 milliseconds an answer on an ordinary PC.

Part 1

Google never had a personality. That was the point.

Think back to the search box before 2023. You typed words. It never chatted, never apologised, never wrote you a poem. It went to its index, found the pages that matched, put them in order and pointed. If nothing matched, you got nothing. Nobody wanted a search engine with a personality, and nobody thought to build one.

That search engine was, in our words, a truth based domain entity. Its domain was the pages it had read. It answered from what was there, by logic and by ranking, and never from imagination. The paper that started Google in 1998 is about exactly that: an index of words, a list of where each word appears, and a way of ranking the pages by the links between them.

Then the box learned to talk. Google showed generated answers above its results to everyone in the US from 14 May 2024, the day it launched AI Overviews. Talking is useful. But a voice that writes new sentences can write wrong ones, and say them with the same confidence as right ones.

Ask Lee goes back to the old idea and points it at one business. No personality, no guessing. It reads one checked record and answers from it, word for word. We think that for a business, where a wrong answer costs a sale or worse, the old idea was the right one.

Part 2

Two kinds of machine that both get called AI.

A large language modelA truth entity (Ask Lee)
How it answersPredicts the next word, again and againFinds the passage that answers, and quotes it
What it knowsA little about almost everything, frozen at trainingOne domain, all the way down, as of the last edit
When it doesn’t knowIt can sound sure and still be wrongIt says “I won’t guess” and shows the closest articles
ProofSometimes a source, not alwaysThe article and the section, every time
Cost of a questionPaid per word to an AI company, or GPUs of your ownNothing beyond the server you already have
How you teach itRetraining or fine tuning: expert work, big computersEdit a small text file and save it
SizeBillions of numbers, many gigabytesA 16 KB engine, a 1.2 KB word file, your own articles

Language models are brilliant at writing. We use them, and they read what our sites publish. The argument here is narrower: when a business answers a customer, the answer should come from the business’s record, not from a guess. Read large language models and truth entity.

Part 3

How it works, step by step.

Every step below is old, published and free to use. Most of it is older than the web.

Fig. 7 How Ask Lee answers. A drawing, not to scale.
  1. 1Your questionIn your own words
  2. 2The words that matterSmall words dropped, endings trimmed
  3. 3Every passage scored80 articles, read paragraph by paragraph
  4. 4The best one, checkedDoes it cover most of the question?
YesThe answer, word for word, with the article and section linked
No“The wiki doesn’t answer that yet”, and the closest articles
  1. Cut the record into passages. Each wiki article becomes its opening answer, its key points, every paragraph of every section, and every question and answer. 80 articles make 1,670 passages. Each passage remembers where it lives, down to the section.
  2. Keep only the words that matter. Small words such as “the”, “is” and “how” go. Endings are trimmed, so “citations” finds “citation”. This is called stemming.
  3. Weigh every word by how rare it is. A word in every article tells you nothing. A word in two articles tells you a lot. This idea, inverse document frequency, was published by Karen Spärck Jones in 1972. Search engines have used it ever since.
  4. Score every passage. Ask Lee uses a formula called BM25: rare words count for more, a word repeated ten times doesn’t count ten times as much, and a long passage doesn’t win just by being long. It was set out by Stephen Robertson and colleagues, and Robertson and Hugo Zaragoza wrote it up in full in 2009.
  5. Check the best one really answers. This is the step most systems skip. Ask Lee adds up how much of your question the best passage covers, with rare words counting most. Below the line, it doesn’t answer. “Best pizza in London” finds a passage about London, but the rarest word, pizza, isn’t covered, so it says “I won’t guess.”
  6. Answer in the record’s own words, with the address. The passage, word for word, the article it came from and a link to the exact section.
Part 4

The code. All of it fits on one screen.

Here is a complete working version in about forty lines of Python. Copy it, give it your own passages and it answers. No libraries to install, no key, no account anywhere.

PythonA whole truth entity answer engine, in about forty lines
import math, re

STOP = set("a about an and are as at be by can count counts do does for from get how i in into is it me my of on or the to what why with you your".split())

def words(text):
    out = []
    for w in re.findall(r"[a-z0-9]+", text.lower()):
        if w in STOP:
            continue
        if len(w) > 3 and w.endswith("s") and not w.endswith("ss"):
            w = w[:-1]                      # citations -> citation
        out.append(w)
    return out

def build(passages):                        # passages: list of (text, address)
    docs = [words(t) for t, _ in passages]
    df = {}
    for d in docs:
        for w in set(d):
            df[w] = df.get(w, 0) + 1        # how many passages hold each word
    return docs, df, sum(map(len, docs)) / len(docs)

def ask(question, passages, docs, df, avg, line=0.62):
    q, n = set(words(question)), len(docs)
    idf = {w: math.log(1 + (n - df.get(w, 0) + .5) / (df.get(w, 0) + .5)) for w in q}
    best, best_score = None, 0.0
    for i, d in enumerate(docs):
        score = 0.0
        for w in q:
            tf = d.count(w)
            if tf:                          # BM25: rare words count most, repeats count less
                score += idf[w] * tf * 2.2 / (tf + 1.2 * (.25 + .75 * len(d) / avg))
        if score > best_score:
            best, best_score = i, score
    if best is None:
        return "I won't guess.", None
    covered = sum(idf[w] for w in q if w in docs[best]) / sum(idf.values())
    if covered < line:                      # the step most systems skip
        return "I won't guess.", None
    return passages[best]                   # the record's own words, and where they live

And here is the heart of the real one, the PHP that answers on this site. It adds two things to the version above: a boost when the article is about your word, and the line it won’t cross.

PHPThe scoring loop from inc/ask.php
// From inc/ask.php, the engine running on this site (16 KB in all).
foreach ( $words as $w ) {
	$df  = isset( $idx['df'][ $w ] ) ? $idx['df'][ $w ] : 0;
	$tf  = isset( $p['w'][ $w ] ) ? $p['w'][ $w ] : 0;
	$idf = log( 1 + ( $n - $df + 0.5 ) / ( $df + 0.5 ) );
	if ( $tf ) {
		$s += $idf * ( $tf * 2.2 ) / ( $tf + 1.2 * ( 0.25 + 0.75 * $dl / $idx['avg'] ) );
	}
	if ( in_array( $w, $p['tw'], true ) ) {
		$s += $idf * 1.1; // the article is ABOUT this word: its title holds it
	}
}
// ...then: does the best passage cover enough of the question? If not, it says so.
$strong = $bestS >= 3.2 && $cover / max( 0.001, $all_w ) >= 0.62;

Ask it yourself as data: /wp-json/ursy-ai/v1/ask?q=what is premium intent.

Part 5

Feed it its mistakes. It gets better.

A language model learns in a data centre. Ask Lee learns in a text file. Every time it answers wrongly, the wrong answer tells you something: the person used a word the record doesn’t, or a phrase that belongs to one article. Write that down and the mistake is fixed for good.

We tested it on 23 November 2026. We gave Ask Lee an exam of 40 questions, each with the article that should answer it, plus 2 it should refuse. Then we showed its 12 mistakes to Claude, Anthropic’s AI, with the prompt below. Claude wrote a word file of 22 lines. We read every line, saved the file and asked again.

28 of 40practice questions right before
37 of 40after the word file: 70% to 93%
15 → 16of 20 questions it was never trained on
0facts added. Only the words people use

The telling part is the third figure. On questions it had never seen, it went from 15 to 16 out of 20. Teaching fixes what you teach, and a little more. The next round would take those 4 new misses and do it again. That is the whole method: ask, mark, feed back, repeat.

PromptWhat we asked Claude
Here are the questions Ask Lee answered wrongly, with the wiki article that should
have answered each one. Suggest lines for ask-words.json:
 - "say": words a person uses that the articles don't (llm -> large language model)
 - "hint": a phrase that should point at one article
Never add a fact. Only words people use and the article that already answers.
JSONA few lines of the word file it wrote (1.2 KB in all)
{
 "say": {
  "llm": "large language model",
  "schema": "structured data",
  "bots": "crawler robots",
  "make things up": "hallucination invent wrong"
 },
 "hint": {
  "one trade at a time": "vertical-technology",
  "buy something for me": "agentic-commerce"
 }
}

The language model trains the truth entity, and a person checks it. The LLM never answers a customer. It does the clever, slow work once, offline: reading mistakes and suggesting words. The cheap, fast, checked machine does the answering, all day, for nothing.

Part 6

It already works in a real shop.

The first Ask Lee answers shoppers at teas.co.uk, a UK tea shop. It answers from the shop’s checked records and gives the manufacturer’s page as the proof. It learned the same way: from 12,744 real search phrases people typed to find the shop, so it knows “steep” and “brew” are the same thing, and from an exam whose wrong answers became homework.

1,150questions in its fact exam, 22 November 2026
99%answered right
12,744real search phrases it reads for meaning
3ways in: the website chat, Ask Nicola for AI assistants, and MCP

Figures from teas.co.uk’s own test records. The code behind those three ways in calls no language model.

Part 7

What it costs, in full.

Building itTimeProgramming the engine and writing the record. This is the real cost.
Running it£0 a questionIt runs on the web server the site already has. No AI company bill, no GPU.
Teaching itMinutesRun the exam, give the mistakes to an LLM once, check its lines, save a small file.
Keeping it rightYour editsChange the record and the next answer uses the change. Nothing to retrain.

A language model charges for every question, forever. A truth entity charges once, in time, and then answers for free. That matters more in a year when the memory inside AI computers made every computer dearer: read about the RAM shortage.

Part 8

What it can’t do. We would rather tell you.

  • It can’t write new sentences. If the record never says it, Ask Lee can’t say it. That is the point, and also the limit.
  • It can’t join two articles into one answer. It gives the best passage and points to the next ones to read.
  • It is only as good as the record. A thin or wrong record gives thin or wrong answers. The work is in the facts.
  • It needs people’s words. When people ask in words the record doesn’t use, it misses until the word file learns them. That is what the exam is for.
  • It speaks one language. Today, English.

When you need writing, summaries or a conversation, use a language model. When you need the truth about your own business, every time, for nothing, build a truth entity. Many businesses will want both, in that order: the record first, the voice on top.

Part 9

Build a small one yourself.

  1. Write the record. One page per thing you sell or know: an opening answer, the facts, the questions customers ask. Plain words, one fact per sentence.
  2. Copy the forty lines above. Feed it your pages, cut into paragraphs, each with its address.
  3. Write an exam. Forty real questions from your inbox, each with the page that should answer it. Add two it should refuse.
  4. Mark it, feed it its mistakes, repeat. Give the wrong ones to any LLM with the prompt above. Check every line it suggests. Keep some questions back to see if it really learned.
  5. Put it where people ask. A box on your site, and a door for AI assistants so they can ask it too.

Or let URSY do it: every URSY shop is built on one checked record, and the same engine for each new trade is rolling out. See built and planned for what works today and what is next.

What goes in, what comes out, and what it could do for a plumber, a garage or a salon: Ask Lee can live anywhere.

Sources

Where these ideas come from.

Questions

What people ask about the teardown.

Is this really AI?

Yes, the older kind: a machine that answers questions by rules and statistics, the way search engines did for decades. It doesn’t generate language, so it can’t invent an answer.

Why not use ChatGPT for everything?

Every question costs money, the answer can be wrong in a confident voice, and you can’t see where it came from. For a business answering customers, those three things matter more than style.

Can a language model still help?

Yes, behind the scenes. It reads the mistakes and suggests words for the word file, once, and a person checks them. It never answers a customer.

How big are the files?

The engine is 16 KB and the word file 1.2 KB. The index it builds from the 80 articles is about 1.9 MB, made automatically and rebuilt when an article changes.

Can I use the forty lines of Python?

Yes. They are written for this page to show the method. Please credit ursy.ai with a link if you publish them.