All workLer em português

AI & back-end

Academic RAG API (Bonsae)

An API that generates academic activities from each course’s PPC, the document that defines what the course teaches.

Context

Bonsae serves the education sector. Every course at a college has its (Projeto Pedagógico do Curso), the document that defines the course goals, curriculum, subjects and expected skills. The platform’s idea was to take the PPC of a specific course, at a specific college, and generate academic activities and content aligned with it.

I spent about two months on the project and delivered the .

The problem

A PPC is long and does not fit whole in a prompt. And an activity the model writes "from memory" comes out generic: it can ask for what the course does not teach or miss what the PPC requires.

The activity had to come from that course’s PPC, not from a general idea of what a similar course usually covers.

The decision: retrieve before generating

The API follows the pattern. The PPC text is extracted and split into chunks, chunks become in , and each request first retrieves the PPC chunks closest to what was asked and only then generates the activity from them.

The output is structured, so the platform gets the activity in a predictable shape instead of free text.

Deploy

Django REST Framework with Gunicorn behind Nginx, in , on a DigitalOcean with HTTPS.

What this does not solve

Generating only from retrieved chunks lowers the risk of the model making things up, but does not remove it. And the activity is never better than the search: if the right part of the PPC is not retrieved, it comes out incomplete.

Outcome

The API was delivered to production. The code is not public.