Building a RAG-Powered Study App: Laravel + Python Microservices
How I combined Laravel, FastAPI, Celery, Qdrant, and OpenAI into an AI study platform: what worked, what didn’t, and the chunking problem nobody warns you about.
Software Engineer
Hi there 👋, I'm a software engineer based in Italy with a deep interest in AI coding Agents, web applications and management software.
My stack include JavaScript, PHP and Laravel ecosystem, Vue.js, React, Python, Docker, Podman, Linux, Bash, REST APIs and Git. I also enjoy exploring AI Generative LLMs.
One of my current projects is LongTermMemory, an AI-powered study platform built on LLM and Vector DB (a RAG application) that generates customized Study Plans with auto-generated Q&A and scheduled Active Recall. All runs as a containerized microservices architecture orchestrated with Docker Compose.
Business site: alessandrofuda.it
How I combined Laravel, FastAPI, Celery, Qdrant, and OpenAI into an AI study platform: what worked, what didn’t, and the chunking problem nobody warns you about.
No passwords, no reset flows, no bcrypt. Just an email, a signed URL, and a Sanctum token. Here’s how to implement magic link authentication in Laravel 12 from scratch — including the edge cases that bite you in production.
A user double-clicks “Generate Study Plan”. Two parallel Celery workers start processing the same project simultaneously, doubling OpenAI costs and writing duplicate Q&A pairs to the database. Here’s how to fix it with a Redis index key — and why TTL alone isn’t enough.
The problem sounds simple: send a study reminder email at 8 AM. The catch is that your users live in Tokyo, Rome, New York, and Nairobi. Here’s how to build a Laravel artisan command that fires for every user at their local 8 AM — including the N+1-avoidance pattern, the deduplication scheme, and the rate-limit stagger that keeps the email provider happy.
React SPAs are nearly invisible to social media crawlers and slower to index on Google. Here’s how I solved SEO for LongTermMemory without migrating to Next.js — using a two-variant routing pattern and a Puppeteer script that prerenders the landing page at build time.
Spaced repetition is the most evidence-backed technique for long-term memorization. Here’s how to go from the original SM-2 paper to a working Laravel implementation — including the scheduling logic, timezone handling, strict mode, and the honest parts where this diverges from full SM-2.
Fixed-size chunking splits text at arbitrary token boundaries, cutting mid-sentence and blending unrelated topics into the same chunk. Here’s how to build a two-stage pipeline with LlamaIndex — structural splitting first, semantic coherence second — and why adaptive sizing matters for long documents.