02 · Presidio PRIME internship · 2026
StudyFlow AI
A study-group platform where the AI answers only from the notes you uploaded, cites the file and page, and refuses to be talked out of its instructions.
- 14/15
- answer recall in the offline RAG eval
- 15/15
- faithfulness
- 20/20
- prompt-injection attacks blocked

Try it live
See how it works.
Launch film
FilmA short launch film made in Remotion. Figures shown are the project's measured results.
Run the real code
RealReal: the guardrail and retrieval code from the repo. Not real: answers here are the retrieved passages, not text written by the model.
Run StudyFlow's real guardrail and retrieval
Starts Python in your browser (about 6 MB) and loads the real files from the repo. The embedding model (about 23 MB) loads in the background.
Real: StudyFlow's own injection.py and injection_eval.py run unchanged in Python (Pyodide, CPython compiled to WebAssembly). Retrieval uses the same all-MiniLM-L6-v2 model over the real eval PDF (os_notes.pdf), chunked 1000/200, top-3, 0.45 relevance gate. Answers are extractive, as in the offline eval; the hosted app sends them to an LLM.
The real app
RealThe deployed app: groups, notes, Ask AI with citations, sessions, quizzes and flashcards.
Under the hood
How it works.
Step by step, from the first input to what you see.
Three services behind one gateway
nginx routes /auth to a Spring Boot service (JWT in an HttpOnly cookie), groups, sessions and notes to a FastAPI study service, and AI work to a FastAPI ai-service. Postgres has a database per service.
- nginx
- Spring Boot
- FastAPI
- PostgreSQL
Notes become searchable
Uploads are extracted with PyMuPDF, split into 1,000-character chunks with 200 overlap, embedded with all-MiniLM-L6-v2 and stored in a per-group FAISS index. Emails and phone numbers are masked first.
- PyMuPDF
- MiniLM
- FAISS
The guardrail runs first
Before any agent sees a message, six regex rule families check for instruction overrides, identity hijacks, fake system roles, fake delimiters, prompt exfiltration and restriction bypass.
- guardrails
Four agents route the question
A LangGraph coordinator sends each intent to a resource agent (what is indexed), a RAG agent (answer from notes) or a scheduler agent (study plans), capped at 6 steps.
- LangGraph
Grounded answers or none
RAG keeps the top 3 chunks and a 0.45 relevance gate. Every sentence of the answer must be supported by a chunk; otherwise it says it couldn't find it in your notes.
- RAG
- grounding
Shipped on AWS
During the internship it ran on ECS Fargate with RDS PostgreSQL and S3 + CloudFront, provisioned with 13 Terraform modules and GitHub Actions CI. The model moved from Llama 3.1 8B to gpt-oss-20b. Today it runs on a single Oracle Cloud VM; the AWS Terraform is kept in the repo as an alternative deployment.
- Terraform
- ECS Fargate
- CloudFront

Honest notes
What broke, and what changed
The load test found two bottlenecks
At 1,200 to 1,600 concurrent users the nginx gateway capped at about 500 requests in flight and the study service ran a single Python worker that saturated one CPU core. The gateway now allows 8,192 connections and the service runs 4 workers. Errors stayed at 0% at every level tested.
Crashed jobs left the UI spinning
A restart in the middle of a summary or quiz left the job pending forever. Generation jobs now carry a lease; any job orphaned for 10 minutes is marked failed and the screen offers Try again.
The model invents words the app doesn't know
When asked for a plan, the model sometimes returned activity types like "lecture" or "exercise". Instead of failing the plan, the output is normalised to the types the app supports before it is saved.
AI speed is capped by the model quota, not the servers
Chat, summaries, quizzes and plans share one Groq account's per-minute and per-day limits. A rate-limited call retries once, then fails over to the next configured key. The load numbers measure the dashboard, not the AI.
Built with
- React
- TypeScript
- Spring Boot
- FastAPI
- LangGraph
- FAISS
- PostgreSQL
- Terraform
- AWS