Home

Awesome

VectorDB-recipes

<br /> Dive into building GenAI applications! This repository contains examples, applications, starter code, & tutorials to help you kickstart your GenAI projects. <img src="https://github.com/lancedb/vectordb-recipes/assets/5846846/d284accb-24b9-4404-8605-56483160e579" height="85%" width="85%" /> <br /> Join our community for support - <a href="https://discord.gg/zMM32dvNtd">Discord</a> • <a href="https://twitter.com/lancedb">Twitter</a>

This repository is divided into 2 sections:

The following examples are organized into different tables to make similar types of examples easily accessible.

Sections

🌟 New 🌟

Build from Scratch

Build applications/examples using LanceDB for efficient vector-based document retrieval.

Build from Scratch    Interactive Notebook & Scripts  
Build RAG from ScratchOpen In Colab LLM beginner
Local RAG from Scratch with Llama3Python local LLM beginner
Multi-Head RAG from ScratchPython LLM local LLM beginner

MultiModal

Create a multimodal search application using LanceDB for efficient vector-based retrieval of text and image data. Input text or image queries to find the most relevant documents and images from your corpus.

Multimodal    Interactive Notebook & Scripts  Blog
Multimodal CLIP: DiffusionDB<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multimodal_clip_diffusiondb/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python LLM beginnerGhost
Multimodal CLIP: Youtube videos<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multimodal_video_search/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python LLM beginnerGhost
Cambrian-1: Vision centric exploration of imagesKaggle LLM intermediateGhost
Multimodal Jina CLIP-V2 : Food Search <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multimodal_jina_clipv2/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python beginner

RAG

Develop a Retrieval-Augmented Generation (RAG) application using LanceDB for efficient vector-based information retrieval. Input text queries to retrieve relevant documents and generate comprehensive answers by combining retrieved information.

RAG    Interactive Notebook & ScriptsBlog
RAG On PDF<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/RAG-On-PDF/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginner
RAG with Contextual Retrieval and Hybrid search<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Contextual-RAG/Anthropic_Contextual_RAG.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
RAG with Matryoshka Embeddings and LlamaIndex<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/tutorials/RAG-with_MatryoshkaEmbed-Llamaindex/RAG_with_MatryoshkaEmbedding_and_Llamaindex.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediate
RAG with IBM Watsonx<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/RAG-with-watsonx/Watsonx_example.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM watsonx LLM beginner
Improve RAG with Re-ranking<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/RAG_Reranking/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginnerGhost
Instruct-Multitask<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/instruct-multitask/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python LLM beginnerGhost
Improve RAG with HyDE<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Advance-RAG-with-HyDE/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
Improve RAG with LOTR <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Advance_RAG_LOTR/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
Advanced RAG: Context Enrichment Window<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Advanced_RAG_Context_Enrichment_Window/Advanced_RAG_Context_Enrichment_Window.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
Advanced RAG: Late Chunking<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Advanced_RAG_Late_Chunking/Late_Chunking_(Chunked_Pooling).ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
Advanced RAG: Parent Document Retriever<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/parent_document_retriever/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
Corrective RAG with LanggraphOpen In Colab LLM intermediateGhost
Contextual-Compression-with-RAGOpen In Colab local LLM intermediateGhost
Improve RAG with FLAREOpen In Colab local LLM LLM advancedGhost
Agentic RAG <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/tutorials/Agentic_RAG/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM advanced
GraphRAG <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Graphrag/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost
GraphRAG with CSV File <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/tutorials/GraphRAG_CSV/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediateGhost

Vector Search

Build a vector search application using LanceDB for efficient vector-based document retrieval. Input text queries to find the most relevant documents from your corpus.

Vector Search    Interactive Notebook & Scripts  Blog
Inbuilt Hybrid Search<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Inbuilt-Hybrid-Search/Inbuilt_Hybrid_Search_with_LanceDB.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginner
Hybrid search BM25 & lancedb <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Hybrid_search_bm25_lancedb/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginnerGhost
NER powered Semantic SearchOpen In Colab local LLM beginnerGhost
Vector Arithmetic with LanceDB<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Vector-Arithmetic-with-LanceDB/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginnerGhost
Summarize and Search Reddit Posts<a href="https://github.com/lancedb/vectordb-recipes/blob/main/examples/Reddit-summarization-and-search/subreddit_summarization_querying.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> beginner
Imagebind demo app<a href="https://huggingface.co/spaces/raghavd99/imagebind2"><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.svg" alt="hf spaces" style="width: 80px; vertical-align: middle; background-color: white;"></a> intermediate
Search Within ImagesOpen In Colab local LLM intermediateGhost
Zero Shot Object Detection with CLIP<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/zero-shot-object-detection-CLIP/zero_shot_object_detection_clip.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> intermediate
Vector Search with TransformersJSJS LLM advanced
Accelerate Vector Search Applications Using OpenVINOOpen In Colab local LLM advancedGhost

Chatbot

Create a chatbot application using LanceDB for efficient vector-based response generation. Input user queries to retrieve relevant context and generate coherent, context-aware replies.

Chatbot    Interactive Notebook & Scripts  Blog  
Databricks DBRX Website BotPython Databricks LLM beginner
CLI-based SDK Manual Chatbot with PhidataPython local LLM beginner
Youtube transcript search bot<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Youtube-Search-QA-Bot/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python JS LLM intermediate
Langchain: Code Docs QA bot<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Code-Documentation-QA-Bot/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python JS LLM intermediate
Chatbot with any website using Crawl4AI <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/CrawlerQ&A_website/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python LLM beginner
Context-Aware Chatbot using Llama 2 & LanceDBOpen In Colab local LLM advancedGhost

