r/Rag • • Sep 02 '25

Showcase 🚀 Weekly /RAG Launch Showcase

34 Upvotes

Share anything you launched this week related to RAG—projects, repos, demos, blog posts, or products 👇

Big or small, all launches are welcome.


r/Rag • • 11h ago

Showcase I built an open-source RAG knowledge base: 1,619 interview questions, 52 RAG types, system design scenarios, and production architecture patterns

17 Upvotes

I've been building an open-source resource for developers and engineers working with Retrieval-Augmented Generation (RAG).

The goal is to create a comprehensive collection covering both RAG interview preparation and real-world engineering challenges.

What's included:

  • 📚 1,619 RAG interview questions and answers
  • 🧠 52 different RAG types and architectures
  • 🏗️ System design scenarios and architecture patterns
  • ⚙️ Production-ready RAG concepts and implementation considerations
  • 🔍 Core concepts, advanced techniques, and practical engineering topics

Whether you're preparing for an AI/LLM engineering interview, learning different RAG architectures, or designing production RAG systems, this repository aims to provide a structured reference.

GitHub: https://github.com/ather-techie/rag-interview-system

It's open source, and I'd love to get feedback from the RAG community.

Contributions and constructive feedback are welcome!


r/Rag • • 2h ago

Discussion How are companies actually building RAG systems in production? What's your tech stack?

1 Upvotes

I'm learning to build production-grade RAG applications and want to understand how companies are implementing them in real-world projects rather than just following tutorials.

For those working on RAG/GenAI in their organizations:

  1. Which architecture are you using: Basic RAG, Hybrid RAG, Agentic RAG, Graph RAG, or something else?
  2. Which vector database are you using and why?
  3. Which embedding model and LLM are you using in production?
  4. How do you handle document parsing, chunking, and retrieval?
  5. Are you using reranking, hybrid search, query rewriting, or other advanced retrieval techniques?
  6. Which framework do you prefer: LangChain, LlamaIndex, Haystack, or custom implementation?
  7. How do you evaluate RAG quality and reduce hallucinations?
  8. How is your application deployed and what infrastructure are you using?
  9. What were the biggest challenges when moving from POC to production?

I'd especially appreciate hearing about actual technology choices, architecture decisions, and lessons learned.

If you could build your company's RAG system from scratch today, what would your tech stack look like?

Not asking for confidential information, just looking to understand real-world industry practices.


r/Rag • • 3h ago

Showcase GraphRAG on the Valkey you already run: graph, vector and full-text indexes in one server

0 Upvotes

A common GraphRAG stack has three stores: a vector database for chunks, a graph database for entities and relationships, and a cache or session store. Keeping the first two in sync is the part that hurts, and every retrieval crosses the network between them.

Today we released a FalkorDB module for Valkey that puts the graph side inside the Valkey server:

* Property graph queried with OpenCypher

* Vector and full-text indexes on the same graph data, for hybrid retrieval

* Many isolated graphs per instance, so one graph per tenant or per corpus

* Persistence and replication through Valkey

* Valkey 9.2 or later, AGPL-3.0

The module is the storage and query layer. To build the graph from your documents, we have a separate GraphRAG SDK.

Sources: setup at https://www.falkordb.com/valkey/


r/Rag • • 10h ago

Discussion How to speed up the response of a local rag?

2 Upvotes

I'm making a hybrid rag. it can work to search web or vectorDB.

my rag have to decomposition query router and search path router. when input a question, decomposition query router makes subquery. then for each subquery, dicide search path. then After performing a search for each search path, call llm to pass the search results. The two routers also call the same llm. qwen2.5.
It answers complex questions relatively well, but I don't like the search speed.

For each path, until my lag returns a response takes 29sec, 44sec. Web search uses external APIs.

Isn't there a way to do this a bit faster?

I don't use anything other than the base retriever in VectorDB. also my laptop is m1 mac 16g.


r/Rag • • 5h ago

Tools & Resources Normal hybrid retrieval is old. Do this instead and it makes your RAG evolves.

0 Upvotes

In RAG, there's hybrid retrieval. Usually you combine keyword search (mostly BM25) with vector search from an embedding model to get the strengths of both. Most people just use RRF or a simple weighted sum (convex combination).

The problem with that is once you pick the weights, they stay fixed. Even worse: what weights are you supposed to pick in the first place? Depending on the documents you're searching over, sometimes BM25 should get more weight, and other times vector search should.

To actually know, you had to benchmark it yourself. That's why I built AutoRAG back in 2024. One of its core features was finding the optimal hybrid retrieval weights based on real evaluation.

The downside was that it just did a simple greedy search. To find the best weight, it literally tried 101 values from 0.00 to 1.00 and computed the metrics for each one. Plus, building evaluation dataset was really painful to get a real valid optimization result.

