01 / Systems / Cairn
Cairn
Study streaks that only count once you've proved the work.
A / Problem
I was studying for AWS Solutions Architect Associate on my own when a friend at college and I started quizzing each other. That short exchange showed me what I actually knew.
We looked for a tool to keep it going and couldn't find one. Accountability apps only record that you said you studied, and the days you didn't are the ones that matter.
B / Constraints
- A check has to prove you studied your material, not that you can guess.
- It can't be a daily quiz, or nobody will use it.
- It has to run on a student budget.
C / Design
Each study day you log starts as pending. On random days, Cairn gives you a short spot-check built from the material you attached to that milestone. Pass it and every pending day turns verified. Fail it and the streak freezes until you pass a retake. You never know which day will be checked.
The questions come from a retrieval-augmented generation pipeline. Study material is split into chunks, embedded with Amazon Titan and stored in PostgreSQL with pgvector. Claude on Amazon Bedrock writes questions from the retrieved chunks only, and each question has to cite the chunk that answers it. A validation pass drops anything unsupported, ambiguous or duplicated.
On AWS, the React client is served from S3 and CloudFront, the Spring Boot API runs in Docker, the database is RDS for PostgreSQL, and uploads go to S3. The API reaches Bedrock through an IAM role, so no AI keys live in the app.
D / Trade-offs
A random check means some fake days slip through. The bet is that never knowing which day will be checked does more than a quiz every day would.
Keeping vectors in Postgres instead of a separate vector store means one database to run and nothing to keep in sync.
E / Outcome
Before building, I ran a feasibility spike on 50 generated questions. Grounding the questions in source material raised the share that tested the actual material from about half to 90% or more.
The full build runs through December 2026.