✨ A curated repository of code recipes, demos, tutorials and resources for basic and advanced Redis use cases in the AI ecosystem. ✨
Getting Started | Demos | Recipes | Tutorials | Integrations | Resources
New to Redis for AI applications? Here's how to get started:
- First time with Redis? Start with our Redis Intro notebook
- Want to try vector search? Check our Vector Search with RedisVL recipe
- Building a RAG application? Begin with RAG from Scratch
- Ready to see it in action? Play with the Redis RAG Workbench demo
No faster way to get started than by diving in and playing around with a demo.
Demo | Description |
---|---|
Redis RAG Workbench | Interactive demo to build a RAG-based chatbot over a user-uploaded PDF. Toggle different settings and configurations to improve chatbot performance and quality. Utilizes RedisVL, LangChain, RAGAs, and more. |
Redis VSS - Simple Streamlit Demo | Streamlit demo of Redis Vector Search |
ArXiv Search | Full stack implementation of Redis with React FE |
Product Search | Vector search with Redis Stack and Redis Enterprise |
ArxivChatGuru | Streamlit demo of RAG over Arxiv documents with Redis & OpenAI |
Redis Movies Searcher | Demo of hybrid search using Java, Spring Boot, and Redis OM |
My Jarvis Alexa Skill | Complete example of an Alexa skill that can recall previously stored conversations and memories to provide contextual responses to users. Utilizes Redis Agent Memory Server, LangChain4J, Terraform, and AWS. It showcases how to implement context engineering to dynamically leverage RAG, tools, short-term and long-term memories. |
Need quickstarts to begin your Redis AI journey?
Retrieval Augmented Generation (aka RAG) is a technique to enhance the ability of an LLM to respond to user queries. The retrieval part of RAG is supported by a vector database, which can return semantically relevant results to a user's query, serving as contextual information to augment the generative capabilities of an LLM.
To get started with RAG, either from scratch or using a popular framework like Llamaindex or LangChain, go with these recipes:
LLMs are stateless. To maintain context within a conversation chat sessions must be stored and re-sent to the LLM. Redis manages the storage and retrieval of message histories to maintain context and conversational relevance.
Recipe | GitHub | Google Colab |
---|---|---|
💬 Message History - LLM message history with semantic similarity | ||
👥 Multiple Sessions - Handle multiple simultaneous chats with one instance |
An estimated 31% of LLM queries are potentially redundant (source). Redis enables semantic caching to help cut down on LLM costs quickly.
Recipe | GitHub | Google Colab |
---|---|---|
🧠 Gemini Semantic Cache - Build a semantic cache with Redis and Google Gemini | ||
🦙 Llama3.1 Doc2Cache - Build a semantic cache using the Doc2Cache framework and Llama3.1 | ||
⚙️ Cache Optimization - Use CacheThresholdOptimizer from redis-retrieval-optimizer to setup best cache config | ||
🎯 Context-Enabled Caching - Context-aware semantic caching with Redis for enhanced LLM performance |
Routing is a simple and effective way of preventing misuse with your AI application or for creating branching logic between data sources etc.
Recipe | GitHub | Google Colab |
---|---|---|
🔀 Basic Routing - Simple examples of how to build an allow/block list router in addition to a multi-topic router | ||
⚙️ Router Optimization - Use RouterThresholdOptimizer from redis-retrieval-optimizer to setup best router config |
AI gateways manage LLM traffic through a centralized, managed layer that can implement routing, rate limiting, caching, and more.
Recipe | GitHub | Google Colab |
---|---|---|
🚪 LiteLLM Proxy - Getting started with LiteLLM proxy and Redis |
Recipe | GitHub | Google Colab |
---|---|---|
👤 Facial Recognition - Build a facial recognition system using the Facenet embedding model and RedisVL |
Recipe | GitHub | Google Colab |
---|---|---|
💳 Credit Scoring - Credit scoring system using Feast with Redis as the online store | ||
🔍 Transaction Search - Real-time transaction feature search with Redis |
A set of Java recipes can be found under /java-recipes.
Need a deeper-dive through different use cases and topics?
🤖 Agentic RAG
A tutorial focused on agentic RAG with LlamaIndex and Cohere |
☁️ RAG on VertexAI
A RAG tutorial featuring Redis with Vertex AI |
🔍 Recommendation Systems
Building realtime recsys with NVIDIA Merlin & Redis |
🧑🏻💻 Redis Movies Searcher Workshop
A hands-on workshop to create the Redis Movies Searcher application |
Redis integrates with many different players in the AI ecosystem. Here's a curated list below:
Integration | Description |
---|---|
RedisVL | A dedicated Python client lib for Redis as a Vector DB |
AWS Bedrock | Streamlines GenAI deployment by offering foundational models as a unified API |
LangChain Python | Popular Python client lib for building LLM applications powered by Redis |
LangChain JS | Popular JS client lib for building LLM applications powered by Redis |
LlamaIndex | LlamaIndex Integration for Redis as a vector Database (formerly GPT-index) |
LiteLLM | Popular LLM proxy layer to help manage and streamline usage of multiple foundation models |
Semantic Kernel | Popular lib by MSFT to integrate LLMs with plugins |
RelevanceAI | Platform to tag, search and analyze unstructured data faster, built on Redis |
DocArray | DocArray Integration of Redis as a VectorDB by Jina AI |
- Vector Databases and Large Language Models - Talk given at LLMs in Production Part 1 by Sam Partee.
- Level-up RAG with RedisVL
- Improving RAG quality with RAGAs
- Vector Databases and AI-powered Search Talk - Video "Vector Databases and AI-powered Search" given by Sam Partee at SDSC 2023.
- NVIDIA RecSys with Redis
- Benchmarking results for vector databases - Benchmarking results for vector databases, including Redis and 7 other Vector Database players.
- Redis Vector Library Docs
- Redis Vector Search API Docs - Official Redis literature for Vector Similarity Search.
- Redis Retrieval Optimizer - Library for optimizing index, embedding, and search method usage within Redis.
We welcome contributions to Redis AI Resources! Here's how you can help:
- Add a new recipe: Create a Jupyter notebook demonstrating a Redis AI use case
- Improve documentation: Enhance existing notebooks or README with clearer explanations
- Fix bugs: Address issues in code samples or documentation
- Suggest improvements: Open an issue with ideas for new content or enhancements
To contribute:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Please follow the existing style and format of the repository when adding content.