FlowGen
Scalable AI-powered learning pipelines
The problem FlowGen solves
Creating structured learning content using AI is expensive, slow, and difficult to scale when handled synchronously. Most systems attempt to generate all content upfront, leading to high latency, unnecessary computation, and poor user experience under load.
FlowGen enables users to quickly generate structured courses from a simple topic prompt without blocking the user on heavy AI computation. It separates user interaction from content generation by using an asynchronous, queue-driven architecture.
Lessons are generated lazily in the background, and only prioritized when a user actively requests them. This makes learning content generation faster for users, reduces AI cost, and allows the system to scale efficiently by processing workloads in the background.
FlowGen can be used to rapidly create personalized learning paths, explore new topics without manual research, and deliver AI-generated education in a way that remains responsive and production-ready under real-world traffic.
Challenges I ran into
One of the main challenges was designing a system that could generate AI-based content without blocking user requests or overwhelming the backend under load. Initially, lesson generation was implemented synchronously, which caused high latency and made the system unsuitable for scale.
To solve this, I re-architected the backend around asynchronous job queues using Redis and BullMQ. This required restructuring API flows, introducing background workers, and handling job lifecycle states such as pending, generating, and completed. Managing job deduplication and ensuring that the same lesson was not generated multiple times under concurrent requests was another challenge, which was addressed using deterministic job IDs.
Another hurdle was handling priority inversion — ensuring that background lesson generation did not delay lessons actively requested by users. This was solved by introducing priority-based execution within the lesson queue, allowing user-triggered jobs to preempt background work.
Finally, integrating a managed Redis service securely during local development introduced connectivity issues, which were resolved by properly configuring TLS connections and environment variables. These challenges helped reinforce the importance of system design, fault isolation, and operational correctness when building scalable backend systems.
Technologies used