{"id":31447937,"url":"https://github.com/qdrant/workshop-improving-r-in-rag","last_synced_at":"2025-10-11T01:35:30.942Z","repository":{"id":316384766,"uuid":"1055008492","full_name":"qdrant/workshop-improving-r-in-rag","owner":"qdrant","description":" Notebooks for RAG improving workshop, using HackerNews data ","archived":false,"fork":false,"pushed_at":"2025-09-25T06:28:05.000Z","size":16312,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T06:44:18.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qdrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T16:26:29.000Z","updated_at":"2025-10-01T13:58:17.000Z","dependencies_parsed_at":"2025-09-24T10:39:51.211Z","dependency_job_id":null,"html_url":"https://github.com/qdrant/workshop-improving-r-in-rag","commit_stats":null,"previous_names":["qdrant/workshop-improving-r-in-rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qdrant/workshop-improving-r-in-rag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fworkshop-improving-r-in-rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fworkshop-improving-r-in-rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fworkshop-improving-r-in-rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fworkshop-improving-r-in-rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qdrant","download_url":"https://codeload.github.com/qdrant/workshop-improving-r-in-rag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Fworkshop-improving-r-in-rag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005930,"owners_count":26083985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-01T02:14:40.993Z","updated_at":"2025-10-11T01:35:30.879Z","avatar_url":"https://github.com/qdrant.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workshop: Improving R in RAG\n\nThis workshop focuses on enhancing the **R**etrieval component in Retrieval Augmented Generation (RAG) systems using \nQdrant vector database. Through hands-on Jupyter notebooks, you'll learn advanced techniques for vector search, multiple \nembedding models, hybrid retrieval strategies, and practical optimizations to improve RAG system performance.\n\n## Prerequisites\n\n- **Python 3.12 or higher**\n- **[uv](https://docs.astral.sh/uv/)** - Ultra-fast Python package manager\n- **[Docker](https://www.docker.com/)** (optional) - For running Qdrant locally\n- **LLM API access** - Anthropic, OpenAI, or Hugging Face account\n\n\u003e [!TIP]\n\u003e **🎉 Free LLM Access Available!**\n\u003e HuggingFace offers a generous free tier for their Inference API with access to thousands of specialized models across multiple AI tasks. Perfect for experimenting with this workshop without upfront costs!\n\n## Installation\n\n### Clone the repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd workshop-improving-r-in-rag\n```\n\n### Install uv\n\n**On macOS and Linux:**\n\n```bash\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n**On Windows:**\n```powershell\npowershell -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n```\n\n**Alternative (using pip):**\n\n```bash\npip install uv\n```\n\n### Install dependencies\n\n```bash\nuv sync\n```\n\n## Qdrant Setup\n\nYou can use either a local Qdrant instance or Qdrant Cloud's free tier.\n\n### Option 1: Local Docker Container\n\n```bash\ndocker run -p \"6333:6333\" -p \"6334:6334\" -v \"$(pwd)/qdrant_storage:/qdrant/storage:z\" \"qdrant/qdrant:v1.15.4\"\n```\n\n### Option 2: Qdrant Cloud Free Tier\n\nSign up for [Qdrant Cloud](https://cloud.qdrant.io/login) and use the free 1GB cluster.\n\n## Environment Configuration\n\nCreate a `.env` file in the `notebooks/` directory with your API credentials:\n\n### Option 1: HuggingFace (Free Tier Recommended) 🆓\n\n```env\n# LLM provider settings\nLLM_PROVIDER=\"huggingface\"\nHF_TOKEN=\"your-huggingface-token\"\n\n# Qdrant settings\nQDRANT_URL=\"http://localhost:6333\"\n# QDRANT_API_KEY=\"your-cloud-api-key\" # Only needed for Qdrant Cloud\n```\n\n**To get your HuggingFace token:**\n1. Create a free account at [huggingface.co](https://huggingface.co)\n2. Go to [Token Settings](https://huggingface.co/settings/tokens)\n3. Create a new token with \"Read\" permissions\n4. Copy the token to your `.env` file\n\n### Option 2: Other Providers\n\n```env\n# For Anthropic\nLLM_PROVIDER=\"anthropic\"\nANTHROPIC_API_KEY=\"your-api-key-here\"\n\n# For OpenAI\nLLM_PROVIDER=\"openai\"\nOPENAI_API_KEY=\"your-api-key-here\"\n\n# Qdrant settings\nQDRANT_URL=\"http://localhost:6333\"\n# QDRANT_API_KEY=\"your-cloud-api-key\" # Only needed for Qdrant Cloud\n```\n\n**All Supported LLM providers:**\n- **🆓 Hugging Face** (Recommended): Generous free tier with thousands of models - Set `LLM_PROVIDER=\"huggingface\"` and `HF_TOKEN`\n- **Anthropic**: Set `LLM_PROVIDER=\"anthropic\"` and `ANTHROPIC_API_KEY`\n- **OpenAI**: Set `LLM_PROVIDER=\"openai\"` and `OPENAI_API_KEY`\n\n## Workshop Structure\n\nThis workshop consists of 4 progressive notebooks:\n\n### 📓 [00-set-up-environment.ipynb](notebooks/00-set-up-environment.ipynb)\n- Environment setup and dependency installation\n- Qdrant connectivity testing\n- Introduction to the tech stack (Qdrant, FastEmbed, any-llm-sdk)\n\n### 📓 [01-initial-data-load.ipynb](notebooks/01-initial-data-load.ipynb)\n- Loading HackerNews dataset into Qdrant\n- Building a basic RAG pipeline with dense vectors\n- Implementing payload-based filtering\n- Testing retrieval quality and LLM integration\n\n### 📓 [02-different-representation-models.ipynb](notebooks/02-different-representation-models.ipynb)\n- Setting up multiple vector representations per document\n- Implementing sparse vectors (BM25) for keyword matching\n- Multi-vector embeddings with ColBERT\n- Hybrid search strategies: retrieval + reranking, and fusion methods\n\n### 📓 [03-low-hanging-fruits.ipynb](notebooks/03-low-hanging-fruits.ipynb)\n- Search result diversification using Maximal Marginal Relevance\n- Applying business rules and constraints\n- Additional optimization techniques for production RAG systems\n\n## Running the Workshop\n\nStart Jupyter Lab:\n\n```bash\nuv run jupyter lab\n```\n\nOr Jupyter Notebook:\n\n```bash\nuv run jupyter notebook\n```\n\nThen navigate through the notebooks in order, starting with `00-set-up-environment.ipynb`.\n\n## Technical Stack\n\n- **[Qdrant](https://qdrant.tech/)** - High-performance vector database for dense, sparse, and multi-vector retrieval\n- **[FastEmbed](https://github.com/qdrant/fastembed)** - Efficient text-to-vector conversion with multiple embedding models\n- **[any-llm-sdk](https://mozilla-ai.github.io/any-llm/)** - Unified interface for multiple LLM providers\n\n## Dataset\n\nThe workshop uses a curated HackerNews submissions dataset containing tech discussions, startup ideas, and programming \ntopics - perfect for demonstrating various retrieval challenges and solutions.\n\n## Learning Outcomes\n\nBy completing this workshop, you'll understand:\n\n- How to set up and configure Qdrant for production RAG systems\n- Different embedding models and when to use each approach\n- Hybrid retrieval strategies combining dense and sparse vectors\n- Advanced reranking and fusion techniques\n- Practical optimizations for improving retrieval relevance\n- How to handle real-world RAG challenges like search diversity and business constraints\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fworkshop-improving-r-in-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqdrant%2Fworkshop-improving-r-in-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Fworkshop-improving-r-in-rag/lists"}