All buildsPrototype

AI helper service / 2026 / Prototype

Brimfox AI Core.

A prototype Python service that re-orders recipes and checks explanations by rules you can follow, not yet used by Brimfox

Part of the Brimfox journey
Role
Software engineering
Built with
Python 3.11 · FastAPI · Pydantic 2 · Uvicorn · pytest · Laravel HTTP client · Docker

01What I built

The problem.

A recipe app has to decide which recipes to show first. It also has to check whether a generated explanation sticks to the recipe. Rules for that are easier to test when they run on their own. But a separate service is one more thing that can be slow, down or set up wrong. And it does nothing until the app really calls it.

What I built.

Brimfox AI Core is a Python service with a small A technical wordAPIA set of web addresses that one program uses to ask another program for data, or to ask it to do something., two web addresses that the app can call. One puts the recipe choices it is given in a new order. It uses fixed weights, which are set numbers for how much each thing counts. The other compares an explanation with the source material it is given. It sends back counts of how much is supported, plus warnings. Neither one fetches recipes or calls an AI model. In the Brimfox Laravel server, a client sends the request as A technical wordJSONA common text format that programs use to send each other structured data., a common structured text format, with a pass key and a trace ID. The trace ID lets me follow one call through both systems. The client has time limits and only retries a set number of times.

The Python service

Python 3.11, FastAPI, Pydantic 2, Uvicorn, Docker

Recipe ordering
Gives each recipe choice points for matching the search words and phrases. It adds points for ingredients on hand and for swaps that cover a gap, then sorts.
Explanation checker
Turns down a fixed list of unsafe phrases. It also measures how many keywords an explanation shares with its source material.The storyWhat a keyword check can and can’t say about an explanation
Pass key check
Checks the pass key in a way that takes the same time whether it is right or wrong. So the timing gives nothing away. On the live setup, it refuses protected calls when no key is set.
Request models
Pydantic, a Python tool for checking data, checks the outer shape of each request and the limit of 1 to 20 results. The values inside stay loose.

The Laravel client

Laravel HTTP client

Requests
Sends the request as structured text, with a pass key and a trace ID. Connecting and the whole request each have their own time limit.The storyWhat Brimfox still needs before it calls its Python service
Retries
Tries again after a failed connection or a server error, up to a set limit. It does not retry every failed answer.
Results and failures
Returns the status and how long the call took. Or it raises a clear error that tells running out of time apart from other failures.
Request logging
When switched on, it records the address called, the trace ID, the delay and the status. It also records the names of the data fields, never their values.

02The journey

What broke, and what changed.

Broke, then fixedA decisionA milestone

  1. 01 of 04Decided

    Fixed weights and counts I can follow

    The questionA prototype’s calculations need to be easy to follow before anyone can judge whether they help.

    What I choseBoth helpers use Brimfox AI Core · The Python serviceRecipe orderingGives each recipe choice points for matching the search words and phrases. It adds points for ingredients on hand and for swaps that cover a gap, then sorts.See it in the map above and plain counts. That gives a starting point for testing whether they help. The ranking is not learned from data, and the Brimfox AI Core · The Python serviceExplanation checkerTurns down a fixed list of unsafe phrases. It also measures how many keywords an explanation shares with its source material.See it in the map above does not check meaning.

03Today

Where it stands.

The next step is a recipe request that really uses the service. It needs a planned response for success and for running out of time. It also needs one for a refused pass key and for an answer it cannot use. The Brimfox AI Core · The Python serviceExplanation checkerTurns down a fixed list of unsafe phrases. It also measures how many keywords an explanation shares with its source material.See it in the map above needs stricter checks on the values inside each request. A missing field can turn into the word “None”, and the pass mark accepts any value. An earlier report shows six Python tests passing.