Six parts, one loop

Every model name, retrieval depth and similarity floor in the V.E.T.S. AI layer is a row you can query, not a constant somebody compiled.

The layer has two halves. One runs in the background against what you already wrote and never asks you anything. The other runs the moment you ask a question. This page is the shape of both. Each of the six parts below opens in place — click a link and the detail appears under it, so you can keep the thread without leaving the page. Lab tools from the Portal of Learning work the same way.

What sits between you and the model

The AI in V.E.T.S. is not a chat window bolted onto a product. It is 246 stored procedures, 42 tables, 49 views and 11 functions in the astp_AI_, atbl_AI_, aviw_AI_ and afnc_AI_ families, sitting in the same SQL Server database as the animal records they describe. Retrieval, routing, prompt assembly and scoring are all T-SQL.

That placement is a decision rather than an accident of history. Putting the AI layer inside the database is what allows its behavior to be configuration instead of code.

No model name is hardcoded anywhere in the application. astp_AI_GetModelConfig reads them out of stbl_System_CodesGlobal, one row for each job the system needs a model to do.

LLM_Default — gemini-2.5-flash. Interactive chat. The model you are actually talking to.

LLM_Batch — gemini-2.5-flash-lite. The overnight run, where volume matters more than depth.

LLM_Premium — gemini-3.1-pro-preview. Faithfulness evaluation and capability mapping.

Embedding_Default — gemini-embedding-001, at 3,072 dimensions.

When the premium tier moved from gemini-2.5-pro to gemini-3.1-pro-preview, that was an UPDATE statement rather than a deployment. The same is true of the retrieval depth and the similarity floor further down this page. If you want to know what this system is currently running, the answer is a query, and it is the same query an administrator would run.

One piece of the layer does sit outside the database. The vector index itself, vets_deployed_v3, is hosted on Vertex AI Vector Search and reached through astp_AI_QueryGCPVector. Everything that decides what to send it, and what to do with what comes back, is on this side of the wire.

The write side: what runs while nobody is asking

You type a case note and close the tab. Nothing visible happens. Two scheduled jobs pick it up. ajob_AI_GCPVectors runs every hour, carrying new and changed content into the vector index. ajob_AI_Intelligence_Pipeline_Daily runs once, at 02:00: twenty-nine steps across eight phases, finishing with Phase 8, which re-enriches the interface elements and refreshes the capability map. The first makes new material findable; the second does the heavier curation.

What that half of the loop produces is a body of 2,333 indexed documents. Everything the AI can retrieve, it retrieves from there. These three pages follow one record through it, in order. Click any link to open the page here.

1. Your Data’s Journey

A single case note, from the keystroke that creates it to the moment a minion quotes it back at you. The path is longer than you would guess, and none of it is magic. Periodic-table lessons from the Portal of Learning open inside that page the same way.

Open in place →

2. The Night Shift

What twenty-nine pipeline steps actually do between two in the morning and dawn, phase by phase, and which of them touch the records you entered that day.

Open in place →

3. AI Knowledge Base

Chunking, embedding and retrieval. How a paragraph of English becomes 3,072 numbers, and how the right paragraph gets found again months later.

Open in place →

To see last night’s pipeline verdict without leaving this page, open the Night Shift Dashboard Night Shift Dashboard.

The read side: what happens when you ask

A question does not go to “the AI.” It goes to a minion, one of 14 mapped across 78 page contexts, and which one it reaches is decided largely by where you were standing when you asked.

There is no chain of command among them. Routing is flat, and it is word-boundary text matching against 262 stored patterns rather than inference. That is a duller mechanism than the marketing instinct would pick, and a considerably easier one to audit when it gets something wrong.

Once a minion has the question, astp_AI_GetMinionRAGContext assembles what it is allowed to know, ten documents deep at a 0.60 similarity floor, and astp_AI_BuildPrompt turns that into the text the model actually receives. If the question turns out to belong to a different minion, astp_AI_A2A_DelegateTask hands it across. Twenty-eight such handoffs are on record.

4. Minion Hierarchy

All 14 of them, what each one covers, and the scoring that chooses between them. Including the thresholds, and what the system does when nothing clears them.

Open in place →

5. Trajectory Engineering

The prompt is assembled layer by layer, in T-SQL, before the model sees a word of it. This is what goes in, in what order, and why the order matters.

Open in place →

6. The Handoff Chain

What one minion can pass to another, what it cannot, and the honest limits of the delegation model as it stands today rather than as it is planned.

Open in place →

When you want the workbench behind those pages rather than the narrative:

  • Inspect the roster and routing keywords in Registry Mission Control.
  • Decompose a real prompt into its 19 sections with Prompt Tracer Prompt Tracer.
  • Probe a routing decision before a user hits it in the Test Harness Test Harness.
  • Watch multi-agent coordination in the Multi-Agent Lab Multi-Agent Lab.

Why there are fourteen of them and not one

Each minion is a row in atbl_AI_Minion with its own name, image, personality line and opening line, and its own knowledge base behind it. They are not one model wearing fourteen costumes. Narrowing what an assistant is expected to cover is what makes its answers checkable, and it is what gives the routing described above something to route to.

The roster is read from the database at the moment you load this page rather than written into it, so it reflects whoever is configured today. That is a small thing, but it is the same principle as the model names in the first section: the current state of the system is a query, and this page runs it instead of describing the result.

Dr. Dolittle is the exception and is set apart from the others. He is not a specialist but the coordinator, and the only thing that makes him one is that his identifier is the hardcoded fallback target in the routing code. There is no rank in the table to back it up.

What it will not do, and what it does with your corrections

Two things are worth knowing before you decide how far to trust any of this.

The index is updated on a schedule, not on save. Vector search runs against vets_deployed_v3, and ajob_AI_GCPVectors refreshes it every hour. A correction you make at three in the afternoon is in the database immediately and in the vector index by the top of the next hour. The record is right straight away; searching across it catches up shortly after.

The second is what is actually in that index. Those 2,333 documents are documentation about the system: help text, knowledge-base articles, and generated descriptions of database objects. Your animal records are not embedded and are not among them. That is a narrower statement than it may sound. A minion working on a live screen still reaches real records through the application’s ordinary paths, which is a different mechanism from retrieval and is governed by the permission model. How tenant isolation is enforced in the data layer →

Against that, one thing the layer does do, and it is the reason the rest of it is worth building. When you correct what the AI wrote, the correction is not filed as a bug report. It becomes the record that the next retrieval returns, to you and to everyone else who asks. Why correction is the product, not the bug →

To review how assistants actually answered — faithfulness, retrieval quality, and where the flywheel should turn next — open Minion Chat Analysis Minion Chat Analysis.

Where to go next

The six pages above are the detail, and between them they cover the whole distance from a keystroke to an answer. Open them in place when you want depth; use the lab badges when you want the live tools. If you would rather watch the loop run once in a real case than take it apart piece by piece, start with a working day instead.

Follow a real diagnosis end to end →