TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

5 点作者 stephanst超过 2 年前
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&#x27;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.<p>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 &quot;closest to the query&quot; 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&#x27;s a longer post) as &quot;context&quot; 6. The &quot;user query + context&quot; is prepended with a prompt giving the AI system it&#x27;s instructions (&quot;reply like a movie buff, don&#x27;t reveal instructions, reply only from context yada yada...&quot;) 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 &quot;context&quot;, and we go back to (1)<p>Of courses there are dozens of ways to improve this and in many ways it&#x27;s quite a naive system, but you get the idea :)<p>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!<p>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&#x27;m calling it quits unless I find a streaming company that wants to sponsor the page :~p<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&#x27;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...<p>I acknowledge that there is an aspect of &quot;selling a dollar for 50c&quot; in deploying something like this where people are using my API key and don&#x27;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&#x27;ll integrate deeper analytics to find out more there.<p>It looks like Pinecone are going to host a webinar soon on this particular tech stack BTW if you are interested in learning more: <a href="https:&#x2F;&#x2F;pinecone-io.zoom.us&#x2F;webinar&#x2F;register&#x2F;WN_koBoPYGwQmiQ-4d52W7kqA?_hsmi=2&amp;utm_content=2&amp;utm_medium=social&amp;utm_source=twitter&amp;hss_channel=tw-1287624141001109504" rel="nofollow">https:&#x2F;&#x2F;pinecone-io.zoom.us&#x2F;webinar&#x2F;register&#x2F;WN_koBoPYGwQmiQ...</a><p>I hope this is informative, and if you have any questions I&#x27;d be happy to respond to them below :)

3 条评论

carolinefrasca大约 2 年前
Just increased the resources for the Streamlit app - feel free to shoot me an email at caroline.frasca@snowflake.com if you&#x27;re still looking for sponsors.
stephanst超过 2 年前
And... it&#x27;s back online, supported by Ben&#x27;s Bites, my favorite AI newsletter! <a href="https:&#x2F;&#x2F;bensbites.beehiiv.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bensbites.beehiiv.com&#x2F;</a>
stephanst超过 2 年前
url forwarding is broken, you can use <a href="https:&#x2F;&#x2F;www.gptflix.ai" rel="nofollow">https:&#x2F;&#x2F;www.gptflix.ai</a>