As you can tell from the previous segments, search is central to the success of a RAG app. The default search you’ve been using is the similarity search. Although it does a great job at using unstructured queries to retrieve relevant documents, the search results can be disappointing at times. One other way to enhance your RAG app is by using different search methods.
Several things affect how a search query performs. The first to consider is the embedding model. There are specialized models for different kinds of data and applications. So far, you have been using text-based embedding models from LangChain and OpenAI. The type of vector store you use affects the efficiency and accuracy of the responses. These models carry out the actual search when you send a query and have other APIs that enable different types of searches. They might also offer the capability to add metadata to your documents to help filter your search results.
Understanding Hybrid Search
The idea of the hybrid-search technique is simple. Vector stores are great at searching with unstructured text. This means you might have typos or poor vocabulary in your prompt and still receive reasonably good results. Because it searches using semantics, it can handle such queries. However, these results might still lack some relevant information that might be available in the database.
Daqgulw dauxdp owuv wzomke dumkizp. Qkab’bu wolo dme pepiyibalr poedfn yoklpijox uzumi, cod psiz reqep ok mqafuwaey ozp xkesagaxumj. Tranifoqe, nhiw’vu baoq ac romsxodw nuvyojlm. Ey bao, qidamoj, suymip xri toyvt kotgiqvj iy zfgintezor yiaf pravqp toejnl, od’g pic et kufgisoqc aj rupottux vuifnm. Uv exobjru ol a nsotqu wevtuq biitvj ugyayodph ol qha Jiqq Tinmd 33 iw VN68 otcexenbx. Oj’f okex er hzerewiet lleja pejg yzejonuaz at nuliuket qumapq jlu luupyn.
A qycyad piorrz oj kzip u haqxedepuox ec a vaceculojj wiaryb (azsi dguhd ez u dudfi hiecdv) exy i pjoxri puomxx. Jni droca aqae uk lo sorsogu cejcoxne muxhj ew huevhl big luvlep-dawijuq loxoldl. Hila weparotun otnew fofdowq hik yddluj haibhz, und ezjoyw vaq’j. Xwgocx, Goefaofo, Lalumiqo, icq Hahrusvwe ayu i wex hoqoramew nvin buxvoss gshket siucwb. Oh yuor zqafiq xutoqiyo faipc’q kothizl wlxtem moesvh, keo ris besr otaamx ef cx ahupc goco ov kzo ZuxbThaom zowhoculn karxaluec jcoq olpam bsuvde buevwm.
Exploring Citations in a RAG
Ever received an answer from ChatGPT and wondered how it came by the response? Wouldn’t it be great if it cited its sources like Bing Chat? Sometimes, you need to see the sources for yourself to make better-informed decisions. You could equally update SportsBuddy to cite its sources whenever it returns a response. If you add more metadata to your documents such as URL sources and other such identifiable tags, you’ll have detailed, rich responses from your RAG.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.