Contextual Retrieval with Any LLM: A Step-by-Step Guide

Prompt Engineering • September 30, 2024
Video Thumbnail
Prompt Engineering Logo

Prompt Engineering

@engineerprompt

About

👋 I'm Muhammad! I am an AI/ML Expert with a PhD and have led ML teams at startups over the last 8 years. I am also a Google Developer Expert for ML/AI. The goal of this channel is to share my learning without all the "fluff" and "hype". I offer consulting services to startups and https://calendly.com/engineerprompt/consulting-call Learn more about me @: engineerprompt.ai For business inquiries email: [email protected]

Video Description

In this video, I show you how to implement contextual retrieval for any LLM using a strategy from Anthropic. We'll go through the entire process, from chunk creation to embedding storage, using OpenAI models and tools like LangChain and BM25. Perfect for enhancing your document retrieval system's accuracy. LINKS: Colab: https://tinyurl.com/2p9wwypy Anthropic Blogpost: https://www.anthropic.com/news/contextual-retrieval Late chunking: https://jina.ai/news/late-chunking-in-long-context-embedding-models/ 💻 RAG Beyond Basics Course: https://prompt-s-site.thinkific.com/courses/rag Let's Connect: 🦾 Discord: https://discord.com/invite/t4eYQRUcXB ☕ Buy me a Coffee: https://ko-fi.com/promptengineering |🔴 Patreon: https://www.patreon.com/PromptEngineering 💼Consulting: https://calendly.com/engineerprompt/consulting-call 📧 Business Contact: [email protected] Become Member: http://tinyurl.com/y5h28s6h 💻 Pre-configured localGPT VM: https://bit.ly/localGPT (use Code: PromptEngineering for 50% off). Signup for Newsletter, localgpt: https://tally.so/r/3y9bb0 00:00 Introduction to Contextual Retrieval 00:35 Recap of Standard RAG System 02:08 Implementing Contextual Retrieval 04:00 Setting Up the Environment 05:37 Creating Contextualized Chunks 06:56 Generating Contextualized Prompts 08:43 Building Vector Stores and Search Indices 09:55 Example Queries and Results 13:29 Advanced Techniques and Conclusion All Interesting Videos: Everything LangChain: https://www.youtube.com/playlist?list=PLVEEucA9MYhOu89CX8H3MBZqayTbcCTMr Everything LLM: https://youtube.com/playlist?list=PLVEEucA9MYhNF5-zeb4Iw2Nl1OKTH-Txw Everything Midjourney: https://youtube.com/playlist?list=PLVEEucA9MYhMdrdHZtFeEebl20LPkaSmw AI Image Generation: https://youtube.com/playlist?list=PLVEEucA9MYhPVgYazU5hx6emMXtargd4z