Gettin’ quizzy with it
Quick building forays into the world of Gen AI — my very first Gen AI Apps!
It’s been a while since I last posted here, but I haven’t been inactive! Some changes in my personal and professional life notwithstanding, I’m still here to post occasional articles and geekery!
TL ; DR
I made a quiz app! This was born out of the what I saw as an absence of a connect-based quiz generator and the urge to dip my toes in the Gen AI dev-space and build something.
For the whole picture, read on…
The state of Play
The past few months have seen what future tech historians will probably call a Cambrian explosion of AI models, products and services. The fingerprints of Generative AI seem to have made their way into every facet of life. While top notch consumer-facing AI products have emerged of late (the likes of Perplexity and Napkin comes to mind), I feel that the wave of truly creative products is yet to break upon us but all of the ingredients for bringing this about are now at our fingertips— a plethora of AI models, myriad cloud hosting options and supercharged code-dev assistants that have greatly reduced the barrier to entry for developers. Indeed, if there’s anything that the recent Deepseek saga has taught us, it’s that the real payoff in this space isn’t in generating incrementally newer and better AI models (though nation-states and large organisations will increasingly look to do this for various reasons) but in the application layer upon these models where the creative-minded can build and serve to the world. It isn’t just the tech enthusiasts getting in on this — companies like Lovable promise to help just about anyone build AI powered apps. I for one think that the gallons of AI slop that will inevitably be generated will be worth it!
There’s something to be said for the act of building, of creating something of value that will be used by others — something that I’ve only briefly experienced when I’ve tinkered in my garage with 3d printing toys and covid face shields in the past — that I decided to dip my toes back into it. Thanks to the easy availability and integration of OpenAI’s model API’s into various code frameworks such as LangChain, along with easy to use python based webapp dev tools like streamlit and effortless cloud hosting solutions — even a naive data scientist like myself could have a go at creating webapps for a few dollars a month. What a time to be alive!
First steps: RAGtime tunes!
RAG or Retrieval Augmented Generation is now one of the most popular techniques in Generative AI, and for good reason — it allows users and organisations to leverage their knowledge base (documents, codebases, basically any textual or even tabular data) along with the power and versatility of readily available Large Language Models out there. It was hence fitting that the first AI based app I created was a RAG-based exam prep tool for my wife for one of her (many!) upcoming Medical exams. She wanted a tool that would create Q-and-A flash cards that she could use to help in her revision, and found the existing commercial offerings in the market not to her satisfaction. This seemed a perfect use-case for a simple RAG app which I found I was able to put together in just a few hours despite having no previous app-dev experience per se. For those who want the gory details — I used LangChain’s easy to use (but sometimes too abstracted!) framework on top of OpenAI’s models, served with a streamlit front-end and hosted using GCP’s Cloud Run (note — this app is now hosted on streamlit’s community cloud). The entire repo was just a couple of hundred lines of code.
For those interested, here’s the app!
Get Sid Ravichandran’s stories in your inbox
Join Medium for free to get updates from this writer.
Here’s the general flow:
- Create the Vector Store: User upload of documents to create a knowledge base, from which a vector store is created. I went for an in-memory store for ease of maintenance, but there are many easy to use managed ones out there like Weaviate that integrate well into LangChain
- Add/generate questions: User to add questions to the question-bank, along with a topic tag. The user can also choose to have the model create some questions in a given topic to add to the question bank.
- Generate Answers: For each question in the bank, the model generates the answer as per a well defined prompt that specifies for example the word limit, number of bullet points, etc. that a good answer should have. The prompt can be as detailed as required — for example inclusion of certain criteria in the answers.
- Flash cards: Once a sizable bank of questions and topics has been created, the user can choose to have a random question selected and flashed up from a particular topic. The user can then choose to reveal the answer and evaluate themselves with a simple score for how well they answered it. They also have the option of editing and saving the generated answer if they choose. The visually attractive aesthetic and style of this awesome flashcard app was used as my inspiration.
- Study timeline: Using the results from the user’s self-evaluation of scores from the different topics, a study timetable is created for the following weeks
Nerd time: Gettin’ Quizzy with it
A longtime quizzing enthusiast, I lov e how recalling trivia for quizzes was often an inadvertent window into the little hidden facets of the world around us. In my mind the best sort of quizzes don’t just ask but tease out linkages and connections between what often seem like disparate bits of trivia. For this reason quizzes bring people together — for example my colleagues and I often like to do a little quiz in our lunch breaks. I found that despite there being various quiz sites out there, none of them let you generate questions that are theme or connection focused. Necessity being the mother of tinkering, I decided to give it a shot — and QuizBob was born!
In many ways a simpler app than the flashcard app, this used OpenAI’s vanilla python API without the need for a framework such as LangChain. At the heart of it is prompt engineering — an accurately worded prompt that stitches together the inputs from the user to create a quiz question and answer. Using the flashcard style I described earlier, the question is served to the user, who tries to answer the question first before revealing the answer and a score of how off the mark they were! Building this app was fun, but using it is surprisingly interesting as the connections between seemingly disparate persons, places or events is revealed. Ultimately all the knowledge of the world is often the best quizmaster in itself!
Closing Out
If you made it this far, thanks for sticking around! I would be amiss to end this without paying some sort of homage to the various tools out there in the past few years that have made developing and hosting such apps so delightfully easy — streamlit for creating snazzy apps, GCP cloud run or streamlit community cloud for allowing code to be run on the cloud with literally just a few clicks of the mouse (CI/CD pipelines included!) and of course the fast developing ecosystem of LLM’s and frameworks such as LangChain.
What cool apps have you made recently, or would like to bring to my attention? Do let me know!








