← Presentation home · Part 13 of 13

Same interface. Everything smart happens upstream.

Same interface. Everything smart happens upstream.
← Previous All parts →

Deep dive

Same interface. Everything smart now happens upstream.

TL;DR

The closing thought, in one sentence. Same interface, nothing the user touches changed. Everything smart now happens upstream, the intelligence moved from inside the app to a layer you control. That move is the entire contribution of this tutorial.

What this means

Two halves, both load-bearing. Take them one at a time.

"Same interface"

Nothing the user touches changed. They still open OpenWebUI. They still type into a chat box. They still pick a model from a dropdown. There was no retraining for anyone. No new tool to learn. No migration.

The familiarity is deliberate, and it is why the system actually gets used.

The trap many engineers fall into is building a better solution that requires people to learn something new. The new solution dies on the launchpad because the cost of switching is higher than the cost of the old broken thing. The proxy is engineered to be invisible. Same dropdown. Same chat box. New abilities underneath.

"Everything smart now happens upstream"

The intelligence moved. It is not in:

It is in the proxy, one hop upstream of the app, where you can see it, control it, script it, and reuse it.

That single move, from inside-the-app to upstream-of-the-app, is the entire contribution of this tutorial.

The arc, in one table

Use this as a study aid. The whole tutorial collapses into this table:

StageWhereWhat happened
Fine-tuning (slides 03, 04)Inside the model's weightsTaught style, not facts. Wrong tool.
RAG, the concept (slide 05)At question timeOpen-book test. Read, do not memorize.
Built-in RAG (slides 06, 07, 08)Inside the chat appWorks, but locked in and quietly broken.
RAG Proxy (slides 09, 10)Between the app and the modelRAG as infrastructure. One config to wire.
The stack (slide 11)870 lines of PerlLean beats heavy. Restraint is the design.
The extensions (slide 12)Same core, many front endsModularity is the payoff.

All of it collapses into the closing line: same interface, smart stuff upstream.

Reconnecting to the opening promise

The tutorial started with a promise: you would watch a local AI become an expert on a language that did not exist last week. No training. No cloud.

That demo works because of every architectural decision in this tutorial.

Every "wow" moment in the demo is a structural property of the architecture, not a trick. That is what makes it reproducible. Anyone in this room could build it.

The sovereign-AI close

This is not a slogan. It is 870 lines of Perl and a Mac. Anyone with patience and a laptop could build this. The components are open-source. The architecture is documented. The literature backs the technique.

What you do not need:

What you do need:

That accessibility is the political point underneath the technical one. AI does not have to be rented. It can be local, private, and yours. That has always been true; the tools for it just had to catch up.

The sentence behind the sentence

If someone asks you to sum up the whole tutorial in the hallway afterward, this is it:

> RAG is not a feature you turn on. It is a layer you own.

The closing slide says that in seven friendlier words. But that is the idea.

The version that actually works is the one that lives in a layer you own.

What to take home

If you have documents you would like an AI to be expert on, and you cannot or will not send them to the cloud, the path is:

  1. Install the stack, Ollama + OpenWebUI, four commands (slide 07)
  2. Try built-in RAG first, it might be enough for your use case
  3. If you hit the four failure modes, embed truncation, context window, lock-in, fixed pipeline, move the RAG out into a proxy
  4. The proxy can be 870 lines of Perl or 1500 lines of Python or whatever language fits your team. The architecture is what travels.

You did not need a tutorial for any of that, technically. You needed someone to tell you the path was real and the shape of it was small. That was this tutorial.

FAQ

Where can I get this? The scripts (Brain.pm, ragproxy.pl, ragproxy-ingest.pl) are the whole system. The companion site at ragproxy.dentistry.utoronto.ca has the references and links.

What would you do differently next time? Honest answer: I spent five months on fine-tuning before reading the research. The lesson: check whether the problem is already solved before solving it. The papers were there the whole time.

What is next for the project? Hybrid search is the natural next step, combining keyword search with vector search for better recall on rare terms. More brains. More front ends. The architecture is built to extend (slide 12's point).

Can I use this for my own organization? Yes, and that is the design goal. The architecture is small enough to copy, the components are open-source, and the licensing on the AI models we use (Apache 2.0 for Ministral 3) does not restrict commercial use.

What is the one piece of advice for someone starting this journey? Start with the simplest thing that works. OpenWebUI's built-in RAG is fine for most people. Only move to a proxy when the four failure modes actually bite you. Premature architecture is its own failure mode.

If you only remember one thing

RAG is not a feature you turn on. It is a layer you own. Build the layer.