The right chunk came back at rank 1 and the model still couldn't answer. Tested PDF parsing in my RAG_Techniques repo, and a reranker made it worse
Most PDF notebooks in my RAG_Techniques repo start with a PyPDF loader, and none of them ever printed what the parser produced. So I wrote one that does. Mistral sponsored it, disclosure at the bottom as well.
The test is one question about Table 2 of the DPR paper (two-column PDF): what Top-20 retrieval accuracy did DPR get on SQuAD when trained on a single dataset. The answer is 63.2.
Baseline, the repo's own encode_pdf() (PyPDF, RecursiveCharacterTextSplitter at 1000/200, OpenAI embeddings, FAISS):
- the chunk with 63.2 comes back at rank 1, caption included
- gpt-4o-mini says the context does not contain the answer
And it's right to decline. PyPDF got the reading order fine, but the table came out as rows of ten bare numbers. Top-20 and Top-100 sit at the end of one line, the dataset names on the next, so nothing says which column 63.2 is in.
Swap the parser for Mistral OCR 4.1, same splitter: the table comes back as a proper markdown table. Still no answer. The splitter cut at the blank line between the table and its caption, so the caption ranked 1st and the table 7th.
Chunk on OCR 4.1's block types instead: each table stays whole, together with its caption. The table chunk lands in the top 3, but a prose paragraph about Table 2 ranks above it and the model declines again.
Then the repo's LLM reranker (gpt-4o-mini, 10 candidates, keep 3) on all three:
- PyPDF: answers 77.2. That's the Top-100 number, one header over. Confidently wrong.
- OCR 4.1 + character splitter: still declines
- OCR 4.1 + block-aware chunker: 63.2, correct
The reranker did its job every time, the 63.2 chunk came first in all three. It only promotes what ingestion gave it.
Other bits: a scanned page with no text layer gives 0 characters from PyPDF and 6,638 from OCR 4.1. OCR 4.1 is $4 per 1,000 pages ($2 with batch), so the 13-page paper costs about five cents. The OCR output is cached in the repo, so every cell runs without a Mistral key.
Limits worth knowing: the chunker only pairs a table with a caption directly before or after it, and the reranker is 10 model calls per query. For clean single-column prose PDFs, PyPDF is fine and free, use it. The block-aware chunker works with any parser that returns typed blocks.
Notebook: github.com/NirDiamant/RAG_Techniques/blob/main/al…
Mistral's own description of the product:
> Document AI is Mistral AI's enterprise-grade document processing solution, powered by the world's best OCR and structured data extraction. It digitizes PDFs, scans, DOCX, PPTX, and handwritten sources; reads through tables, forms, invoices, and complex layouts to detect patterns, validate data, and make scanned archives searchable; and localizes contracts, reports, and correspondence with 98%+ accuracy across 170+ languages. Teams can build end-to-end document pipelines, including OCR digitization, automated structuring, and natural language querying, while auditing document flows, redacting sensitive data, and enforcing retention policies with full traceability.
*Disclosure: Mistral AI sponsored this tutorial. Every number above comes from cells you can run yourself. Mistral OCR 4.1: mistr.al
curious how others handle tables at ingestion, do you check parser output before indexing?
3 points · 2 comments
This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial.
NirDiamant/RAG_Techniques
4 likes · 285 views
RAG Techniques: Elevating Your Retrieval-Augmented Generation Systems (30k stars)
What it does
All text below is quoted directly from the project README.
>This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial.
Key Features:
- State-of-the-art RAG enhancements
- Comprehensive documentation for each technique
- Practical implementation guidelines
- Regular updates with the latest advancements
- A community-driven hub of 42+ runnable notebooks covering RAG techniques from foundational to cutting-edge - the intuition, the code, and the references to build more accurate, context-rich retrieval systems.
>git clone https://github.com/NirDiamant/RAG_Techniques.git
Repository
NirDiamant/RAG_Techniques
Repository stats
|Metric|Value|
|:-|:-|
|Stars|30,017|
|Forks|3.7k|
|Last release|ai-agents-book-v1.0 (2026-10-26)|
|Languages|Jupyter Notebook 95.3%, Python 4.7%|
|Contributors|39|
|AI contributor accounts (Claude / Codex / Cursor / Copilot)|@claude (66 commits)|
|AI co-authored commits|None|
Main contributor
|Field|Value|
|:-|:-|
|Name|Nir Diamant|
|GitHub|@NirDiamant|
|Commits to this repo|302 (top contributor)|
|Bio|GenAI Consultant|
|Company / Location|DiamantAI|
|X / Twitter|@NirDiamantAI|
|Followers|6.1k|
──────────────────────────────
📌 How many great GitHub repos have you discovered and completely forgotten about?
Don't let another useful tool disappear into your Reddit feed. Get the community's best repos, organized by category, plus key takeaways from real developer discussions, delivered to your inbox twice a week.
📬 Never lose track of great repos again. Subscribe free.
124 points
4 free GitHub repos to build your first RAG app
Want to build your first RAG app (an AI that answers from your own documents)? These 4 GitHub repos are free to start with.
Our take: learn the pipeline in a notebook, rebuild it from scratch once, then reach for a full engine like RAGFlow.
1. RAG_Techniques: NirDiamant/RAG_Techniques
2. rag-from-scratch: pguso/rag-from-scratch
3. LightRAG: HKUDS/LightRAG
4. RAGFlow: infiniflow/ragflow
Daily AI explainers on Instagram: instagram.com/theinferenceai.tech
Free: 50 LLM interview questions PDF: harshal-dharpure.kit.com
Voiceover: AI-generated (TTS)
#ai #rag #github #llm
1 comment · 88 views
Repo of the Week: 40+ Free RAG Notebooks
NirDiamant/RAG_Techniques: 40+ runnable notebooks on RAG, the method behind chat-with-your-documents apps. Start with simple_csv_rag.ipynb to ask questions about a CSV. Free to learn from, but it uses a custom non-commercial license, so it isn't open source. The notebooks use an OpenAI API key (usage is billed).
trending/jupyter-notebook
Comment RAG and I'll send you the cheatsheet PDF.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[ar] مستودع الأسبوع: أكثر من 40 دفتر ملاحظات مجاني لتقنية RAG
NirDiamant/RAG_Techniques: أكثر من 40 دفتر ملاحظات قابل للتنفيذ حول RAG، وهي الطريقة المستخدمة في تطبيقات الدردشة مع المستندات. ابدأ بـ simple_csv_rag.ipynb لطرح أسئلة حول ملف CSV. التعلم منه مجاني، ولكنه يستخدم ترخيصًا غير تجاري مخصص، لذا فهو ليس مفتوح المصدر. تستخدم دفاتر الملاحظات مفتاح API من OpenAI (يتم احتساب رسوم الاستخدام).
trending/jupyter-notebook
اكتب RAG في التعليقات وسأرسل لك ملف PDF يحتوي على ملخص.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[bn] এই সপ্তাহের সেরা রিপো: ৪০টিরও বেশি ফ্রি RAG নোটবুক
NirDiamant/RAG_Techniques: RAG-এর উপর ৪০টিরও বেশি রানযোগ্য নোটবুক, যা আপনার ডকুমেন্টের সাথে চ্যাট করার অ্যাপের পেছনের পদ্ধতি। একটি CSV সম্পর্কে প্রশ্ন করতে simple_csv_rag.ipynb দিয়ে শুরু করুন। এটি থেকে শেখা বিনামূল্যে, কিন্তু এটি একটি কাস্টম নন-কমার্শিয়াল লাইসেন্স ব্যবহার করে, তাই এটি ওপেন সোর্স নয়। নোটবুকগুলো একটি OpenAI API কী ব্যবহার করে (ব্যবহারের জন্য বিল করা হয়)।
trending/jupyter-notebook
RAG কমেন্ট করুন এবং আমি আপনাকে চিটশিট PDF পাঠিয়ে দেব।
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[de-DE] Repo der Woche: 40+ kostenlose RAG-Notebooks
NirDiamant/RAG_Techniques: Über 40 ausführbare Notebooks zu RAG, der Methode hinter Apps, die mit Dokumenten interagieren. Beginnen Sie mit simple_csv_rag.ipynb, um Fragen zu einer CSV-Datei zu stellen. Kostenlos zum Lernen, aber unter einer speziellen, nicht-kommerziellen Lizenz, daher nicht Open Source. Die Notebooks verwenden einen OpenAI-API-Schlüssel (die Nutzung ist kostenpflichtig).
trending/jupyter-notebook
Kommentieren Sie mit „RAG“ und ich sende Ihnen die Kurzanleitung als PDF.
NirDiamant/RAG_Techniques
#KI #RAG #github #KIUndDatenMitIbrahim
[es-US] Repositorio de la semana: Más de 40 notebooks de RAG gratis
NirDiamant/RAG_Techniques: Más de 40 cuadernos ejecutables sobre RAG, el método detrás de las aplicaciones de chat con documentos. Empieza con simple_csv_rag.ipynb para hacer preguntas sobre un archivo CSV. Es gratuito para aprender, pero utiliza una licencia no comercial personalizada, por lo que no es de código abierto. Los cuadernos utilizan una clave API de OpenAI (el uso tiene costo).
trending/jupyter-notebook
Comenta RAG y te enviaré el PDF con la guía rápida.
NirDiamant/RAG_Techniques
#IA #RAG #github #IAyDatosConIbrahim
[fr-FR] Dépôt de la semaine : 40+ notebooks RAG gratuits
NirDiamant/RAG_Techniques : Plus de 40 notebooks exécutables sur RAG, la méthode à la base des applications de dialogue avec vos documents. Commencez par simple_csv_rag.ipynb pour poser des questions sur un fichier CSV. Ce notebook est gratuit à titre d'exemple, mais il utilise une licence non commerciale personnalisée et n'est donc pas open source. Les notebooks utilisent une clé API OpenAI (l'utilisation est facturée).
trending/jupyter-notebook
Commentez « RAG » et je vous enverrai le guide PDF.
NirDiamant/RAG_Techniques
#IA #RAG #github #IAEtDonnéesAvecIbrahim
[hi] इस हफ़्ते की बेहतरीन रिपो: 40 से ज़्यादा फ्री RAG नोटबुक
NirDiamant/RAG_Techniques: RAG पर आधारित 40 से अधिक रन करने योग्य नोटबुक, जो आपके दस्तावेज़ों से चैट करने वाले ऐप्स के पीछे की विधि है। CSV फ़ाइल के बारे में प्रश्न पूछने के लिए simple_csv_rag.ipynb से शुरुआत करें। सीखने के लिए निःशुल्क, लेकिन यह एक विशेष गैर-व्यावसायिक लाइसेंस का उपयोग करता है, इसलिए यह ओपन सोर्स नहीं है। नोटबुक OpenAI API कुंजी का उपयोग करते हैं (उपयोग के लिए शुल्क लिया जाता है)।
trending/jupyter-notebook
RAG कमेंट करें और मैं आपको चीटशीट PDF भेज दूंगा।
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[id] Repo Minggu Ini: 40+ Notebook RAG Gratis
NirDiamant/RAG_Techniques: 40+ notebook yang dapat dijalankan tentang RAG, metode di balik aplikasi obrolan dengan dokumen Anda. Mulailah dengan simple_csv_rag.ipynb untuk mengajukan pertanyaan tentang CSV. Gratis untuk dipelajari, tetapi menggunakan lisensi non-komersial khusus, jadi bukan sumber terbuka. Notebook menggunakan kunci API OpenAI (penggunaan dikenakan biaya).
trending/jupyter-notebook
Komentari RAG dan saya akan mengirimkan PDF lembar contekan kepada Anda.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[it] Repo della settimana: 40+ Notebook RAG gratuiti
NirDiamant/RAG_Techniques: oltre 40 notebook eseguibili su RAG, il metodo alla base delle app di chat con i documenti. Inizia con simple_csv_rag.ipynb per porre domande su un file CSV. È gratuito per imparare, ma utilizza una licenza personalizzata non commerciale, quindi non è open source. I notebook utilizzano una chiave API OpenAI (l'utilizzo è a pagamento).
trending/jupyter-notebook
Commenta con RAG e ti invierò il PDF con le istruzioni.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[iw] הריפו של השבוע: 40+ מחברות RAG בחינם
NirDiamant/RAG_Techniques: מעל 40 מחברות ניתנות להפעלה ב-RAG, השיטה שמאחורי אפליקציות צ'אט-עם-המסמכים-שלך. התחילו עם simple_csv_rag.ipynb כדי לשאול שאלות על CSV. למידה חינמית, אך היא משתמשת ברישיון מותאם אישית שאינו מסחרי, כך שהיא אינה קוד פתוח. המחברות משתמשות במפתח API של OpenAI (השימוש מחויב).
trending/jupyter-notebook
הגיבו על RAG ואשלח לכם את דף הצ'יטים בפורמט PDF.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[ja] 今週のリポジトリ:40以上の無料RAGノートブック
NirDiamant/RAG_Techniques: チャット型ドキュメントアプリの基盤となるRAGメソッドに関する40以上の実行可能なノートブック。まずはsimple_csv_rag.ipynbでCSVファイルに関する質問を始めてみましょう。学習には無料ですが、独自の非商用ライセンスを使用しているため、オープンソースではありません。ノートブックはOpenAI APIキーを使用しているため、利用には課金が発生します。
trending/jupyter-notebook
「RAG」とコメントしていただければ、チートシートのPDFをお送りします。
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[ko] 이번 주의 저장소: 40개 이상의 무료 RAG 노트북
NirDiamant/RAG_Techniques: 문서와 채팅하는 앱의 기반이 되는 RAG 방법론에 대한 40개 이상의 실행 가능한 노트북입니다. CSV 파일에 대한 질문을 하려면 simple_csv_rag.ipynb부터 시작해 보세요. 무료로 학습할 수 있지만, 맞춤형 비상업적 라이선스를 사용하므로 오픈 소스는 아닙니다. 노트북은 OpenAI API 키를 사용하며 사용량에 따라 요금이 부과됩니다.
trending/jupyter-notebook
댓글에 RAG라고 남겨주시면 치트 시트 PDF를 보내드리겠습니다.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[ml] ഈ ആഴ്ചയിലെ മികച്ച റെപ്പോ: 40-ലധികം സൗജന്യ RAG നോട്ട്ബുക്കുകൾ
NirDiamant/RAG_Techniques: RAG-ൽ 40+ റൺ ചെയ്യാവുന്ന നോട്ട്ബുക്കുകൾ, ചാറ്റ്-വിത്ത്-യുവർ-ഡോക്യുമെന്റ്സ് ആപ്പുകൾക്ക് പിന്നിലെ രീതി. ഒരു CSV-യെക്കുറിച്ച് ചോദ്യങ്ങൾ ചോദിക്കാൻ simple_csv_rag.ipynb-ൽ നിന്ന് ആരംഭിക്കുക. പഠിക്കാൻ സൌജന്യമാണ്, പക്ഷേ ഇത് ഒരു കസ്റ്റം നോൺ-കൊമേഴ്സ്യൽ ലൈസൻസ് ഉപയോഗിക്കുന്നു, അതിനാൽ ഇത് ഓപ്പൺ സോഴ്സ് അല്ല. നോട്ട്ബുക്കുകൾ ഒരു OpenAI API കീ ഉപയോഗിക്കുന്നു (ഉപയോഗത്തിന് ബിൽ ഈടാക്കും).
trending/jupyter-notebook
RAG-ൽ കമന്റ് ചെയ്യുക, ഞാൻ നിങ്ങൾക്ക് ചീറ്റ്ഷീറ്റ് PDF അയയ്ക്കാം.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[nl-NL] Repo van de week: 40+ gratis RAG-notebooks
NirDiamant/RAG_Techniques: Meer dan 40 uitvoerbare notebooks over RAG, de methode achter apps waarmee je met je documenten kunt chatten. Begin met simple_csv_rag.ipynb om vragen te stellen over een CSV-bestand. Je kunt er gratis van leren, maar het gebruikt een aangepaste niet-commerciële licentie, dus het is geen open source. De notebooks gebruiken een OpenAI API-sleutel (gebruik wordt gefactureerd).
trending/jupyter-notebook
Reageer met RAG en ik stuur je de spiekbrief in PDF-formaat.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[pa] ਹਫ਼ਤੇ ਦੀ ਬਿਹਤਰੀਨ ਰਿਪੋ: 40+ ਮੁਫ਼ਤ RAG ਨੋਟਬੁੱਕਸ
NirDiamant/RAG_Techniques: RAG 'ਤੇ 40+ ਚੱਲਣਯੋਗ ਨੋਟਬੁੱਕ, ਜੋ ਕਿ ਚੈਟ-ਵਿਦ-ਯੂਅਰ-ਡੌਕੂਮੈਂਟ ਐਪਸ ਦੇ ਪਿੱਛੇ ਦਾ ਤਰੀਕਾ ਹੈ। CSV ਬਾਰੇ ਸਵਾਲ ਪੁੱਛਣ ਲਈ simple_csv_rag.ipynb ਨਾਲ ਸ਼ੁਰੂਆਤ ਕਰੋ। ਸਿੱਖਣ ਲਈ ਮੁਫ਼ਤ, ਪਰ ਇਹ ਇੱਕ ਕਸਟਮ ਗੈਰ-ਵਪਾਰਕ ਲਾਇਸੈਂਸ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ, ਇਸ ਲਈ ਇਹ ਓਪਨ ਸੋਰਸ ਨਹੀਂ ਹੈ। ਨੋਟਬੁੱਕ ਇੱਕ OpenAI API ਕੁੰਜੀ ਦੀ ਵਰਤੋਂ ਕਰਦੇ ਹਨ (ਵਰਤੋਂ ਦਾ ਬਿੱਲ ਲਿਆ ਜਾਂਦਾ ਹੈ)।
trending/jupyter-notebook
RAG 'ਤੇ ਟਿੱਪਣੀ ਕਰੋ ਅਤੇ ਮੈਂ ਤੁਹਾਨੂੰ ਚੀਟਸ਼ੀਟ PDF ਭੇਜਾਂਗਾ।
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[pl] Repo tygodnia: 40+ darmowych notatników RAG
NirDiamant/RAG_Techniques: Ponad 40 gotowych do uruchomienia notatników w RAG, metodzie stojącej za aplikacjami do czatowania z dokumentami. Zacznij od simple_csv_rag.ipynb, aby zadać pytania dotyczące pliku CSV. Nauka jest darmowa, ale korzysta z niestandardowej licencji niekomercyjnej, więc nie jest open source. Notatniki korzystają z klucza API OpenAI (użytkowanie jest płatne).
trending/jupyter-notebook
Skomentuj RAG, a wyślę Ci ściągawkę w formacie PDF.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[pt-BR] Repositório da Semana: 40+ Notebooks RAG Gratuitos
NirDiamant/RAG_Techniques: Mais de 40 notebooks executáveis sobre RAG, o método por trás de aplicativos de bate-papo com seus documentos. Comece com simple_csv_rag.ipynb para fazer perguntas sobre um arquivo CSV. Gratuito para aprendizado, mas usa uma licença personalizada não comercial, portanto não é de código aberto. Os notebooks usam uma chave de API da OpenAI (o uso é cobrado).
trending/jupyter-notebook
Comente RAG e eu lhe enviarei o PDF com o guia de referência rápida.
NirDiamant/RAG_Techniques
#IA #RAG #github #IAEDadosComIbrahim
[ru] Репозиторий недели: 40+ бесплатных RAG-ноутбуков
NirDiamant/RAG_Techniques: Более 40 запускаемых блокнотов по RAG, методу, лежащему в основе приложений для общения с документами. Начните с simple_csv_rag.ipynb, чтобы задавать вопросы о CSV-файле. Обучение бесплатное, но используется собственная некоммерческая лицензия, поэтому это не открытый исходный код. Блокноты используют ключ API OpenAI (использование платное).
trending/jupyter-notebook
Напишите RAG в комментариях, и я вышлю вам PDF-шпаргалку.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[ta] இந்த வாரத்தின் சிறந்த களஞ்சியம்: 40+ இலவச RAG நோட்புக்குகள்
NirDiamant/RAG_Techniques: உங்கள் ஆவணங்களுடன் உரையாடும் செயலிகளின் பின்னணியில் உள்ள முறையான RAG-ஐப் பற்றிய 40-க்கும் மேற்பட்ட இயக்கக்கூடிய நோட்புக்குகள். ஒரு CSV கோப்பைப் பற்றி கேள்விகள் கேட்க simple_csv_rag.ipynb-இல் இருந்து தொடங்குங்கள். இதிலிருந்து கற்றுக்கொள்வது இலவசம், ஆனால் இது ஒரு பிரத்யேக வணிகரீதியற்ற உரிமத்தைப் பயன்படுத்துவதால், இது ஓப்பன் சோர்ஸ் அல்ல. இந்த நோட்புக்குகள் OpenAI API கீ-ஐப் பயன்படுத்துகின்றன (பயன்பாட்டிற்கு கட்டணம் வசூலிக்கப்படும்).
trending/jupyter-notebook
[te] ఈ వారం యొక్క ఉత్తమ రెపో (Repo): 40+ ఉచిత RAG నోట్బుక్లు
నిర్డైమంట్/RAG_టెక్నిక్స్: మీ డాక్యుమెంట్లతో చాట్ చేసే యాప్ల వెనుక ఉన్న పద్ధతి అయిన RAG పై 40కి పైగా రన్ చేయగల నోట్బుక్లు. ఒక CSV గురించి ప్రశ్నలు అడగడానికి simple_csv_rag.ipynb తో ప్రారంభించండి. దీని నుండి ఉచితంగా నేర్చుకోవచ్చు, కానీ ఇది ఒక ప్రత్యేకమైన వాణిజ్యేతర లైసెన్స్ను ఉపయోగిస్తుంది, కాబట్టి ఇది ఓపెన్ సోర్స్ కాదు. ఈ నోట్బుక్లు ఒక OpenAI API కీని ఉపయోగిస్తాయి (వాడకానికి బిల్లు వేయబడుతుంది).
trending/jupyter-notebook
RAG అని కామెంట్ చేయండి, నేను మీకు చీట్షీట్ PDF పంపుతాను.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
[uk] Репозиторій тижня: 40+ безкоштовних RAG-ноутбуків
NirDiamant/RAG_Techniques: Понад 40 робочих блокнотів на RAG, методі, що лежить в основі програм для спілкування з вашими документами. Почніть із simple_csv_rag.ipynb, щоб поставити запитання про CSV. Навчання безкоштовне, але воно використовує власну некомерційну ліцензію, тому не є програмним забезпеченням з відкритим вихідним кодом. Блокноти використовують ключ API OpenAI (використання оплачується).
trending/jupyter-notebook
Коментуйте RAG, і я надішлю вам PDF-файл зі шпаргалкою.
NirDiamant/RAG_Techniques
#AI #RAG #github #AIAndDataWithIbrahim
2 likes · 115 views
Mentions
The right chunk came back at rank 1 and the model still couldn't answer. Tested PDF parsing in my RAG_Techniques repo, and a reranker made it worse Most PDF notebooks in my RAG_Techniques repo start with a PyPDF loader, and none of them ever printed what the parser produced. So I wrote one that does. Mistral sponsored it, disclosure at the bottom as well. The test is one question about Table 2 of the DPR paper (two-column PDF): what Top-20 retrieval accuracy did DPR get on SQuAD when trained on a single dataset. The answer is 63.2. Baseline, the repo's own encode_pdf() (PyPDF, RecursiveCharacterTextSplitter at 1000/200, OpenAI embeddings, FAISS): - the chunk with 63.2 comes back at rank 1, caption included - gpt-4o-mini says the context does not contain the answer And it's right to decline. PyPDF got the reading order fine, but the table came out as rows of ten bare numbers. Top-20 and Top-100 sit at the end of one line, the dataset names on the next, so nothing says which column 63.2 is in. Swap the parser for Mistral OCR 4.1, same splitter: the table comes back as a proper markdown table. Still no answer. The splitter cut at the blank line between the table and its caption, so the caption ranked 1st and the table 7th. Chunk on OCR 4.1's block types instead: each table stays whole, together with its caption. The table chunk lands in the top 3, but a prose paragraph about Table 2 ranks above it and the model declines again. Then the repo's LLM reranker (gpt-4o-mini, 10 candidates, keep 3) on all three: - PyPDF: answers 77.2. That's the Top-100 number, one header over. Confidently wrong. - OCR 4.1 + character splitter: still declines - OCR 4.1 + block-aware chunker: 63.2, correct The reranker did its job every time, the 63.2 chunk came first in all three. It only promotes what ingestion gave it. Other bits: a scanned page with no text layer gives 0 characters from PyPDF and 6,638 from OCR 4.1. OCR 4.1 is $4 per 1,000 pages ($2 with batch), so the 13-page paper costs about five cents. The OCR output is cached in the repo, so every cell runs without a Mistral key. Limits worth knowing: the chunker only pairs a table with a caption directly before or after it, and the reranker is 10 model calls per query. For clean single-column prose PDFs, PyPDF is fine and free, use it. The block-aware chunker works with any parser that returns typed blocks. Notebook: github.com/NirDiamant/RAG_Techniques/blob/main/al… Mistral's own description of the product: > Document AI is Mistral AI's enterprise-grade document processing solution, powered by the world's best OCR and structured data extraction. It digitizes PDFs, scans, DOCX, PPTX, and handwritten sources; reads through tables, forms, invoices, and complex layouts to detect patterns, validate data, and make scanned archives searchable; and localizes contracts, reports, and correspondence with 98%+ accuracy across 170+ languages. Teams can build end-to-end document pipelines, including OCR digitization, automated structuring, and natural language querying, while auditing document flows, redacting sensitive data, and enforcing retention policies with full traceability. *Disclosure: Mistral AI sponsored this tutorial. Every number above comes from cells you can run yourself. Mistral OCR 4.1: mistr.al curious how others handle tables at ingestion, do you check parser output before indexing?
This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial. NirDiamant/RAG_Techniques
RAG Techniques: Elevating Your Retrieval-Augmented Generation Systems (30k stars) What it does All text below is quoted directly from the project README. >This repository showcases various advanced techniques for Retrieval-Augmented Generation (RAG) systems. Each technique has a detailed notebook tutorial. Key Features: - State-of-the-art RAG enhancements - Comprehensive documentation for each technique - Practical implementation guidelines - Regular updates with the latest advancements - A community-driven hub of 42+ runnable notebooks covering RAG techniques from foundational to cutting-edge - the intuition, the code, and the references to build more accurate, context-rich retrieval systems. >git clone https://github.com/NirDiamant/RAG_Techniques.git Repository NirDiamant/RAG_Techniques Repository stats |Metric|Value| |:-|:-| |Stars|30,017| |Forks|3.7k| |Last release|ai-agents-book-v1.0 (2026-10-26)| |Languages|Jupyter Notebook 95.3%, Python 4.7%| |Contributors|39| |AI contributor accounts (Claude / Codex / Cursor / Copilot)|@claude (66 commits)| |AI co-authored commits|None| Main contributor |Field|Value| |:-|:-| |Name|Nir Diamant| |GitHub|@NirDiamant| |Commits to this repo|302 (top contributor)| |Bio|GenAI Consultant| |Company / Location|DiamantAI| |X / Twitter|@NirDiamantAI| |Followers|6.1k| ────────────────────────────── 📌 How many great GitHub repos have you discovered and completely forgotten about? Don't let another useful tool disappear into your Reddit feed. Get the community's best repos, organized by category, plus key takeaways from real developer discussions, delivered to your inbox twice a week. 📬 Never lose track of great repos again. Subscribe free.
4 free GitHub repos to build your first RAG app Want to build your first RAG app (an AI that answers from your own documents)? These 4 GitHub repos are free to start with. Our take: learn the pipeline in a notebook, rebuild it from scratch once, then reach for a full engine like RAGFlow. 1. RAG_Techniques: NirDiamant/RAG_Techniques 2. rag-from-scratch: pguso/rag-from-scratch 3. LightRAG: HKUDS/LightRAG 4. RAGFlow: infiniflow/ragflow Daily AI explainers on Instagram: instagram.com/theinferenceai.tech Free: 50 LLM interview questions PDF: harshal-dharpure.kit.com Voiceover: AI-generated (TTS) #ai #rag #github #llm
Repo of the Week: 40+ Free RAG Notebooks NirDiamant/RAG_Techniques: 40+ runnable notebooks on RAG, the method behind chat-with-your-documents apps. Start with simple_csv_rag.ipynb to ask questions about a CSV. Free to learn from, but it uses a custom non-commercial license, so it isn't open source. The notebooks use an OpenAI API key (usage is billed). trending/jupyter-notebook Comment RAG and I'll send you the cheatsheet PDF. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [ar] مستودع الأسبوع: أكثر من 40 دفتر ملاحظات مجاني لتقنية RAG NirDiamant/RAG_Techniques: أكثر من 40 دفتر ملاحظات قابل للتنفيذ حول RAG، وهي الطريقة المستخدمة في تطبيقات الدردشة مع المستندات. ابدأ بـ simple_csv_rag.ipynb لطرح أسئلة حول ملف CSV. التعلم منه مجاني، ولكنه يستخدم ترخيصًا غير تجاري مخصص، لذا فهو ليس مفتوح المصدر. تستخدم دفاتر الملاحظات مفتاح API من OpenAI (يتم احتساب رسوم الاستخدام). trending/jupyter-notebook اكتب RAG في التعليقات وسأرسل لك ملف PDF يحتوي على ملخص. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [bn] এই সপ্তাহের সেরা রিপো: ৪০টিরও বেশি ফ্রি RAG নোটবুক NirDiamant/RAG_Techniques: RAG-এর উপর ৪০টিরও বেশি রানযোগ্য নোটবুক, যা আপনার ডকুমেন্টের সাথে চ্যাট করার অ্যাপের পেছনের পদ্ধতি। একটি CSV সম্পর্কে প্রশ্ন করতে simple_csv_rag.ipynb দিয়ে শুরু করুন। এটি থেকে শেখা বিনামূল্যে, কিন্তু এটি একটি কাস্টম নন-কমার্শিয়াল লাইসেন্স ব্যবহার করে, তাই এটি ওপেন সোর্স নয়। নোটবুকগুলো একটি OpenAI API কী ব্যবহার করে (ব্যবহারের জন্য বিল করা হয়)। trending/jupyter-notebook RAG কমেন্ট করুন এবং আমি আপনাকে চিটশিট PDF পাঠিয়ে দেব। NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [de-DE] Repo der Woche: 40+ kostenlose RAG-Notebooks NirDiamant/RAG_Techniques: Über 40 ausführbare Notebooks zu RAG, der Methode hinter Apps, die mit Dokumenten interagieren. Beginnen Sie mit simple_csv_rag.ipynb, um Fragen zu einer CSV-Datei zu stellen. Kostenlos zum Lernen, aber unter einer speziellen, nicht-kommerziellen Lizenz, daher nicht Open Source. Die Notebooks verwenden einen OpenAI-API-Schlüssel (die Nutzung ist kostenpflichtig). trending/jupyter-notebook Kommentieren Sie mit „RAG“ und ich sende Ihnen die Kurzanleitung als PDF. NirDiamant/RAG_Techniques #KI #RAG #github #KIUndDatenMitIbrahim [es-US] Repositorio de la semana: Más de 40 notebooks de RAG gratis NirDiamant/RAG_Techniques: Más de 40 cuadernos ejecutables sobre RAG, el método detrás de las aplicaciones de chat con documentos. Empieza con simple_csv_rag.ipynb para hacer preguntas sobre un archivo CSV. Es gratuito para aprender, pero utiliza una licencia no comercial personalizada, por lo que no es de código abierto. Los cuadernos utilizan una clave API de OpenAI (el uso tiene costo). trending/jupyter-notebook Comenta RAG y te enviaré el PDF con la guía rápida. NirDiamant/RAG_Techniques #IA #RAG #github #IAyDatosConIbrahim [fr-FR] Dépôt de la semaine : 40+ notebooks RAG gratuits NirDiamant/RAG_Techniques : Plus de 40 notebooks exécutables sur RAG, la méthode à la base des applications de dialogue avec vos documents. Commencez par simple_csv_rag.ipynb pour poser des questions sur un fichier CSV. Ce notebook est gratuit à titre d'exemple, mais il utilise une licence non commerciale personnalisée et n'est donc pas open source. Les notebooks utilisent une clé API OpenAI (l'utilisation est facturée). trending/jupyter-notebook Commentez « RAG » et je vous enverrai le guide PDF. NirDiamant/RAG_Techniques #IA #RAG #github #IAEtDonnéesAvecIbrahim [hi] इस हफ़्ते की बेहतरीन रिपो: 40 से ज़्यादा फ्री RAG नोटबुक NirDiamant/RAG_Techniques: RAG पर आधारित 40 से अधिक रन करने योग्य नोटबुक, जो आपके दस्तावेज़ों से चैट करने वाले ऐप्स के पीछे की विधि है। CSV फ़ाइल के बारे में प्रश्न पूछने के लिए simple_csv_rag.ipynb से शुरुआत करें। सीखने के लिए निःशुल्क, लेकिन यह एक विशेष गैर-व्यावसायिक लाइसेंस का उपयोग करता है, इसलिए यह ओपन सोर्स नहीं है। नोटबुक OpenAI API कुंजी का उपयोग करते हैं (उपयोग के लिए शुल्क लिया जाता है)। trending/jupyter-notebook RAG कमेंट करें और मैं आपको चीटशीट PDF भेज दूंगा। NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [id] Repo Minggu Ini: 40+ Notebook RAG Gratis NirDiamant/RAG_Techniques: 40+ notebook yang dapat dijalankan tentang RAG, metode di balik aplikasi obrolan dengan dokumen Anda. Mulailah dengan simple_csv_rag.ipynb untuk mengajukan pertanyaan tentang CSV. Gratis untuk dipelajari, tetapi menggunakan lisensi non-komersial khusus, jadi bukan sumber terbuka. Notebook menggunakan kunci API OpenAI (penggunaan dikenakan biaya). trending/jupyter-notebook Komentari RAG dan saya akan mengirimkan PDF lembar contekan kepada Anda. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [it] Repo della settimana: 40+ Notebook RAG gratuiti NirDiamant/RAG_Techniques: oltre 40 notebook eseguibili su RAG, il metodo alla base delle app di chat con i documenti. Inizia con simple_csv_rag.ipynb per porre domande su un file CSV. È gratuito per imparare, ma utilizza una licenza personalizzata non commerciale, quindi non è open source. I notebook utilizzano una chiave API OpenAI (l'utilizzo è a pagamento). trending/jupyter-notebook Commenta con RAG e ti invierò il PDF con le istruzioni. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [iw] הריפו של השבוע: 40+ מחברות RAG בחינם NirDiamant/RAG_Techniques: מעל 40 מחברות ניתנות להפעלה ב-RAG, השיטה שמאחורי אפליקציות צ'אט-עם-המסמכים-שלך. התחילו עם simple_csv_rag.ipynb כדי לשאול שאלות על CSV. למידה חינמית, אך היא משתמשת ברישיון מותאם אישית שאינו מסחרי, כך שהיא אינה קוד פתוח. המחברות משתמשות במפתח API של OpenAI (השימוש מחויב). trending/jupyter-notebook הגיבו על RAG ואשלח לכם את דף הצ'יטים בפורמט PDF. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [ja] 今週のリポジトリ:40以上の無料RAGノートブック NirDiamant/RAG_Techniques: チャット型ドキュメントアプリの基盤となるRAGメソッドに関する40以上の実行可能なノートブック。まずはsimple_csv_rag.ipynbでCSVファイルに関する質問を始めてみましょう。学習には無料ですが、独自の非商用ライセンスを使用しているため、オープンソースではありません。ノートブックはOpenAI APIキーを使用しているため、利用には課金が発生します。 trending/jupyter-notebook 「RAG」とコメントしていただければ、チートシートのPDFをお送りします。 NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [ko] 이번 주의 저장소: 40개 이상의 무료 RAG 노트북 NirDiamant/RAG_Techniques: 문서와 채팅하는 앱의 기반이 되는 RAG 방법론에 대한 40개 이상의 실행 가능한 노트북입니다. CSV 파일에 대한 질문을 하려면 simple_csv_rag.ipynb부터 시작해 보세요. 무료로 학습할 수 있지만, 맞춤형 비상업적 라이선스를 사용하므로 오픈 소스는 아닙니다. 노트북은 OpenAI API 키를 사용하며 사용량에 따라 요금이 부과됩니다. trending/jupyter-notebook 댓글에 RAG라고 남겨주시면 치트 시트 PDF를 보내드리겠습니다. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [ml] ഈ ആഴ്ചയിലെ മികച്ച റെപ്പോ: 40-ലധികം സൗജന്യ RAG നോട്ട്ബുക്കുകൾ NirDiamant/RAG_Techniques: RAG-ൽ 40+ റൺ ചെയ്യാവുന്ന നോട്ട്ബുക്കുകൾ, ചാറ്റ്-വിത്ത്-യുവർ-ഡോക്യുമെന്റ്സ് ആപ്പുകൾക്ക് പിന്നിലെ രീതി. ഒരു CSV-യെക്കുറിച്ച് ചോദ്യങ്ങൾ ചോദിക്കാൻ simple_csv_rag.ipynb-ൽ നിന്ന് ആരംഭിക്കുക. പഠിക്കാൻ സൌജന്യമാണ്, പക്ഷേ ഇത് ഒരു കസ്റ്റം നോൺ-കൊമേഴ്സ്യൽ ലൈസൻസ് ഉപയോഗിക്കുന്നു, അതിനാൽ ഇത് ഓപ്പൺ സോഴ്സ് അല്ല. നോട്ട്ബുക്കുകൾ ഒരു OpenAI API കീ ഉപയോഗിക്കുന്നു (ഉപയോഗത്തിന് ബിൽ ഈടാക്കും). trending/jupyter-notebook RAG-ൽ കമന്റ് ചെയ്യുക, ഞാൻ നിങ്ങൾക്ക് ചീറ്റ്ഷീറ്റ് PDF അയയ്ക്കാം. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [nl-NL] Repo van de week: 40+ gratis RAG-notebooks NirDiamant/RAG_Techniques: Meer dan 40 uitvoerbare notebooks over RAG, de methode achter apps waarmee je met je documenten kunt chatten. Begin met simple_csv_rag.ipynb om vragen te stellen over een CSV-bestand. Je kunt er gratis van leren, maar het gebruikt een aangepaste niet-commerciële licentie, dus het is geen open source. De notebooks gebruiken een OpenAI API-sleutel (gebruik wordt gefactureerd). trending/jupyter-notebook Reageer met RAG en ik stuur je de spiekbrief in PDF-formaat. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [pa] ਹਫ਼ਤੇ ਦੀ ਬਿਹਤਰੀਨ ਰਿਪੋ: 40+ ਮੁਫ਼ਤ RAG ਨੋਟਬੁੱਕਸ NirDiamant/RAG_Techniques: RAG 'ਤੇ 40+ ਚੱਲਣਯੋਗ ਨੋਟਬੁੱਕ, ਜੋ ਕਿ ਚੈਟ-ਵਿਦ-ਯੂਅਰ-ਡੌਕੂਮੈਂਟ ਐਪਸ ਦੇ ਪਿੱਛੇ ਦਾ ਤਰੀਕਾ ਹੈ। CSV ਬਾਰੇ ਸਵਾਲ ਪੁੱਛਣ ਲਈ simple_csv_rag.ipynb ਨਾਲ ਸ਼ੁਰੂਆਤ ਕਰੋ। ਸਿੱਖਣ ਲਈ ਮੁਫ਼ਤ, ਪਰ ਇਹ ਇੱਕ ਕਸਟਮ ਗੈਰ-ਵਪਾਰਕ ਲਾਇਸੈਂਸ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ, ਇਸ ਲਈ ਇਹ ਓਪਨ ਸੋਰਸ ਨਹੀਂ ਹੈ। ਨੋਟਬੁੱਕ ਇੱਕ OpenAI API ਕੁੰਜੀ ਦੀ ਵਰਤੋਂ ਕਰਦੇ ਹਨ (ਵਰਤੋਂ ਦਾ ਬਿੱਲ ਲਿਆ ਜਾਂਦਾ ਹੈ)। trending/jupyter-notebook RAG 'ਤੇ ਟਿੱਪਣੀ ਕਰੋ ਅਤੇ ਮੈਂ ਤੁਹਾਨੂੰ ਚੀਟਸ਼ੀਟ PDF ਭੇਜਾਂਗਾ। NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [pl] Repo tygodnia: 40+ darmowych notatników RAG NirDiamant/RAG_Techniques: Ponad 40 gotowych do uruchomienia notatników w RAG, metodzie stojącej za aplikacjami do czatowania z dokumentami. Zacznij od simple_csv_rag.ipynb, aby zadać pytania dotyczące pliku CSV. Nauka jest darmowa, ale korzysta z niestandardowej licencji niekomercyjnej, więc nie jest open source. Notatniki korzystają z klucza API OpenAI (użytkowanie jest płatne). trending/jupyter-notebook Skomentuj RAG, a wyślę Ci ściągawkę w formacie PDF. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [pt-BR] Repositório da Semana: 40+ Notebooks RAG Gratuitos NirDiamant/RAG_Techniques: Mais de 40 notebooks executáveis sobre RAG, o método por trás de aplicativos de bate-papo com seus documentos. Comece com simple_csv_rag.ipynb para fazer perguntas sobre um arquivo CSV. Gratuito para aprendizado, mas usa uma licença personalizada não comercial, portanto não é de código aberto. Os notebooks usam uma chave de API da OpenAI (o uso é cobrado). trending/jupyter-notebook Comente RAG e eu lhe enviarei o PDF com o guia de referência rápida. NirDiamant/RAG_Techniques #IA #RAG #github #IAEDadosComIbrahim [ru] Репозиторий недели: 40+ бесплатных RAG-ноутбуков NirDiamant/RAG_Techniques: Более 40 запускаемых блокнотов по RAG, методу, лежащему в основе приложений для общения с документами. Начните с simple_csv_rag.ipynb, чтобы задавать вопросы о CSV-файле. Обучение бесплатное, но используется собственная некоммерческая лицензия, поэтому это не открытый исходный код. Блокноты используют ключ API OpenAI (использование платное). trending/jupyter-notebook Напишите RAG в комментариях, и я вышлю вам PDF-шпаргалку. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [ta] இந்த வாரத்தின் சிறந்த களஞ்சியம்: 40+ இலவச RAG நோட்புக்குகள் NirDiamant/RAG_Techniques: உங்கள் ஆவணங்களுடன் உரையாடும் செயலிகளின் பின்னணியில் உள்ள முறையான RAG-ஐப் பற்றிய 40-க்கும் மேற்பட்ட இயக்கக்கூடிய நோட்புக்குகள். ஒரு CSV கோப்பைப் பற்றி கேள்விகள் கேட்க simple_csv_rag.ipynb-இல் இருந்து தொடங்குங்கள். இதிலிருந்து கற்றுக்கொள்வது இலவசம், ஆனால் இது ஒரு பிரத்யேக வணிகரீதியற்ற உரிமத்தைப் பயன்படுத்துவதால், இது ஓப்பன் சோர்ஸ் அல்ல. இந்த நோட்புக்குகள் OpenAI API கீ-ஐப் பயன்படுத்துகின்றன (பயன்பாட்டிற்கு கட்டணம் வசூலிக்கப்படும்). trending/jupyter-notebook [te] ఈ వారం యొక్క ఉత్తమ రెపో (Repo): 40+ ఉచిత RAG నోట్బుక్లు నిర్డైమంట్/RAG_టెక్నిక్స్: మీ డాక్యుమెంట్లతో చాట్ చేసే యాప్ల వెనుక ఉన్న పద్ధతి అయిన RAG పై 40కి పైగా రన్ చేయగల నోట్బుక్లు. ఒక CSV గురించి ప్రశ్నలు అడగడానికి simple_csv_rag.ipynb తో ప్రారంభించండి. దీని నుండి ఉచితంగా నేర్చుకోవచ్చు, కానీ ఇది ఒక ప్రత్యేకమైన వాణిజ్యేతర లైసెన్స్ను ఉపయోగిస్తుంది, కాబట్టి ఇది ఓపెన్ సోర్స్ కాదు. ఈ నోట్బుక్లు ఒక OpenAI API కీని ఉపయోగిస్తాయి (వాడకానికి బిల్లు వేయబడుతుంది). trending/jupyter-notebook RAG అని కామెంట్ చేయండి, నేను మీకు చీట్షీట్ PDF పంపుతాను. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim [uk] Репозиторій тижня: 40+ безкоштовних RAG-ноутбуків NirDiamant/RAG_Techniques: Понад 40 робочих блокнотів на RAG, методі, що лежить в основі програм для спілкування з вашими документами. Почніть із simple_csv_rag.ipynb, щоб поставити запитання про CSV. Навчання безкоштовне, але воно використовує власну некомерційну ліцензію, тому не є програмним забезпеченням з відкритим вихідним кодом. Блокноти використовують ключ API OpenAI (використання оплачується). trending/jupyter-notebook Коментуйте RAG, і я надішлю вам PDF-файл зі шпаргалкою. NirDiamant/RAG_Techniques #AI #RAG #github #AIAndDataWithIbrahim