GenAI · own product · 2026
PrimeroLab
A study app built around answering. Every answer, spoken or typed, is graded from 1 to 5, and what went worst comes back first.
Built with
- Next.js 15
- React 19
- TypeScript
- Supabase
- Postgres
- pgvector
- Gemini
- OpenAI
- Claude API
- Tailwind
- Vitest
- Claude Code
The problem
Rereading feels like studying, but never shows what you could not explain. Flashcards help, but you write them and grade yourself.
What a study session looks like
Decks come from your material or a topic. Each answer is graded on the spot, with what was missing and a complete example.
Besides decks, there is a technical interview simulator with a crew of interviewer characters, and an express mode with a time limit for quick reviews.
Any material, not just the first pages
The first version cut every document at 6,000 characters: 95% of an 80-page PDF never reached the model. Now the whole document is chunked and searched with pgvector.
- Chunks of about 1,200 characters with 150 of overlap, so an idea split at a boundary is not lost.
- An HNSW index for similarity search, with a documented fallback when the extension version does not support it.
- The owner's id sits on every chunk, so the security check needs no join.
A study assistant that reads your progress
The study chat used to stuff keyword matches into every prompt. It was rebuilt as a tool-calling agent: “what should I review today?” reads the real queue.
Security lives in the database
Every tool runs with the user's own session, so row-level security decides what comes back. The model never supplies a user id.
Hard limits
- 4 tool rounds at most, so a runaway loop cannot run up the model bill.
- 8 seconds per tool and 6,000 characters per tool result, so one slow or huge answer cannot stall the conversation.
The assistant does not go down with one provider
Gemini answers first and OpenAI takes over if it fails. Every reply logs which one answered, so a silent fallback never hides.
Why what went worst comes back first
Each 1 to 5 score feeds SM-2. FSRS retains better, but it needs review history that does not exist yet. SM-2 builds it.
Built and run by one engineer: product, data model, AI features, security and deploys.