Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    Build a RAG App in Under 20 Min | DataStax

    blog thumbnail

    Introduction

    Hello everyone, my name is Carter Rasa, and I have the privilege of serving the Developer Relations team here at DataStax. I use he/him pronouns and am originally from Seattle, Washington. The weather here is much nicer than in Seattle, and I’m excited to share some insights with you today.

    As a full-stack developer with over 20 years of experience, I consider myself an "okay" developer. While there are incredibly brilliant folks in our community, the focus is on democratizing AI access for developers. We must ensure that AI can be utilized by more developers to build useful applications. With the rise of tools like chatGPT, user expectations for software have changed dramatically across varied demographics, from teenagers to seniors.

    The question for developers now is how we can build smart and intelligent applications that respond to this shift. One promising approach is RAG (Retrieval-Augmented Generation), which allows developers to create intelligent applications with available resources, even without deep expertise in AI.

    Building Movies Plus+

    Today, I’ll build a demo app inspired by Netflix, dubbed "Movies Plus+". This will involve using data from a site called The Movie Database (TMDb) and creating a more engaging user experience.

    Initial Setup

    I’ll begin with a Python script that consists of about 63 lines of code. This script will scrape web pages for movie info and load the data into my vector database. The key imports include the Data API client for Astra, which is DataStax's vector database, and an external library for loading unstructured data from URLs.

    Upon execution, this script opens a JSON file containing a list of movie URLs, initializes Astra DB, and loops through the JSON to scrape and load the movie content. The unstructured library helps to pull relevant narrative text from these pages.

    Once the data is ingested, I can check the Astra DB for records, revealing around 976 entries. Each entry has a "vector" property that represents a mathematical language for meaning embedded in a format understood by language models.

    The cool part? The Astra DB's “vectorize” feature eliminates the need for a two-step process. Instead of calculating embeddings in a separate function, I can directly specify the content for it to compute in the database.

    Building the Application

    Next, I’ll transition to Langflow, our AI application tool. Using an existing template called "Vector Store RAG," I’ll focus on the interactive part and set up a chat component which will serve as the search input. The user's query will trigger a search in the Astra database.

    In my flow, I’ve switched the embedding service to Nvidia, as we had trained our data with it. After processing and tweaking some parameters, I'll test my application by querying for “big scary monsters.”

    When running the query, I receive relevant results back, confirming my app works! Tweaking further to return 20 results yields even better outcomes, and the application is robust and ready.

    Delivering the App

    Now that I’m satisfied with the functionality, how do I turn this into a full-fledged application? By integrating it with a Next.js app hosted on Vercel, I can spin up a local server that connects to my Langflow API server in the cloud.

    Once that’s done, I access the Movies Plus+ interface, where I can input queries like "movies featuring large monsters." Upon submission, the app fetches results.

    However, we want more than a simple chatbot interface. With advancements in generative UI techniques, I can improve the user experience substantially. For example, once I ask the app to visualize results, it provides an interactive UI showing movies like "The Meg." Users can click on options to see more details or even play trailers — an engaging experience that feels closer to a real application.

    The potential for innovation with AI and generative UI is incredibly exciting! Upon reflecting on the developments shared at a recent OpenAI Community Meetup, it's clear that the focus is on empowering developers to build impactful applications without relying on the most expensive tools.

    In conclusion, I hope you realize the vast possibilities ahead, and I encourage everyone to roll up their sleeves and start coding.

    Before we wrap up, I invite you all to take a short break. We’ll reconvene shortly for the next track, so grab a drink and recharge.


    Keywords

    • AI Development
    • Democratization
    • RAG (Retrieval-Augmented Generation)
    • DataStax
    • Movies Plus+
    • Astra DB
    • Langflow
    • Generative UI
    • Python Scripting
    • User Experience

    FAQ

    Q: What technologies are used in building the Movies Plus+ app?
    A: The app utilizes Python for scripting, Astra DB for the vector database, and Langflow for AI application development alongside a Next.js front end.

    Q: What is RAG, and why is it important?
    A: RAG stands for Retrieval-Augmented Generation, an approach that allows developers to create intelligent applications with available resources, making AI tools more accessible.

    Q: Can non-expert developers use these tools?
    A: Yes! The emphasis is on making AI and application building tools democratized, enabling developers of all skill levels to create effective solutions.

    Q: What is generative UI?
    A: Generative UI refers to new techniques and frameworks that allow developers to create interactive and dynamic user interfaces that enhance user experiences.

    Q: How can I start building my own AI applications?
    A: Begin by experimenting with the tools and libraries mentioned, such as Langflow and Astra DB, to create a variety of intelligent applications.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like