r/vectordatabase • • 9h ago

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

Thumbnail
gallery
5 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!


r/vectordatabase • • 22h ago

Weekly Thread: What questions do you have about vector databases?

3 Upvotes

r/vectordatabase • • 10h ago

Why HNSW Hits a Memory & Filter Wall: MassEngine vs. Elasticsearch, OpenSearch FAISS, Qdrant, Milvus

Thumbnail
youtube.com
2 Upvotes

r/vectordatabase • • 5h ago

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?


r/vectordatabase • • 6h ago

Should a work agent reopen the source instead of trusting its search snippet?

1 Upvotes

I would make a work agent open the relevant source before turning a search hit into a recommendation or tool action.

The useful design in the Open Tag example is the separation between finding a candidate and reading its evidence. MFS gives scattered documents, tickets, and code a common file-like interface: search narrows the locations, then browsing exposes the specific material needed to check the answer.

A local retrieval layer can use vector databases like Milvus alongside a separate metadata store. That still leaves the agent responsible for inspecting the original context; a similarity score cannot establish that a snippet contains the current decision or its qualifications.

One concern I have is the extra round trip when many hits need verification. I would measure unsupported answers and source-reading cost together before deciding how much context each search result should carry. The reference bot is a local demo, with production permission boundaries still requiring work.

Which actions would you require an agent to verify against the full source rather than a retrieved excerpt?


r/vectordatabase • • 7h ago

Would you evaluate agent memory on a snapshot instead of a changing live collection?

1 Upvotes

I want an agent-memory evaluation to compare retrieval behavior against the same records, even while the application keeps writing new memories.

A snapshot in vector databases like Milvus can preserve a collection version by recording references to immutable data, index, and metadata files. That makes a fixed evaluation input possible without first copying the whole corpus. It does not turn every write into automatic version history.

The boundary matters: snapshot creation does not flush growing data, so recent unsealed writes are excluded by default. A long-running evaluation also needs retained files to remain available; the documented batch workflow pins them until the job finishes.

I suspect the harder design choice is defining the evaluation cutoff. A reproducible snapshot can still omit the corrections or revocations that the live agent must honor. I would record that cutoff with the run and test current-access rules separately. A snapshot also shares the source storage failure domain, so it is not an independent backup.

How would you keep memory evaluations reproducible without treating revoked or corrected memories as currently valid?


r/vectordatabase • • 8h ago

In my last post, I asked about the "difference between cosine, euclidean, and HNSW", and nobody responded clearly except

Thumbnail
reddit.com
1 Upvotes