Evaluation

Develop an evaluation application. Input reference and candidate texts to measure their performance on various metrics.

Evaluation    Interactive Notebook & Scripts  Blog
Evaluating RAG with RAGAs<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Evaluating_RAG_with_RAGAs/Evaluating_RAG_with_RAGAs.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediate

AI Agents

Design an AI agents coordination application with LanceDB for efficient vector-based communication and collaboration. Input queries to enable AI agents to exchange information, coordinate tasks, and achieve shared goals effectively.

AI Agents    Interactive Notebook & Scripts  Blog
AI email assistant with Composio<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/AI-Email-Assistant-with-Composio/composio-lance.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginner
Assitant Bot with OpenAI Swarm<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/assistance-bot-with-swarm/assitant_bot_with_swarm.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediate
AI Trends Searcher with CrewAI<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/AI-Trends-with-CrewAI/CrewAI_AI_Trends.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM beginnerGhost
SuperAgent Autogen<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/SuperAgent_Autogen/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM intermediate
AI Agents: Reducing Hallucination<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/reducing_hallucinations_ai_agents/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python JS LLM advancedGhost
Multi Document Agentic RAG<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multi-document-agentic-rag/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> LLM advancedGhost

Recommender Systems

Create a recommender system application with LanceDB for efficient vector-based item recommendation. Input user preferences or item features to generate personalized recommendations and enhance user experience.

Recommender SystemsInteractive Notebook & Scripts  Blog
Movie Recommender<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/movie-recommender/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python beginner
Product Recommender<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/product-recommender/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python intermediate
Arxiv paper recommender<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/arxiv-recommender/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> Python LLM beginner
Music Recommender<a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/applications/Music_Recommandation/lancedb_music_recommandation.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> intermediate

Concepts

Checkout concepts of LLM applications pipeline to ensures accurate information retrieval.

ConceptsInteractive NotebookBlog
A Primer on Text Chunking and its TypesOpen In Colab beginnerGhost
Langchain LlamaIndex ChunkingOpen In Colab beginnerGhost
Create structured dataset using InstructorPython beginner
Comparing Cohere Rerankers with LanceDBbeginnerGhost
Product Quantization: Compress High Dimensional VectorsintermediateGhost
LLMs, RAG, & the missing storage layer for AIintermediateGhost
Fine-Tuning LLM using PEFT & QLoRAOpen In Colab local LLM advancedGhost
Extracting Complex tables-text from PDFs using LlamaParse Open In Colab LLM LlamaCloud beginner
Convert any Image dataset to lance FormatOpen In Colab advancedGhost

Projects & Applications

These are ready to use applications built using LanceDB serverless vector database. You can explore these open source projects, use parts of them in your projects or build your applications on top of these.

Node applications powered by LanceDB

Project NameDescriptionScreenshot
Writing assistantWriting assistant app using lanchain.js with LanceDB, allows you to get real time relevant suggestions and facts based on you written text to help you with your writing.Writing assistant
Sentence auto completeSentance auto complete app using lanchain.js with LanceDB, allows you to get real time relevant auto complete suggestions and facts based on you written text to help you with your writing.You can also upload your data source in the form of a pdf file.You can switch between gpt models to get faster results.Sentance auto complete
Article RecommendationArticle Recommender: Explore vast data set of articles with Instant, Context-Aware Suggestions. Leveraging Advanced NLP, Vector Search, and Customizable Datasets, Our App Delivers Real-Time, Precise Article Recommendations. Perfect for Research, Content Curation, and Staying Informed. Unlock Smarter Insights with State-of-the-Art Technology in Content Retrieval and Discovery!".Article Recommendation
Project NameDescriptionScreenshot
YOLOExplorerIterate on your YOLO / CV datasets using SQL, Vector semantic search, and more within secondsYOLOExplorer
Website Chatbot (Deployable Vercel Template)Create a chatbot from the sitemap of any website/docs of your choice. Built using vectorDB serverless native javascript package.Chatbot
Chat with multiple URL/website Conversational AI for Any Website with Mistral,Bge Embedding & LanceDBwebui_aa
Talk with Podcast Talk with Youtube Podcast using Ollama and insanely-fast-whisperdemo
Hr chatbot Hr chatbot - ask your personal query using zero-shot React agent & toolsimage
Advanced Chatbot with Parler TTS This Chatbot app uses Lancedb Hybrid search, FTS & reranker method with Parlers TTS library.image
Multi-Modal Search EngineCreate a Multi-modal search engine app, to search images using both images or textSearch
Multimodal Myntra Fashion Search EngineThis app uses OpenAI's CLIP to make a search engine that can understand and deal with both written words and pictures.image
Multilingual-RAGMultilingual RAG with cohere embedding & support 100+ languagesimage
GTE MLX RAG mlx based RAG model using lancedb api supportimage
Healthcare Chatbot Healthcare chatbot using domain specific LLM & Embedding modelimage

🌟 New! 🌟 Applied GenAI and VectorDB course on Udacity Learn about GenAI and vectorDBs using LanceDB in the recently launched Udacity Course

<img src="./assets/udacity-course.png" width="80%" height="80%" />

Contributing Examples

If you're working on some cool applications that you'd like to add to this repo, please open a PR!