June 2024 Summaries
3 posts from Upstash
Filter
Month:
Year:
Post Summaries
Back to Blog
Retrieval-Augmented Generation (RAG) is a cutting-edge framework in natural language processing that enhances chatbots by combining retrieval-based and generation-based methods for more accurate and contextually relevant responses. The blog post provides a detailed guide on building a RAG chatbot using Mistral AI's 7B model on Ollama as the language model and Upstash Vector as the retriever, both deployed on Fly.io. The process involves creating a serverless vector database with Upstash Vector, deploying the LLM on Fly.io using Ollama, and developing a Next.js application for the chatbot's user interface. The chatbot API is implemented using LangChain and Vercel AI SDK to handle message streaming and responses. The guide culminates in deploying the chatbot on Fly.io, demonstrating a basic, proof-of-concept application that can be expanded with improved resources and UI.
Jun 14, 2024
3,005 words in the original blog post.
The blog post discusses an intriguing bug in Redis Streams, focusing on its implications and the author's experience with their own Redis implementation at Upstash. The author introduces the issue with Redis Streams' lag reporting, noting that discrepancies arose when users reported incorrect lag values in QStash, a messaging solution built on their Redis implementation. The problem is traced to differences between QStash's lag calculation and Redis's definition, highlighting a bug in Redis version 7.2.4 where the reported lag doesn't match the specification after certain entries are deleted. The author describes their testing process using miniredis, a Go-based test environment for Redis, and the challenges of aligning with Redis's behavior despite its inconsistencies. They explain that the bug causes Redis to report an incorrect lag value, which should be NULL according to the specification when certain conditions are met. The author proposes a solution of resetting the entries-read counter to align with entries-added to maintain logical consistency. The post concludes with an update on a quick-fix from the Redis team and an invitation for feedback and discussion on Discord.
Jun 11, 2024
1,964 words in the original blog post.
Upstash Ratelimit can be integrated into LangChain applications to manage the frequency and cost of requests when using Large Language Models (LLMs), which are powerful yet expensive tools. By using Upstash Ratelimit, developers can control the number of chain invocations and tokens processed over a specified time period. This involves installing the necessary packages, setting up environment variables, and configuring a rate limiter using Redis to store request counts. The rate limiter can be applied to mock chains in LangChain using callbacks such as UpstashRatelimitHandler, which allows for configurations like fixed-window rate limiting and token-based rate limiting. The setup ensures that applications remain affordable while efficiently managing LLM usage, with detailed configurations and adaptations available through the LangChain and Upstash documentation.
Jun 10, 2024
748 words in the original blog post.