All buildsIn progress

AI checking service connected to LMS / 2026 / In progress

LMS AI Core.

The service that checks an AI answer against the lesson, claim by claim, before a learner sees it

Part of the LMS journey
Role
AI and server engineering
Built with
Python · FastAPI · Pydantic · PHP · Laravel · PostgreSQL · pgvector

01What I built

The problem.

A passage on the right topic does not prove that an AI answer is right. The passage can match the question but disagree with a number, a date or a name in the answer. A study guide can also be good and still out of date, because the lesson changed after the guide was made.

What I built.

LMS AI Core is the AI half of LMS. First, the Laravel side of LMS checks that the learner may see the lesson. It gathers passages from the lesson and asks the AI provider for an answer. The Python service then ranks the passages, best match first. It checks the answer one claim at a time, where a claim is a single statement. Laravel reads the result and decides what to show.

The AI service

Python, FastAPI, Pydantic

Passage ranking
Puts the passages Laravel sends in order, best match first. It looks at matching phrases and keywords. It also looks at each passage’s title and source.The storyMoving AI checks to Python while Laravel keeps learner access
Claim checking
Splits an answer into claims, which are single statements, and checks that the lesson supports each one. It also spots clashes in numbers, dates and names. And it spots clashes in quotes, in the order of things, and where one side says “not”.The storiesMoving AI checks to Python while Laravel keeps learner accessChecking each claim in an AI answer against the lesson
Key-only access
Every request to the service’s main web addresses, the ones with a version number, must carry an access key. If no key has been set up, the service refuses the request. Its public documentation pages are switched off.The storyProtecting learner text in saved conversations and evaluation reports

The Laravel side

Laravel, PostgreSQL, pgvector

Lesson sources
Each lesson is saved as a source with a version number, split into small chunks of text. Each chunk gets a fingerprint, a short code that changes when its content changes. Searches look only inside the learner’s own courses.The storiesRebuilding lesson sources from repaired transcriptsKeeping AI answers tied to the lesson sources
Gateway and fallback
In live mode, Laravel uses the result from the Python service. If the service is too slow or fails, Laravel switches to its own local check. So nothing goes out unchecked.The storyChecking AI answers in Python, with a local check as backup
Study guides
A saved guide is shown only while it still matches the lesson as it is now. It must also match the current AI provider, model and settings.The storiesWhy the study guide worker wouldn’t startWhy a ready study guide looked unavailable
Privacy
Logs and saved conversations blank out private text. Evaluation exports, the files used to judge answer quality, keep summaries instead of full answers.The storyProtecting learner text in saved conversations and evaluation reports

02The journey

What broke, and what changed.

Broke, then fixedA decisionA milestone

  1. 01 of 10Decided

    Give the checking its own service, keep access in Laravel

    The questionThe checks could live inside Laravel or in a separate service.

    What I choseThe Python service gets a narrow job. It LMS AI Core · The AI servicePassage rankingPuts the passages Laravel sends in order, best match first. It looks at matching phrases and keywords. It also looks at each passage’s title and source.See it in the map above it is given and LMS AI Core · The AI serviceClaim checkingSplits an answer into claims, which are single statements, and checks that the lesson supports each one. It also spots clashes in numbers, dates and names. And it spots clashes in quotes, in the order of things, and where one side says “not”.See it in the map above. Laravel keeps enrolment and storage. It also makes the calls to the AI provider and decides the final answer. The service can be tested on its own, and it has no power to give a learner access.

03Today

Where it stands.

LMS AI Core · The AI servicePassage rankingPuts the passages Laravel sends in order, best match first. It looks at matching phrases and keywords. It also looks at each passage’s title and source.See it in the map above and claim checking use scored text rules, not an AI model. They catch conflicts and missing support, but they do not prove that an answer is right. In shadow mode, where both checks run and are compared, each request has to wait for the Python service. The Python side still expects a quiz of a minimum size, unlike Laravel.

More notes from this build.