{
  "source_file": "0930",
  "source_platform": "个人博客",
  "author": "Jason Liu",
  "title_listed": "Low-Hanging Fruit for RAG Search",
  "keywords": "RAG,优化,快速改进",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://jxnl.co/writing/2024/05/11/low-hanging-fruit-for-rag-search/",
  "publish_date": "2024-05",
  "corpus_stage": "推理部署",
  "notes": "RAG搜索的快速改进点",
  "id": "4ae16d206108",
  "collected_at": "2026-10-02T14:29:24",
  "title": "Low-Hanging Fruit for RAG Search - Jason Liu",
  "body_markdown": "Low-Hanging Fruit for RAG Search\n¶\nRAG Series\nIf you're looking to go deeper on RAG, start with the\nRAG series index\n.\nRAG (Retrieval-Augmented Generation), is a powerful technique that combines information retrieval with LLMs to provide relevant and accurate responses to user queries. By searching through a large corpus of text and retrieving the most relevant chunks, RAG systems can generate answers that are grounded in factual information.\nIn this post, we'll explore six key areas where you can focus your efforts to improve your RAG search system. These include using synthetic data for baseline metrics, adding date filters, improving user feedback copy, tracking average cosine distance and Cohere reranking score, incorporating full-text search, and efficiently generating synthetic data for testing.\nIf you want to learn more about I systematically improve RAG applications check out my free 6 email improving rag crash course\nCheck out the free email course here\nBy addressing these low-hanging fruit, you can take your RAG search system to the next level, providing users with more relevant, accurate, and timely information. Let's dive in and explore each of these opportunities in more detail.\n1. Synthetic Data for Baseline Metrics\n¶\nSynthetic data can be used to establish baseline precision and recall metrics for your reverse search. The simplest kind of synthetic data is to take existing text chunks, generate synthetic questions, and verify that when we query our synthetic questions, the sourced text chunk is retrieved correctly.\nBenefits:\nEstablishes a foundation for measuring system complexity and performance\nPinpoints areas for improvement and drives optimization efforts\nEnables affordable, repeatable testing and evaluation\nProvides a consistent reference point when introducing new models or features, allowing for meaningful comparisons. If the baseline remains unchanged, production data can be leveraged to enhance synthetic question generation or the system as a whole.\nCosts:\nThis should really just be a matter of writing a simple prompt that generates questions, hopefully with a few shot examples, and iterating over existing text chunks. Once you have that, you can store pairs of query strings and chunk IDs. And a simple forloup can be used to verify that the query strings are retrieving the correct chunks.\n2. Adding Date Filters\n¶\nIncorporating date filters into your search system can significantly improve the user experience by providing more relevant and up-to-date information. A big issue that I see oftentimes is people asking questions like, what is the latest, blah, blah, blah. This fundamentally does not embed anything and you need to end up using date filters and additional prompting to extract ranges out.\nBenefits:\nIncreased relevance and freshness of search results\nImproved efficiency in narrowing down results\nEnabling trend analysis and historical context\nCosts\nI talk about query understanding in more detail in the\nInstructor documentation\n. Adding query understanding typically adds around 500-700 milliseconds to processing time.\n3. Improving Thumbs Up/Down Copy\n¶\nUsing specific copy for your thumbs up/down buttons, such as \"Did we answer your question?\" instead of generic phrases, offers several benefits. This is particularly relevant when we care about question answer accuracy, but want to explicitly avoid getting negative feedback for being slow or verbose or having poor formatting. You might care about different things, but it's important to be explicit. Do not use generic copy like, did you like our response?\nBenefits:\nFocused feedback on the relevance and quality of search results\nReduced ambiguity in user interpretation\nActionable insights for improving the search system\nCosts\nIt might just be worth having a separate index or table that just stores question answer pairs and whether or not we're satisfied. This would be enough to drawing back onto our similarity data below and do some clustering and data analysis to figure out what the and priorities should be.\n4. Tracking Average Cosine Distance and Cohere Reranking Score\n¶\nMonitoring the average cosine distance and Cohere reranking score for each question can help identify challenging queries and prioritize improvements. Once you have a table of query and scores, you will be able to do data analysis to figure out areas where you are underperforming, at least in the relevancy.\nBenefits:\nIdentifying strengths and weaknesses of the search system\nEnabling targeted optimization for specific query types\nData-driven decision making for resource allocation and feature prioritization\nCosts\nAgain, here we're just logging things. As long as we have a request ID, we can do something pretty simple like...\n{\n\"request_id\"\n:\n\"12345\"\n,\n\"query\"\n:\n\"What is the latest news?\"\n,\n\"mean_cosine_distance\"\n:\n0.3\n,\n\"mean_cohere_reranking_score\"\n:\n0.4\n}\n5. Using Full-Text Search\n¶\nIncorporating both full-text search and semantic search (vector search) can improve the overall performance of your search system. This one is almost obvious for anyone who's building actual search systems. Include BM25 and you will likely see better results.\nBenefits:\nIdentifying relevant documents based on exact keyword matches\nUncovering conceptually similar documents\nImproving the overall effectiveness of the search system\nCost\nHere you gotta make sure your user system that uses full text search. Something like\nLanceDB\nreally improves the UX.\n6. Making Text Chunks Look Like Questions\n¶\nWhen generating synthetic data for testing your search system, it's more efficient to make text chunks look like questions rather than the other way around. Generating Hyde introduces more latency at query time, but if you really care about results, you should be willing to incur ingestion costs to make search better at runtime. It's good for you to think that your text chunks and your queries should have similar embeddings, so it might be good to embed question-answer pairs if you know what kind of questions people are asking ahead of time.\nBenefits:\nReduced latency compared to generating hypothetical document embeddings\nMore effective testing of the search system's performance\nAvoiding the overhead of generating embeddings for every possible question variant\n7. Including File and Document Metadata\n¶\nWhen chunking text for your search system, it's beneficial to include file and document metadata as additional text in each chunk. This metadata can provide valuable context and improve search relevance.\nBenefits:\nImproved search relevance by leveraging metadata information\nAbility to filter and narrow down search results based on metadata fields\nEnhanced understanding of the document structure and hierarchy\nCosts:\nIncluding metadata requires modifying the text chunking process to append the relevant information to each chunk. This may involve extracting metadata from file paths, document headers, or a separate metadata database. The additional text will slightly increase the storage requirements for the chunks.\nExample metadata to include:\nFile path\nDocument title\nAuthor\nCreation date\nTags or categories\nBy incorporating file and document metadata, you can enrich the search experience and provide users with more targeted and relevant results.\nConclusion\n¶\nBy focusing on these low-hanging fruit opportunities, you can significantly enhance the performance and usability of your RAG search system, ultimately providing a better experience for your users.\nIf you have any questions about these details, please leave a comment below and let's get a conversation started. My goal really is to bring the unconscious conscious and being able to answer questions will really help me clarify my own thinking.\nWant to learn more?\n¶\nWant to skip the common mistakes? Most teams spend weeks on complex improvements when these 7 quick wins would give them better results in a day. Here's how to implement them systematically:\nRAG resources\nFree 6-Week RAG Email Course\nComments",
  "metadata": {
    "title": "Low-Hanging Fruit for RAG Search - Jason Liu",
    "description": "Explore low-hanging fruit strategies to enhance your RAG search systems and improve user experience with practical techniques.",
    "keywords": null,
    "author": "Jason Liu",
    "og:type": "website",
    "og:title": "Low-Hanging Fruit for RAG Search - Jason Liu",
    "og:description": "Explore low-hanging fruit strategies to enhance your RAG search systems and improve user experience with practical techniques.",
    "og:image": "https://jxnl.co/assets/images/social/writing/2024/05/11/low-hanging-fruit-for-rag-search.png",
    "og:image:type": "image/png",
    "og:image:width": "1200",
    "og:image:height": "630",
    "og:url": "https://jxnl.co/writing/2024/05/11/low-hanging-fruit-for-rag-search/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "file": "attachments/4ae16d206108/code/body-000.txt",
      "chars": 136,
      "language": "text"
    }
  ],
  "images": [],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://github.com/jxnl/blog/edit/main/docs/writing/posts/rag-low-hanging-fruit.md",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://github.com/jxnl/blog/raw/main/docs/writing/posts/rag-low-hanging-fruit.md",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://jxnl.co/writing/2025/09/11/rag-series-index/",
      "label": "RAG series index",
      "type": "a"
    },
    {
      "href": "https://dub.link/6wk-rag-email",
      "label": "Check out the free email course here",
      "type": "a"
    },
    {
      "href": "https://instructor-ai.github.io/instructor/",
      "label": "Instructor documentation",
      "type": "a"
    },
    {
      "href": "https://lancedb.com/",
      "label": "LanceDB",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:52:55Z",
  "source_url": "https://jxnl.co/writing/2024/05/11/low-hanging-fruit-for-rag-search/",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 8007,
  "expected_body_images": 0,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/4ae16d206108/pages/source.html",
  "local_html": "attachments/4ae16d206108/pages/article.html",
  "body_base_path": "attachments/4ae16d206108/pages/",
  "body_markdown_path": "attachments/4ae16d206108/pages/article.md"
}