The Matchmaker: AI route generation in a closed loop
An LLM cannot tell you how long a motorcycle tour actually takes. So the Matchmaker lets the AI pick the points and a hard measurement decide whether the result is allowed through.
LLMs are easy to use for inspiration. Accuracy is where it still falls apart. Take a concrete request: a rider wants a motorcycle tour heading south, roughly three hours long. That is not something an LLM gets right on its own. Which is why the Matchmaker in The Tours is more than a prompt.
The idea
The AI handles inspiration and selection. But all of it runs inside a closed loop that checks whether the result matches the brief, across several iterations if that is what it takes.
How it runs
Passes and POIs that are interesting to motorcyclists sit in the database. They get pre-filtered first — they have to fall within a certain radius of the starting point, for instance, or suit the bike the rider picked for this tour.
The AI works from that pre-filtered pool and assembles a tour out of it. It picks any number of points, and it puts them in an order that makes sense, so you are not criss-crossing the same region twice.
Every point carries coordinates in the database. Those coordinates go to the GraphHopper Directions API, which computes the full tour from them — including the real time and distance, rather than something the AI made up.
The check
Before a tour reaches the rider, it gets checked. Is the rough direction right? And does it land within a tolerance of 10% on time or distance?
If it does not, what failed gets recorded. The whole tour goes back to the AI together with that feedback, so it can correct its selection of points.
The principle underneath: the AI supplies the creativity, a hard measurement validates the result, and the AI has to conform to that, not the other way around. That is what keeps hallucinations in check.
Depending on the region, generating a tour exactly to the brief can be difficult — a mountainous area with more or less a single valley road will produce unsuitable results quickly. So there is a hard break for now: after three attempts the loop stops and returns the last tour.
Why use AI at all
The main reason: the selection of points comes out better and more interesting with AI than it does purely algorithmically. The order of the points makes more sense, and what you get is a noticeably more interesting tour that flows.
The AI does make generation measurably slower, though. A tour can take up to 30 seconds, depending on how many iterations it needs to satisfy the brief. I cover that in the frontend with a nice animation.
Two weak points
First, the Matchmaker depends heavily on the passes and POIs in the database. The data is okay, but it is not extensive. For it to work well anywhere in the world, it has to become less dependent on that data.
Second, the tours get a little restless when the loop has to iterate several times. Instead of a clean round trip you end up riding the given points in a jagged line. There is definitely room to improve that.
What comes next
Next up is being able to adjust a generated tour through an interface — either with predefined options or in free text. That will make the tours better again for the person actually riding them.