Short Story Generator RAG Model
A RAG Model that leverage the capabilities of cutting edge models trained on a wide variety of short stories to generate high quality storytelling.
Machine Learning
AI
Python

Project Overview
Project Type: Storyteller Empowered
Technologies Used: Python, PyTorch, TensorFlow, OpenSource Models, Gemini API, Pinecone
Timeline: 4 weeks (Summer 2024)
My Role: Lead Designer and Coder
This project demonstrates a Retrieval-Augmented Generation (RAG) model built to leverage the power of Google's Gemini, LlamaIndex, and Pinecone. The goal was to create a system that can not only generate text but also ground its responses in a specific body of knowledge.
The core of the project involves a pipeline that takes raw data—in this case, Edgar Allan Poe's short stories—and prepares it for a large language model. First, I preprocess the stories, splitting them into manageable chunks to capture relevant context. Next, I use the Gemini text-embedding-004 model to convert these chunks into numerical representations called embeddings. These embeddings are then stored in a Pinecone vector database, which is a highly efficient way to store and search through thousands of data points.
By integrating LlamaIndex, I can connect the Gemini 1.5 Pro LLM to the Pinecone database. When a user submits a query, the system first retrieves the most relevant story chunks from Pinecone. This context is then fed to the Gemini model, allowing it to generate a response that is more accurate and directly informed by the source material. This approach goes beyond simple text generation, showcasing how a model can "learn" from a custom dataset to produce more intelligent and tailored outputs.
How to Access:
Live Demo: https://colab.research.google.com/drive/1PEDzm7MT-iS3HOodLv_SOEOWGVuU978z?usp=sharing
Github: TBD.