An AI column in your own database
Your own database can already keep an AI answer in a column:- A trigger runs when a record changes.
- A worker sends the record to an AI model.
- The worker writes the answer back to the column.
Where that column breaks
Your database assumes that a computed value is instant, free and always the same. An AI answer takes seconds. It costs money each time. It changes when the AI model changes. Thus, an AI column breaks on four problems:
You can build the four solutions yourself. For the first problem alone, you need a map of which records read which other records, a queue, a debounce for bursts of writes, a check that skips unchanged inputs, and a cap on cost. See the four problems.
Who Brussle is for
Brussle is for teams whose AI answers depend on more than one record and must stay correct. For example:- matching records to each other, such as a payment to the open invoice that it settles;
- checking a record against the records that it must agree with;
- detecting what changed, such as a contract section against its earlier revision;
- keeping counts current that your process depends on.
- one-off batch jobs;
- answers that read one record;
- teams that will build this system themselves.
What it costs
Each answer costs more than a direct call to an AI model. You pay for the work around the call: the relations, the freshness, the versions and the outcomes. If your answers do not have these four problems, call an AI model directly. See pricing.Move a column across
These steps move an AI column whose answer reads other records. For example, a worker sends each new payment to an AI model, with the open invoices of the same customer. The model names the invoice that the payment settles. The worker writes the invoice’sid to a column.
1. Turn the prompt into a judgment
Most prompts match one of the judgment types:
Then do these steps:
- Move the prompt’s instructions into
questionandcriteria. - Move the fields of the record that the prompt reads into a context recipe.
- Move the records that your worker fetched into a relation. For the payment, a blocking relation reads the open invoices that share the payment’s key. See match one record to another.
choice judgment gets an extra option, none_of_the_above. Its probability is in escape_p. Use this option where your prompt said “otherwise, answer none”.
2. Mirror your writes
Send each create, update and delete from your system of record to the write API. Send the payments and the invoices to the same namespace. A relation reads only one namespace. After each change, upsert the whole record, as in keep your data in sync. Writes are idempotent. Thus, your sync can retry a write at any time. Your database stays your system of record. Brussle holds a copy. To load the records that you already have, see import existing data. Choose the freshness policy of each judgment:- If you filter on the answers, or a new invoice must change a payment’s answer, use
on_change. - If you show the answer only on a detail page, you can use
on_read. Anon_readjudgment costs nothing until someone reads the answer.
3. Backfill with the estimate in front of you
Your existing payments have no answers yet. A backfill judges them. Ask for the estimate of the backfill first:- Read the estimate.
- Set a namespace budget.
- Send the backfill again with
confirm=True.
4. Compare the two columns side by side
- Run your AI column and Brussle side by side on live traffic.
- Find the payments where the two answers disagree.
- Open some of these payments in the dashboard. You see the exact context that the engine read, including the invoices, and its raw output.
- Post the match that your team confirms for each payment as an outcome. On the Team plan and above, an outcome rule can make these outcomes from your own writes.
- Change the thresholds before you change the question.
5. Cut over, then keep versions apart
To cut over, read answers from queries or from a get of the document. Do not make a user’s request wait for a new answer.wait_for on a write is for scripts and tests. See tradeoffs.
Then turn off the old column. From then on, each answer records its judgment_version and its engine_version. Brussle keeps each answer with the context that made it.
When you change the question later, create a new version of the judgment:
- Activate the new version. Brussle starts a shadow report that compares the two versions on a sample of documents.
- Confirm once the report looks right.
- Run a backfill to judge the documents again. The backfill shows its cost before you confirm it.
stale, with the reason older_version. A query with answers: "fresh_only" leaves it out.
See versions.