Today, I finally put a feature in AutoRAG Agent that completely fixes this: Learning to Rank (LTR) based optimization. It's way better than tuning static weights.

As you use AutoRAG Agent, your queries and the sources that actually get used and cited in answers collected. When chunks get cited, Jev (decision model) checks whether they're actually relevant and logs them. From there, along with those relevant chunks, you can pull a bunch of features for each chunk: not just the vector and lexical search scores, but also things like which data source it came from (Slack, Discord, etc.).

The LTR approach takes those features and logs as training data and trains a GBDT model like XGBoost. This XGBoost model plays a similar role to the weights in a hybrid retrieval weighted sum. The difference is that a regular weighted sum only has two features, whereas LTR lets you feed in multiple features and learn how to combine them directly from real data to maximize retrieval performance.

So how much does it actually improve? I tested it on two datasets, HERB and MultiHop-RAG. On HERB's 'content-type' questions, answer accuracy went up by as much as 32.1%, and retrieval accuracy (nDCG@10) improved by around 3-4% on both datasets.

The 'content-type' questions need to check multiple docs and sources to get a valid answer, think it is like deep research. LTR is quite effective in those questions, because it improved performance by pushing borderline-relevant chunks higher up in the rankings. Since people ask those kinds of questions all the time (for example, "is there anything important I should know from the reports I submitted recently?"), you can actually feel the difference in real use.

Meaningful gains start showing up around 300 queries. If you want to check out the code, or directly using local RAG with this LTR optimization, feel free to check AutoRAG in Github and press star:)

https://github.com/Marker-Inc-Korea/AutoRAG

Thanks!

btw why can't I post a photo in the post? I wanna show you guys the chart.


r/Rag • • 12h ago

Discussion Relevant context, wrong answer? I checked rule exceptions before changing the retriever

1 Upvotes

A failure mode that keeps coming up with document Q&A is getting a relevant passage back and still ending up with the wrong answer. Before changing chunking or adding a reranker, I’d want to know whether the model had enough evidence and applied the right rule.

I had six synthetic support questions run through MiniCPM5-2B Q4_K_M on an M1 Pro with 32 GiB unified memory, using Ollama 0.33.2. Each question received two documents, then ran again with one removed. Same prompt, independent requests, no retriever.

The prompt required an answer, source IDs, exact quotes, and missing information. It explicitly told the model to use only the supplied documents and avoid a conclusion when a required rule was absent.

The clearest case was a U.S. monthly Starter customer requesting a refund on day 20. The general policy specifies 14 days but refers to an exception document. That exception gives this customer 30 days.

With both documents, the model applied the exception and answered yes. Without the exception document, it returned insufficient_evidence and named EXCEPTION-2026 as the missing information.

Run 1: both documents, model applies the exception
Run 2: exception removed, model flags it as missing

Same question and prompt, separate requests. These views were rendered from saved inputs and responses without rewriting the model output.

That‘s useful behavior for a document assistant. In this case, the response points to an explicitly referenced document that was not supplied. It does not show that the model can independently discover an unknown missing source or successfully retrieve it. It avoids rejecting the refund based only on the general rule.

Here’s the breakdown from the rubric review

Case Full-context answer Key-required sources cited Missing-context response
Refund exception Correct Exception policy only Identified the missing exception
Cancellation vs. refund Correct Cancellation policy and refund policy Identified the missing refund policy
Policy version Correct Current policy only Identified the missing current policy
Account credit vs. cash Correct Seat policy and credit terms Identified the missing credit terms
Export deadline Correct Export policy and retention policy Identified the missing retention window
Reseller scope Correct Direct-purchase policy and channel policy Gave a definite answer without the channel policy; failed the supplied missing-context criterion

All 12 responses completed without truncation or transport errors. The median request time excluding the first was 11.05 seconds.

My takeaway is that MiniCPM5-2B applied the refund exception and identified its absence when removed. That gives me a concrete behavior to validate on real documents before changing the retrieval stack.

In the refund example, would you mark the citation as incomplete even though the exception quote fully establishes the applicable rule? How do you separate source coverage from evidential sufficiency in your evals?


r/Rag • • 1d ago

Showcase BenoDB – Embedded vector, graph, and SQL engine built on Apache Iceberg

10 Upvotes

I'd like to announce my open source vector db that I've been working on for the last 11 months has reached developer preview status. I started building BenoDB https://github.com/benolabsai/benodb/ last December, put it on GitHub in March, and have finally reached the point where I'm comfortable showing it off.

Why I Built It

