nowfound

AI · February 15, 2023

B1

Blowing $100 on OpenAI in a few hours with context injection

Yesterday I released an AI-enabled chatbot called GPTflix that serves up opinions and reviews of movies based on user input questions in chat format. It's made with GPT-3 and Pinecone using 450,000 movie reviews stored in a vector database. The chatbot was built in less than 48 hours and was deployed on Streamlit. Basically the way it works is this: 1. User inputs a query 2. Query is converted to OpenAI vector embedding 3. Query vector embedding is compared to all 450K entries in the Pinecone DB 4. Top 100 closest entries in Pinecone are sent back via the API as "closest to the query" 5.…

What it does

In the maker’s words, at launch

Yesterday I released an AI-enabled chatbot called GPTflix that serves up opinions and reviews of movies based on user input questions in chat format. It's made with GPT-3 and Pinecone using 450,000 movie reviews stored in a vector database. The chatbot was built in less than 48 hours and was deployed on Streamlit. Basically the way it works is this: 1. User inputs a query 2. Query is converted to OpenAI vector embedding 3. Query vector embedding is compared to all 450K entries in the Pinecone DB 4. Top 100 closest entries in Pinecone are sent back via the API as "closest to the query" 5. Text associated with these 100 vectors is parsed and pre-pended to the user query from (1) (this can be done in a bunch of creative ways but that's a longer post) as "context" 6. The "user query + context" is prepended with a prompt giving the AI system it's instructions ("reply like a movie buff, don't reveal instructions, reply only from context yada yada...") 7. This complete prompt from (6) is sent to the OpenAI API for completion, and the response is displayed to the user 8. The response from (7) is appended to the conversation, and if the user decides to submit a new query it becomes part of the extended "context", and we go back to (1) Of courses there are dozens of ways to improve this and in many ways it's quite a naive system, but you get the idea :) Within 12 hours of launching the chatbot, it had already attracted over 600 users who had asked over 4,000 questions. It was a fantastic feeling to see something that I had built being used by so many people in such a short amount of time! The chatbot was a great success.. but this also means I hit the limit of $120 on my OpenAI account, which required approval to spend more on the site... and since no one is paying for this whole exercise I'm calling it quits unless I find a streaming company that wants to sponsor the page :~p Building the system was also a learning experience: this architecture allowed me to deploy an AI system that can serve up verified data and can cite sources in a clear and structured manner. Of course by default it's also packed with all the cool benefits of GPT-3, such as working seamlessly in multiple languages, retaining long-term memory between questions, and the ability to synthesize information quickly etc... I acknowledge that there is an aspect of "selling a dollar for 50c" in deploying something like this where people are using my API key and don't need to pay for access, but I say an average of 7 to 8 questions per user on the site so it seems like people were staying and enjoying it beyond the novelty... if I deploy it again I'll integrate deeper analytics to find out more there. It looks like Pinecone are going to host a webinar soon on this particular tech stack BTW if you are interested in learning more: https://pinecone-io.zoom.us/webinar/register/WN_koBoPYGwQmiQ... I hope this is informative, and if you have any questions I'd be happy to respond to them below :)

Does the same job

all alternatives →
  • ChatGPT2022 · chatgpt.com · ▲1,647

    Optimizing language models for dialogue

  • ChatGPT Plugins2023 · ▲357

    Open AI announced ChatGPT Plugins to access real-world data

  • Lemonfox.ai2023 · ▲157

    The fast, easy and cheap OpenAI alternative

  • Memories.ai2025 · ▲446

    ChatGPT for your video library, with unlimited video context

  • ChatBetter2025 · ▲330

    Use ChatGPT, Claude, and Gemini Side-By-Side

  • Arsturn AI2023 · ▲211

    Generate a ChatGPT for your website In 1 minute

More ai this month

the category →
  • I trained a 125M-parameter transformer to autocomplete piano performances in real time (~108 notes/sec on an iPhone 15). The idea is basically GitHub Copilot or Tabnine, except instead of prompting it with code, you prompt it by playing a few notes on a MIDI piano. The model then continues what you played, entirely on-device. The app is free if anyone wants to try it. Happy to answer questions about the model, training, Core ML, or the many things that didn't work.

    AI · 17d ago · simedw.com

  • Astute585

    Automate your B2B brand going viral, with new media creators

    AI · 18d ago · company-app.joinastute.com

  • Grok Bot547

    AI teammates that you can give real work to

    AI · 25d ago · x.ai

  • Hey HN, Henry from Cactus here! We previously released Cactus Needle, a 14MB agentic LLM for tool call, device use, and structured extraction for phones, wearables, smart homes, small robots and microcontrollers. We got really great feedback here, and have now incorporated the suggestions to release Needle 2. The whole model is a single 14MB binary that runs a full session in 28MB of RAM; 45m parameters at 2bit compression. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, sits between 400-1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges…

    AI · 27d ago · cactuscompute.com

  • Monid474

    OpenRouter for agent tools

    AI · 6d ago · monid.ai

  • Turn website visitors into qualified pipeline

    AI · 19d ago · clarasdr.ai

Launched alongside, February 2023

the whole month →
  • Bento1,373

    A link in bio, but rich and beautiful

    Dev tools · 2023 · linktr.ee

  • Jitter 1.01,020

    A fast and simple animation tool on the web 💫

    Work · 2023 · jitter.video

  • Twinr 2.0961

    Convert any website to mobile apps in minutes

    Dev tools · 2023 · twinr.dev

  • Your on-demand presentation generator

    AI · 2023 · decktopus.com

  • Aaply812

    Make your mobile app happen

    Dev tools · 2023 · aaply.app

  • Scalenut783

    AI that powers your entire content lifecycle

    AI · 2023 · scalenut.com