A training app for young athletes
AI course engine from books and PDFs
A curriculum team turns its own books, papers and PDFs into daily courses for young athletes. AI drafts each course from that library, and the team publishes with no engineer.
- Industry
- Youth sports
- My role
- AI engineer: knowledge base and AI generation
- Years
- 2026
- Status
- Admin tool in use, app through beta Checked 15 Nov 2026
- minimum source coverage, checked on every generated outline
- 75%
- cycle that makes new source material searchable
- 30 min
- apps I worked across: athlete, signup and admin
- 3
The problem
The client runs a daily training app for young athletes. It teaches mental performance. Each day an athlete listens to a short audio practice and then does a drill.
The curriculum team had books, research papers and scanned PDFs they trusted, but no way to turn them into courses alone. Every course meant an engineer typing content into the database, and every correction meant another round trip.
The team needed to create, preview and publish courses with no developer and no new app release. The app also had to place each new athlete on the right starting track.
What I worked on
I worked on the parts behind the athlete app: the library, the AI that drafts courses from it, and the assessment.
The library. The team uploads a book, paper or PDF in the admin tool, and scanned pages are read with text recognition. The system splits it into chapters, and AI turns them into structured notes: the core idea, key findings, sport examples and notes on voice.
Each note is checked, then saved under its category and track. When one sport already shows up too often in a track, new notes are told to use other sports, so the material does not lean on one sport.
Every 30 minutes a job inside the database makes new notes searchable, so nobody has to run anything.
Course drafts. A content manager picks a track and asks for a course outline. The AI drafts it from that track’s library only.
Then the system checks the outline. It counts how many of the track’s source files the outline cites. If that is under 75%, it asks again with the list of skipped files and keeps whichever version cites more.
Once the outline is approved, the AI writes each session in full: the script for the audio practice and the drill. It works from a voice and tone guide and worked examples I built into the prompts.
Refining. The content manager brings reviewer feedback into a chat next to the draft. The AI proposes a revised outline or session, and the content manager applies the ones they approve straight to the stored course.
The record of which sources a course used can only grow, so an edit cannot shrink it. Athletes see a course only after the team publishes it.
Assessment. A new athlete answers a set of questions. The system scores them across several areas, assigns a profile, and picks their starting point and roadmap.
This is plain arithmetic, not AI, so the same answers always give the same result. The team edits the questions, areas and profiles in the admin tool, with no code. I also worked on the web signup and the subscription billing in front of the app.
How it works
- Library builder: takes uploads, reads scanned pages, splits chapters and writes checked notes from them.
- Course generator: drafts an outline from one track’s library, then each session’s script and drill.
- Source check: counts the files an outline cites and asks again when coverage is under 75%.
- Refinement chat: turns reviewer feedback into a revised outline or session that the content manager approves and applies.
- Assessment engine: scores answers, assigns a profile and sets a starting track.
- Shared library: the in-app AI coaches answer athletes from the same notes.
What didn’t work
Early outlines drew on only a small part of the library. The prompt asked for wide coverage, but nothing checked it. I changed the generator to draw from more of the library and added the source count in code.
As libraries grew, drafts started coming back empty or cut off. The model used up its whole output allowance on reasoning before it wrote the answer.
I sized that allowance to the model in use, required a strict reply format, and added retries with growing waits. Quota and billing errors from the AI provider stop at once, since a retry cannot fix them.
Under the hood
In the parts I worked on:
- It runs on Supabase: Postgres with pgvector for search, and Deno edge functions, including the one behind the library builder.
- The library builder finds chapters from the PDF’s own outline, skips the front and back matter, and falls back to text recognition in the admin tool for scanned pages. Notes are embedded in batches into a pgvector index.
- New notes become searchable through a pg_cron job inside Postgres every 30 minutes, so embedding never depends on someone remembering to run it.
- The curriculum tools use both reasoning and standard OpenAI models, and the output token budget is set for each kind, since a reasoning model spends part of it before it answers.
- Placement runs on a rules table: assessment scores map to a course path with no model call.
- Courses move through draft, preview and publish in the database, so a content change needs no app release.
Where it is now
The curriculum team builds, reviews and publishes courses in the admin tool without an engineer. The athlete app has been through a beta with test athletes.
What I’d tell a founder in the same spot
If AI writes content for you, give it your own library and make it list the sources it used. Then check that list in code. The prompt already asked the model to use most of the library, but nothing confirmed it did until the system counted the sources on every outline.
How it fits together
- 1. A person Team uploads books, papers and PDFs
- 2. AI AI turns each chapter into checked, structured notes
- 3. AI AI drafts a course outline from one track's library
- 4. Code Code counts cited sources and asks again under 75%
- 5. A person Content manager approves the outline
- 6. AI AI writes each session's audio script and drill
- 7. A person Team publishes, and only then do athletes see it
Built with
- TypeScript
- Next.js
- Expo (React Native)
- PostgreSQL (Supabase)
- pgvector
- pg_cron
- Deno Edge Functions
- OpenAI