While analyzing 3.3 million SEC filings for a recent research paper presented at IEA/AIE 2026 (published in Springer: https://link.springer.com/chapter/10.1007/978-981-92-2888-1_12), I realized my data organization was shit. My data was scattered across CSV files, Parquet files, DuckDB queries, PostgreSQL tables, and raw NumPy .npy vector dumps. I wanted to use Apache Iceberg, but hated the catalog requirements and having to run Spark just to manage my data.

What BenoDB Does

BenoDB is an embedded engine written in Rust that turns Apache Iceberg tables into an executable vector, graph, and full-text database—with zero external servers, no JVM, and no Spark cluster. I was originally envisioning this as just a vector db engine, but while building it I realized I could handle graphs with it as well, resulting in a single unified engine. One thing led to another, and I ended up including Graph RAG with it.

* Authoritative Data: Parquet files in Iceberg remain the 100% source of truth.

* Zero-Copy Arrow (In-Memory & Out-of-Core): Built natively on Apache Arrow. Runs in-memory with zero serialization for sub-millisecond queries, and out-of-core via memory-mapping.

* Advisory Overlays: HNSW vector search, 8-bit TurboQuant compression, BM25 text, and CSR graph topology are stored as rebuildable sidecars in standard Iceberg Puffin blobs.

* Embedded SQL: Uses Apache DataFusion in-process with standard pgvector syntax (<=>, <->, <#>) and graph UDFs (graph_neighbors).

* Zero Cluster Overhead: Runs as a Python library (pip install benodb) or embedded Rust crate directly against local disk or S3.

*

Benchmarks (8 vCPU / 16 GiB container)

* Vector ANN: 0.38ms–0.93ms P50 latency at 950–2,140+ QPS across GloVe-100, LastFM-64, and SIFT-128.

* Large-Scale Out-of-Core: Stress-tested on Cohere 10M (10M vectors, 768-D) and NeurIPS BigANN (100M, 128-D)

* In-Process Graph: 291k-node PageRank runs in 96ms in pure Rust.

The code and benchmarks are in the repo above. If you'd like to follow along or sign up for project updates, you can find us (and by us I mean me) at https://www.benolabsai.com. The first blog post is also available at https://www.benolabsai.com/blog/rag-graph-howto/


r/Rag • • 20h ago

Discussion RAG - Protection of sensitive & personal information

3 Upvotes

Hello everyone!

During the last few weeks I've been working in different ways to hide sensitive information from data that consumes a RAG system. A system prompt telling the LLM to hide information is expensive and unsecure due to adversarial attacks. That's why we need to take a look at some specialized tools.

Well, here is where the big challenge comes. Deciding which tools are the best for each use case (we have tools and several open weights models out there) was surprisingly difficult. We have the typical metrics (precision, recall and F1), but when hiding sensitive information we need to consider F2 and a metric to determine how much spans are we missing (leakage) during a benchmark and also if we want to measure by overlap, exact match, or even measuring in a chars level.

F2 gives more importance to recall. Hiding sensitive information is more important than good precision.  Leakage gives us the % of spans that weren't hidden. We can measure this by marking as leakage a span if n chars of it weren't identified (we could use percentage or combine both methods).

With that context I would love to hear your approaches to similar problems with PII and RAG.

I found this benchmark PIIMB - Leaderboard that was really helpful to find some of the best PII models. But even those are not enough for all cases. That's why I decided to implement different models in a pipeline, and then I found the following approaches

  1. Merge: give the original text to different models then masks the final text with each prediction.
  2. Sequential: give the original text to the first model, masks the text and give the masked text to the following model and so on. Here we need strategies to mitigate distribution shifts.

Obviously this will represent an impact in metrics. I implemented a way to join spans and remove chars that doesn't represent a leakage (those like asterisks, parenthesis, line jumps, ...) from the borders to minimize the impact of models with low acc.

Here we are focusing only on sensitive data identification. The parse and masking process (where we need to prevent the coreference loss) are stages different from this one.

What are you doing to protect your personal and business sensitive information?


r/Rag • • 1d ago

Tools & Resources my rag pipeline was 5 model servers across 4 mostly idle GPUs. so im moving it to one

9 Upvotes

Started with one embedding model. Fine. Then retrieval kept missing obvious stuff so i added a reranker. Then we needed entities out of the docs so gliner went in. Then half the docs were scanned pdfs so, ocr. Next thing i know, i'm running five things, each its own container, own port, own chunk of vram, and most of them aren't llms.

Worked great in the demo. Then real traffic showed up.

The latency was the weird part. Nothing was slow on its own. Embed fine, rerank fine, extract fine. But every request walked through all of them as separate http calls before the llm started, and those hops pile up. Spent a whole afternoon profiling before it clicked that there was no single slow thing to go fix. It was the walking.

Now the embarrassing part. Four cards, each pinned to one model, each sized for that model's peak. Reranker gets hammered at noon, ocr fires a couple times an hour, they never share, so most of the day the gpus sit there doing nothing while I pay for all of them. Not going to type the utilization number.

Tried pulling it back into one layer. What I'm testing is sie ( github.com/superlinked/sie, not my project, been running it a few weeks). One server, loads whatever model the request wants, evicts lru when vram fills so the models share a pool instead of each hogging a card. Uses openai api so the generation side was a base-url swap.

Not magic and not for everyone. If you're serving one model at steady high traffic, vllm or sglang beats this. sie runs sglang under the hood for generation anyway. The win's there if you're juggling a bunch of different model types and the orchestration is the real cost, not the inference.

Still migrating so I don't have clean before/after numbers worth posting. But the "why is everything slow when nothing is slow" thing came down to the network hops plus the idle pools.

How are yall handling the reranker when it's sharing a gpu? im least sure about that.


r/Rag • • 19h ago

Discussion I built ragpick, an open-source Python library to help you pick the right RAG architecture for your use case (feedback welcome)

2 Upvotes

Hey everyone,

Building a RAG pipeline is easy. Choosing the right one is the hard part. I kept hitting the same problems on client projects:

- Plain vector search misses the product codes and error IDs that customers actually type

- Internal docs leak into answers for users who shouldn't see them

- Someone ships a "better" pipeline with no evidence that it's actually better

So I built **ragpick**, which makes the architecture an explicit, testable decision:

  1. **Recommend.** Describe your requirements and get a blueprint, the reasons for it, alternatives, and warnings.

  2. **Build.** The pipeline is a validated `rag.yaml` (architecture as code), with document-level access control built in.

  3. **Evaluate.** Compare blueprints on your own questions: hit rate, MRR, faithfulness, latency and cost, side by side.

**11 stable blueprints:** naive, hybrid (BM25 + vector + RRF + optional cross-encoder), parent_child, sql (read-only text-to-SQL), graph (GraphRAG), agentic, multimodal, conversational, hierarchical (RAPTOR), long_context, and corrective (grades retrieval and says "I don't know" instead of guessing).

The feature I'm proudest of is `ragpick bench`. It tries every stable blueprint on your data and writes out the winner:

```

ragpick bench eval.jsonl --data ./docs --write best.yaml

```

Don't have eval questions yet? `ragpick generate-eval ./docs` creates a starter set from your documents.

**Try it in 60 seconds, offline, no API key:**

```

pip install ragpick

git clone https://github.com/kavishkakalhara1/ragpick && cd ragpick

ragpick init --blueprint naive --yes

ragpick ingest examples/data

ragpick query "How do I reset my password?"

```

**Other things it does:**

- **Routing and serving:** a router sends each question to a docs pipeline or a SQL pipeline. `ragpick serve` exposes it as an HTTP API, with API keys mapped to access groups.

- Multi-tenancy (an isolated index per tenant), streaming, and chat sessions that rewrite follow-up questions using the conversation

- `--trace` shows where time goes, and caching stops you paying twice for the same embeddings and LLM calls. Traces can be exported to OpenTelemetry.

- `ragpick eval --fail-under hit_rate@k=0.8` turns retrieval quality into a CI check

- Thumbs-up/down feedback can be exported as regression tests

- **Works alongside LangChain and LlamaIndex** rather than replacing them: their loaders, embedders and LLMs plug in as components

- Supports OpenAI, Ollama and sentence-transformers, plus Qdrant, pgvector, Chroma and LanceDB

1.0 is stable, so configs, the Python API, the CLI and the HTTP API only change compatibly within 1.x. Next up (v1.1) is an adaptive blueprint that picks the cheapest strategy per question, an Anthropic generator with prompt caching, and an Elasticsearch/OpenSearch store.

- GitHub: https://github.com/kavishkakalhara1/ragpick

- PyPI: https://pypi.org/project/ragpick/

- Full write-up on why I built it and how it works: https://medium.com/@kavishkakalhara/choosing-a-rag-architecture-is-the-hard-part-so-i-built-a-tool-for-it-5cffce329a0e

I'm the author and maintainer. I'd love honest feedback, especially on whether the recommendations match what you've seen work in production, and which blueprints or stores you'd want added. Contributions are very welcome too.


r/Rag • • 1d ago

Discussion I Thought my RAG was working but production feedback told a different story.

5 Upvotes

I built a RAG system, tested it with a few questions, and everything looked good. But after moving it to production, I started getting a lot of thumbs-down feedback.

That's when I realised something. When we test manually, we usually ask straightforward questions we already know the answers to. But real users ask things differently.

The bigger problem? I couldn't tell whether my retriever was fetching the wrong context or the LLM was generating bad answers.

So I built a RAG evaluation pipeline and a test dataset with 83 questions across different categories. covering simple lookups, semantic queries, multi-hop, multi-span, exact keyword lookups, version-specific questions, and unanswerable queries.

I measured retrieval quality using Recall, Precision, MRR, etc., and answer quality using Ragas.

Tested it with different k values then I could see clearly even at at k=5, retrieval had a 96% Hit Rate, but for questions requiring information from multiple spans, the retriever struggled to find all the labeled relevant chunks.

On the generation side, Faithfulness was around 92%, while Factual Correctness (F1) was only 52%.

It made me realize why evaluating only the final answer or relying on a single metric can hide important problems.

I documented the entire process, including the evaluation dataset, implementation, all important metrics explanation, and results, in a video, https://youtu.be/L7SM04rzhCc


r/Rag • • 22h ago

Discussion Raw chat history retrieval is a baseline every memory project should report

1 Upvotes

Conversation memory arguments tend to fork into the same two camps. One side wants structured, agentic memory with summaries and consolidation. The other side says search over the transcript mostly gets you there.

I have usually sat in the first camp. Then a Cycle 2 result dated November 19 gave me pause, so I went through the results page and the entry's README.

RAW-RAG-AML, an open-source entry that reproduces the RAW-RAG method, sits fifth on the Cycle 2 Textual Open-source Methods board with 60.38. Its README describes it as a reproduction and protocol adaptation. Search returns only original evidence, and the storage layer is SQLite.

Another RAW-RAG adaptation, from a separate repository, is third on the Cycle 2 Multimodal Open-source Methods board: Multimodal-RAW-RAG-AML with 42.17. Per its README, matches get expanded back to the complete source messages, and search hands back the source text alongside the images.

Context matters for how I read these numbers. The Agent Memory Leaderboard (AML) fixes answering and grading, and entries control only Add and Search. The setup is designed so that gaps between entries reflect memory more than anything else.

My own takeaway, in short:

  • a raw history baseline belongs in every memory project's own evaluation
  • one placement inside one evaluation is not a verdict for every scenario
  • it is no evidence that raw retrieval beats every complex memory system

Every conversation memory project should publish a plain raw history number beside its own.

What do you use as the baseline for conversation memory?


r/Rag • • 1d ago

Discussion Has anyone successfully built RAG over thousands of contract PDFs with inconsistent layouts? Struggling with section extraction before embeddings

34 Upvotes

I’m working on a RAG/AI project involving a fairly large collection of contract forms, and I’m curious if anyone here has solved a similar problem in production.

I have roughly 7,400–7,500 contract PDFs. The eventual goal is to build an AI assistant where a user can ask questions about a contract and retrieve the correct clause/section instead of simply retrieving arbitrary chunks of text.

The biggest challenge I’m facing is actually before the vector database/embedding stage: reliably extracting the structure of the contracts.

What the documents look like

These are not all standardized PDFs.

Across the library I have:

• PDFs with different layouts and formatting

• Contracts with extra cover/data-entry pages before the actual agreement

• Some scanned PDFs that require OCR

• Searchable/text-based PDFs

• Headings indicated by font size, bold text, capitalization, color, spacing, lines, etc.

• Section headings that differ between contract/form types

• Headers and footers repeated across pages

• Form metadata in headers/footers

• Revision information that isn't always located/formatted exactly the same way

• Cases where words that look like headings also appear inside normal paragraphs

• Multi-page sections where the content continues onto another page

What I need to extract

Ideally, I want each PDF converted into structured data roughly like:

• File name

• Form name

• Form date

• Revision

• License/state information

• Section heading

• Full text belonging to that section

• Page/location information

• Other useful metadata

The problem is that identifying those boundaries consistently across thousands of different PDFs is much harder than I originally expected.

What I've tried

I've experimented with:

• PyMuPDF

• PyMuPDF4LLM

• Docling

• Apache Tika as another possible approach

• Python-based custom PDF parsing

• Font size/style based heading detection

• Position/layout rules

• Header/footer detection

• Keyword/regex-based section detection

• Metadata extraction

• OCR considerations for scanned documents

I also looked into services such as Azure Document Intelligence, but I'm trying to determine how much can reasonably be solved with Python/open-source tooling before introducing another paid document-processing layer.


r/Rag • • 1d ago

Showcase hybrid scope rag

1 Upvotes

r/Rag • • 2d ago

Discussion Building a fully local RAG system for complex legal/union contracts — looking for architecture and accuracy recommendations

18 Upvotes

I’m developing a desktop application using Flutter that helps union representatives analyze collective bargaining agreements (CBAs), workplace policies, grievances, and other labor-related documents.
The goal is to build a production-grade, completely local RAG system that provides accurate answers with verifiable citations. Confidential documents must remain on the user’s computer.
Current stack:
● Flutter/Dart desktop application (Windows/Linux)
● Ollama for local LLM inference
● Qwen3 1.7B/4B models
● Haystack 3.x for retrieval experimentation
● Qwen3-Embedding-0.6B
● BGE reranker
● BM25 and vector retrieval experiments
Problems we’ve encountered:
1. Retrieval accuracy: The system sometimes retrieves related contract language but misses the exact provision needed to answer correctly.
2. Context fragmentation: Relevant provisions may span multiple paragraphs or pages. Retrieving isolated chunks can lose important conditions, exceptions, or deadlines.
3. Citation reliability: We need accurate article, section, and physical PDF page references. We’ve encountered cases where the AI confused two different deadlines in the same article.
4. LLM performance: Smaller local models sometimes produce incomplete responses, take too long, or struggle with larger contexts.
5. Document processing: We need reliable extraction of complex PDFs, including tables, headings, numbered sections, scanned documents, and cross-references.
What we’re considering:
● Docling for layout-aware document extraction
● A normalized document representation preserving sections, tables, and source metadata
● Hierarchical/parent-child chunking
● Hybrid BM25 + dense retrieval
● Reranking and evidence verification
● Agentic retrieval when initial evidence is insufficient
● A benchmark dataset of verified contract questions
Questions for developers with production RAG experience:
1. What document-processing and chunking architecture would you recommend for complex, structured legal documents?
2. Would you use standard dense embeddings, ColBERT/multivector retrieval, or another approach for precise clause retrieval?
3. How do you reliably preserve citations and relationships between sections across PDF pages?
4. What techniques have made the biggest measurable difference in reducing incorrect answers and unsupported citations?
5. What local models or retrieval frameworks would you recommend for balancing accuracy, latency, and memory usage on consumer hardware?
I’m especially interested in existing open-source tools and proven architectures rather than building every component from scratch.
Any recommendations, benchmarks, or lessons learned would be appreciated.


r/Rag • • 1d ago

Discussion Hybrid RAG vs basic vector search — what are you using in production?

0 Upvotes

hey everyone, wanted to start a discussion around something that comes up quite often when building RAG applications.

a lot of implementations start with embedding documents, storing them in a vector database and retrieving the nearest matches.

that works for many use cases, but it can struggle when queries contain specific technical terms, identifiers, exact phrases or information that depends on multiple documents.

this is where hybrid retrieval becomes interesting.

a typical hybrid RAG pipeline might combine:

  • semantic retrieval to find conceptually relevant content
  • keyword retrieval to catch exact terms and identifiers
  • reranking to improve the ordering of retrieved candidates
  • context construction to avoid overwhelming the model
  • evaluation to measure retrieval quality separately from answer quality

I'm sharing this in connection with a Packt hands-on workshop on November 28 with Brij Kishore Pandey covering hybrid RAG, tools, persistent memory, guardrails and evaluation.

full workshop details here

curious what retrieval architecture people here are currently using. are you combining dense and sparse retrieval, or using another approach?


r/Rag • • 2d ago

Discussion How RAG pipelines fail in production

4 Upvotes

Every RAG explainer draws the same diagram: chunk, embed, store, retrieve top-k, stuff the prompt, generate. It works in the demo. In production the answer is wrong, and the diagram doesn't tell you why.

I've found it useful to sort the failures by where they happen: before the model sees anything (retrieval), while it reads what you gave it (reader), and once RAG runs inside an agent that retrieves again and again (loop).

Retrieval-side: what the model never gets to see

  • Recall ceiling. If the chunk with the answer isn't in the top-k, no prompt or model upgrade brings it back. Fix: measure recall@k on a small labelled set before you touch generation (recall@10 of 60% means ~60% is your best case). Use hybrid search: dense misses exact terms like codes, names and numbers; lexical misses paraphrases. Fuse with RRF. Fix chunking that splits tables or separates headings from their body.
  • Stale index. The source changed, the embeddings didn't. The silent version: you upgrade the embedding model for new docs and old vectors stay in the same index. Cross-model similarity scores mean nothing, and nothing errors. Fix: re-index on change events, handle updates and deletes (source ID + content hash per chunk), store the embedding model version with every vector, and re-embed everything when it changes.
  • Permission leak. The model doesn't know who's asking; it summarizes whatever is in context. Fix: enforce ACL/tenant filters inside the retrieval query, before ranking. Never filter after generation, because the model has already read it. Check caches, memory and agent tool calls too. Add eval cases where the right answer is "you don't have access".

Reader-side: the evidence is in the prompt and the answer is still wrong

  • Lost in the middle. Liu et al. (2023) found accuracy is highest when the relevant passage is at the start or end of the context and drops in the middle. Raising k "to give the model more" makes it worse. Fix: retrieve wide, rerank, keep few (50 → 5). Put the strongest evidence at the edges. Test with the answer at different positions.
  • Distraction. Embeddings measure "about the same thing", not "answers this question". Same clause, different contract year. Fix: rerank for relevance (cross-encoder or LLM judge), drop weak matches with a score threshold instead of padding to k, filter on metadata (product, year, doc type) when the question names it, and add deliberate distractors to your evals.
  • Evidence conflict. Old policy vs new, two reports with different figures, docs vs training data. The model quietly picks one. Fix: keep date and source on every chunk and show them to the model. Write the conflict rule down (newest wins / authoritative source wins / show both), ideally in code. Require citations so a reviewer can check every claim.

Loop-side: RAG inside an agent

  • Compounding error. Wrong entity in hop 1, and hops 2–5 build carefully on top of it. Every step looks fine except the first. Fix: validate intermediate results before the next step uses them, keep calculations and lookups in code the agent calls, reject answers that cite things the agent never retrieved, and evaluate full traces, not single turns.
  • No stopping rule. The agent can't tell when it has enough, so it searches forever, stops too early, or rephrases the same query in a loop. Fix: define sufficiency (which facts must be found), set hard budgets on iterations, tool calls and model calls, stop when a search returns the same chunks as the last one, and when the budget runs out, answer with what was found and say what's missing.
  • Prompt injection. Retrieved text is untrusted input, and the risk grows with every tool the agent can call. Fix: mark retrieved content as data, never give it system-prompt authority, give tools least privilege (read-only, timeouts), put human approval or code checks in front of anything that writes, sends or spends, and add injection docs to your eval set.

The common thread: almost none of these throw errors. You get a fluent answer every time. So the fix is the same everywhere: measure each stage on its own. Recall before generation, accuracy with distractors and conflicts in context, full agent traces with budgets and injection cases. And keep a held-out set you never tune against.

For context, I hit most of these building a chatbot over company filings (hybrid pgvector HNSW + Postgres full-text with RRF, every figure cited back to its PDF page) and a Graph-RAG memory project with one graph per company, so tenant isolation comes from where the data lives rather than a filter someone has to remember.

Which of these has bitten you hardest? I'm especially curious how people handle evidence conflicts: do you resolve them in code or leave it to the model?

Longer write-up with more detail on each: https://builtbyhimanshu.com/blog/rag-issues


r/Rag • • 1d ago

Discussion Embeddings are weak on names and amounts, so every query on our notes also runs grep

2 Upvotes

We keep our company knowledge in a few hundred markdown notes and search them with one embedding per note. bge-m3, cosine similarity, a linear scan. Nothing fancy.

That works for questions like what was our reasoning on X. For exact things we don't trust it. A client name, a product name, an amount like 1,490.

So the rule for our agents is that search hits are only candidates. Every query runs twice, once through the embeddings and once as a plain text search for the exact terms. The agent reads the union, opens the top one to three notes in full, and checks their date and status before it answers.

Two more rules sit in the search script itself. It refuses to run when the index is older than the notes. It compares a hash per file and the list of notes, and if anything changed it tells you to rebuild instead of answering. And a score below about 0.5 is treated as probably not a hit.

None of this is clever. It's a small index and a text search next to it.

For those running retrieval over a small company corpus, do you use proper hybrid search with BM25, or is something as dumb as grep enough at this size?


r/Rag • • 2d ago

Tools & Resources I got tired of paying $0.04/paper for LlamaParse, so I built a deterministic $0.005/paper extractor for ArXiv with citations & RAG chunks

11 Upvotes

Hey everyone,

Like many of you building RAG pipelines or local agent research monitors, my biggest headache has always been academic PDFs.

Tools like LlamaParse and Unstructured do great work, but they charge ~$0.003/page. When you're indexing hundreds of 15–30 page papers, that quickly runs into $50–$100 bills for simple batch jobs—and vision-based models often hallucinate equation numbers or fail on two-column layouts.

So I wrote a deterministic, sub-3-second extractor in Python combining PyMuPDF (`fitz` in C) with the official ArXiv Atom API, and packaged it as a Pay-Per-Event (PPE) Actor on Apify.

### What it extracts cleanly:

  1. **Authoritative Metadata**: Title, authors, affiliations, date, canonical ArXiv ID, and DOI.
  2. **Decomposed Sections**: Headings (`1. Introduction`, `3.2 Methodology`) with automatic hyphenation de-wrapping.
  3. **Analytics**: Exact count of display equation blocks and table captions with context.
  4. **Structured Citations**: Parses references into `{raw_text, title_guess, year, arxiv_id_if_present}` so you can build paper-citation graphs.
  5. **RAG-Ready Chunks**: Overlapping, token-bounded chunks pre-tagged with section breadcrumbs (`[Section: Methodology]\n...`), ready to drop straight into Qdrant/Pinecone/Chroma.

### Cost & Speed Benchmark (15-page Paper: "Attention Is All You Need"):

- **LlamaParse**: ~$0.045 / paper (12–25 seconds)

- **This Actor**: $0.005 / paper (3.8 seconds)

- **Failure Guarantee**: If an invalid PDF or 404 occurs, Apify charges $0.00.

Code is open on GitHub: https://github.com/ali1556/arxiv-pdf-structured-extractor

Apify Store Actor: https://apify.com/al1nr/arxiv-pdf-structured-extractor-1

Would love feedback from anyone running paper RAG pipelines—what fields or chunk formats are you missing most?


r/Rag • • 2d ago

Tutorial RAG Step-by-Step Tutorial for Beginners: How to Stop AI Hallucinations with Your Own Data

35 Upvotes

If you are tired of LLMs making up facts when querying private documents, Retrieval-Augmented Generation (RAG) is the standard fix. Instead of relying on static training weights, RAG retrieves relevant chunks from your own files and passes them directly to the model as context.

​I put together a practical, step-by-step RAG tutorial for beginners that skips the heavy academic theory and focuses on building a working pipeline from scratch.

​Inside the guide, you will learn how to:

  • ​Split and chunk raw documents without losing semantic meaning
  • ​Generate vector embeddings and store them in a vector database
  • ​Connect a retriever to an LLM to ground every response in verified sources

​Check out the full technical cheat sheet and architecture breakdown here: https://interconnectd.com/forum/thread/31/rag-for-beginners-the-technical-cheat-sheet-that-stops-ai-hallucinations/

Let me know what vector database or embedding model you are testing first.


r/Rag • • 2d ago

Discussion How do you make an association chatbot stop citing superseded policy?

3 Upvotes

Run "whats the cancellation window?" while the association’s policy says 30 days. Ask it again the morning after the policy changes to 14

For the test I’m planning with customgpt.ai, I’d tag each chunk in the index with its policy version and save the exact passages returned with each answer. If the second reply still says 30 days, I can check whether the search pulled up the old rule alone or gave the chatbot both versions. Has anyone fixed this by changing the index or adding a query filter?? I’d like to see what the search returned before and after.


r/Rag • • 2d ago

Discussion Cognee vs LightRAG for an organizational knowledge base — is document ingestion this slow for everyone?

2 Upvotes

I'm doing a tech stack evaluation between cognee and LightRAG. My use case is building an organizational knowledge base for agents to use. I initially leaned toward cognee because I liked the concept — the remember/recall approach, with short-term memory plus a tiered storage structure made up of knowledge graph + vector DB + relational DB.

However, when I pulled the Docker images and set it up to try running it myself, I found that document ingestion is very slow. For example, I created a new dataset on the default management page and uploaded a 700K PDF. After more than an hour, the document still shows as "not ready." I'm wondering if everyone else is seeing the same thing. How do you usually choose between these two? Thanks.


r/Rag • • 2d ago

Discussion Dense pooling vs. ColBERT multivectors on technical manuals (and the index RAM tax nobody mentions)

2 Upvotes

Single-vector dense embeddings compress an entire 512-token chunk into one array, which blurs out exact identifiers like error code 403 vs 404, or a 2.5mm vs 2.8mm flange spec.

Late-interaction multivector models (BAAI/bge-m3 with output_types=[""multivector""] or answerdotai/answerai-colbert-small-v1, which averages 0.466 nDCG@10 across 8 retrieval sets) avoid that collapse by keeping per-token vectors so exact technical strings still score cleanly without rewriting your chunker.

The trade-off is storage and memory bloat: storing one vector per token multiplies your vector DB footprint significantly compared to single-vector dense indexes, and models like answerai-colbert-small-v1 cap context at 512 tokens. In most cases, BM25/learned sparse + dense fusion gets you 90% of the way there for a fraction of the RAM.

If you want to A/B test whether multivectors actually move recall on your manuals before provisioning GPU nodes, you can run a small sample through sie_sdk on Superlinked Serverless first, and only move heavy nightly indexing onto a self-hosted Native Inference cluster if the recall gain justifies the extra index RAM.


r/Rag • • 2d ago

Discussion Preparing messy documents for RAG: what should survive extraction

1 Upvotes

A RAG dataset often starts with PDFs, tables, charts, and code snippets. Turning them into usable records means deciding what belongs together and what context needs to survive. Those records might be document chunks or QA pairs—QA conversion is useful for some workflows, but isn’t a requirement for RAG.

One approach is to separate preparation into operators: document parsing, text cleaning, chunking, optional QA generation, evaluation, and filtering. Each operator reads named fields and writes its output for the next step.

A few details matter:

  • Keep visual content connected to its context. For PDF-to-VQA preparation, the workflow includes layout parsing, OCR, and image–text alignment before extracting questions and answers. Flattening everything into plain text can lose the information needed to interpret a figure.
  • Make intermediate outputs inspectable. Explicit input and output fields let you examine extracted content before generating QA pairs, or inspect generated pairs before filtering them.
  • Separate scoring from the filtering decision. Saving scores first lets you try different thresholds against the same scored data. That avoids another model call just to change which records you keep.
  • Keep model access separate from processing logic. Operators use a configured serving backend, with API and local inference options, so model calls don’t need to be wired into every pipeline from scratch.

The remaining question is whether the prepared records preserve enough evidence to answer real queries; clean formatting alone doesn’t establish that.

These building blocks are implemented in OpenDCAI/DataFlow—how are you handling mixed documents in your RAG pipelines, and which preprocessing decisions have made the biggest difference?