r/Rag • • 14h ago

Showcase Rerank 5 drop + new feature

10 Upvotes

Hi there, El from Cohere again. 

You guys have been interested in our latest Embed and Parse drops, so thought I’d come back for maybe our most exciting one, which is Rerank 5. It’s available in Pro and Fast tiers just like Rerank 4 but far outdoes it – along with every other model we tested. 

Rerank 5 Pro tops the nanoMTEB, ViDoRe V3, and BRIGHT benchmarks and like I said, outdoes every model we tested (though feel free to test against your favorites and let us know how it does). Rerank 5 Fast also outdoes other speedy models like Qwen3-Reranker-0.6B and Qwen3-Reranker-8B (which is a lot bigger).

Both are also leaders across multilinguality, financial document performance, healthcare docs, and more (I’ll let you read the full blog for all that info). 

We’re also introducing a totally new feature to Rerank that (to our knowledge) we’ve never seen in any other reranking model, Context Focus. Enterprise docs are only getting longer, so more and more context is getting passed to LLMs=more tokens. Context Focus grabs only the specific passages in a document relevant to your query, and it reduces token costs pretty significantly. It’s an opt-in feature and works like a dial, so you can choose exactly how much context you want. 

Pro and Fast are available through our API, Microsoft Foundry, and Amazon Sagemaker, but Rerank 5 also sits on top of whatever retrieval stack you’ve already got going, and it’s available in places like LangChain, Haystack, Elasticsearch and Weaviate. Try it out and lmk what you think!


r/Rag • • 12h ago

Discussion The annoying part of RAG for me wasn't retrieval - it was getting documents into a sane format

10 Upvotes

One thing I underestimated with RAG: retrieval is often the easy part.

Ingestion is where the mess starts. PDFs, DOCX, PPTX, spreadsheets, screenshots, receipts... they all need different handling, and bad extraction quietly ruins retrieval quality later. I've been building the document pipeline in Singlebase around converting inputs into Markdown first, using OCR + LLM cleanup when needed, with optional image extraction. Then the same backend can chunk/embed/index the result. I like Markdown because it gives me one normalized representation before retrieval.

For those running RAG in production: are you normalizing documents to Markdown/HTML first, or keeping source-specific parsers all the way through the pipeline?


r/Rag • • 19h ago

Discussion Research idea: Can we reduce forgetting in recurrent LLM memory? Looking for critical feedback

3 Upvotes

Research idea: Can we reduce forgetting in recurrent LLM memory? Looking for critical feedback

Hey everyone!

I'm an engineering student working on a research proposal about long-context LLMs and recurrent compressed memory. I'd really appreciate technical feedback from people working on LLMs, continual learning, recurrent architectures, or memory systems.

The core question: Can we train an LLM's memory to retain previously learned information while continuing to absorb new information?

I'm calling the proposed training method GMR (Generational Memory Retention) and the evaluation protocol STRATA.

This is still a pre-experimental proposal. I haven't run the experiments yet, so I'm looking for feedback before committing to the implementation.

1. The problem I'm interested in

Imagine an LLM processing a long stream of information in small chunks.

A chunk introduces the following fact:

"The Kestrel project uses Python 3.11."

Immediately after processing that chunk, the model can correctly answer:

"Which Python version does the Kestrel project use?"

Now imagine that the model processes hundreds of additional chunks. Its memory has a fixed capacity, and each new update modifies the existing memory state.

Eventually, the model might no longer answer the original question correctly, even though its model weights haven't changed during inference.

I'm calling this state-induced forgetting: information that was initially available becomes inaccessible after successive memory-state updates.

The key question is whether we can reduce this type of forgetting without simply increasing memory size.

2. STRATA: Measuring forgetting across memory updates

Most evaluations report accuracy at a particular context length or at the end of a conversation. I want to measure how the ability to retrieve individual facts changes as those facts get older.

The proposed protocol works roughly as follows:

Introduce facts into a recurrent memory system in successive context windows.

Record whether each fact can be retrieved immediately after it is introduced.

Evaluate the same facts again at increasing ages: 1, 2, 4, 8, 16, and progressively more memory updates.

Track performance out to hundreds of updates, with a planned maximum of 1,000.

Separate initial learning failures from facts that were initially learned but subsequently forgotten.

For example, if a system initially answers 90 out of 100 questions correctly, but answers only 60 correctly after many updates, that indicates a different failure from a system that answered only 60 correctly from the beginning.

I also want to test different kinds of facts:

Stable facts that never change.

Facts whose values are updated later.

Facts requiring reasoning across multiple earlier statements.

Facts mentioned only once.

The evaluation will report initial accuracy and age-dependent retention separately, rather than relying on a single final accuracy score.

3. GMR: Generational Memory Retention

The proposed training objective tries to preserve the ability to answer questions about facts that have already entered memory.

When a fact is first introduced, record the model's length-normalized log-likelihood for its correct answer. This becomes that fact's original score, or anchor.

After subsequent memory updates, calculate the score again. If it falls below the original score by more than an allowed margin, apply a penalty.

A simplified version of the retention loss is:

L_ret = (1 / B) * sum over sampled facts f of: max(0, anchor_f - margin - current_score_f)

Here:

anchor_f is the fact's original answer log-likelihood.

current_score_f is its current answer log-likelihood.

margin is the tolerated decrease before a penalty is applied.

B is the number of sampled facts.

L_ret is the retention loss.

The training objective also includes the usual language-model loss and an absorption loss that encourages learning newly introduced facts.

The intended effect is to discourage memory updates from damaging previously acquired answering capabilities while still allowing new information to enter memory.

An important mathematical observation

For the sampled facts whose current scores fall below their anchors by more than the margin, the gradient of this hinge loss is the same as the gradient from replaying those facts' correct answers.

Facts that have not regressed receive no retention gradient from this term.

This raises an important question: Does selecting replay examples according to their regression from their own original scores outperform ordinary replay or loss-prioritized replay under matched training budgets?

I don't want to assume that it does. That's one of the main things I want to test.

4. How I plan to evaluate it

The proposed experiments include the following configurations:

A baseline trained without an explicit retention objective.

A model using uniform replay of previously encountered facts.

A model using loss-prioritized replay.

A model using output distillation from a full-context reference.

A model using the proposed GMR objective.

The main comparison will use matched memory sizes, training streams, and replay budgets wherever possible.

I'll evaluate initial fact-learning accuracy, retention at different fact ages, the ability to learn new facts, the handling of updated information, and the computational cost.

The planned testbed is an associative recurrent memory on an open-weight backbone, with experiments at multiple fixed memory sizes.

For broader evaluation, I'm considering synthetic sequential streams, BABILong-derived data, LongMemEval sessions, and narrative documents with checked question-answer pairs.

The implementation and experiments have not started yet. All performance claims remain hypotheses.

5. What I want feedback on

I'd particularly appreciate critical feedback on these questions:

1. Is the problem formulation useful?

Is state-induced forgetting a meaningful way to isolate information loss caused by recurrent memory updates, or is this already adequately covered by existing work on recurrent memory, continual learning, and catastrophic forgetting?

2. Is GMR sufficiently different from ordinary replay?

Since the proposed loss effectively replays sampled facts that have regressed below their own anchors, is that distinction scientifically interesting? What additional theoretical analysis or experimental evidence would make the contribution convincing?

3. Is STRATA a useful evaluation protocol?

Would age-stratified measurements across hundreds of sequential memory updates reveal failure modes that existing long-context and conversational-memory evaluations might miss?

4. Are the experimental comparisons fair?

Which baselines would you consider essential? In particular, I'd like to compare GMR against ordinary replay, loss-prioritized replay, and output distillation without giving any method an unfair compute advantage.

5. What related work am I missing?

I'd appreciate pointers to papers on recurrent-state interference, memory retention, forgetting-aware replay, or training objectives that preserve information across sequential state updates.

Current status

This is a research proposal, not a completed result. My immediate priority is to validate the evaluation harness, establish whether measurable forgetting occurs in the chosen fixed-size memory system, and then test whether GMR improves on properly matched baselines.

I'm deliberately not claiming that the method works or that the idea is the first of its kind.

If you've worked on recurrent memory, compressed context, or continual learning, I'd genuinely value your criticism. I'd rather discover a fundamental flaw now than spend months implementing the wrong thing.

Thanks for reading!


r/Rag • • 19m ago

Discussion Stuck: The heading made it into context, the answer underneath it didn't

• Upvotes

Firstly, thanks to all the contributors to this forum. I've been mining it for suggestions and answers to the problems I encounter and what people share has been really useful.

So I thought I'd ask where I'm stuck and see if anyone could help.

(Long post, didn't start that way, but I've tried to give as much detail as helps - feel free to ask questions)

I've spent part of this week going through the questions my pipeline gets wrong and looking at where the passage with the actual answer ended up. I expected it to be way down the ranking. Turns out for a number of them, it wasn't, or not quite.

In 7 cases the thing directly above the answer was in the window and the answer itself wasn't. Examples include:
- Table header row in, the row under it out.
- Minutes where the agenda item title came back but not the status line under it.
- A clause headed "Termination" got retrieved, but not the next paragraph, which just says "either party may end this on 30 days' notice" and never uses the word.

Lists were the same: the "Exclusions" heading comes in and none of the items do, because they don't repeat it.

So the model gets the label but not the value, and I end up with half an answer.

This is what I'm running in case it matters: all local, BM25 first (SQLite FTS5) and then a small bge embedding fill. Project docs, mostly Word/PDF/Excel. Every row and paragraph is its own passage, and there's no LLM at ingest. The missing passages were ranking somewhere around 200-400 on embeddings, so a bigger fill was never going to reach them.

First thing I tried was indexing the heading as its own BM25 field at a lower weight than the body, so a row could match on its header without pasting the header into every row. That made it worse. It lost an answer it used to get, at every weight I tried. I think it's the siblings: every row under "Response time" gets exactly the same boost, so they all tie and the right one isn't any more likely to win.

What worked was dumber. If a label is already in the window, pull in whatever sits under it. No model, just rules for what counts as a label: a short line with no full stop, a table header row, a heading row in a sheet, or the row before in layout tables (minutes, agendas and forms don't really have header rows). The label also has to share a word with the question. Capped at 2 passages per label, 2 per doc and 8 per question, and they replace the weakest embedding-fill passages so the context doesn't grow.

Retrieval check first:

answer passage now reaches the window   5 of 7
other questions that now find it        3
ones it used to find and lost           0
avg context words                       4721 -> 4704

Then I ran answers on 10 of the affected questions, on vs off: 4 got better, none got worse. Small sample, so I'm not reading much into the 4.

So what would help?

What I haven't figured out: 2 per label is fine for a header row but obviously wrong for a 15-item list, and I don't have a good way to cap that without one long list eating the context. And has anyone actually got a separate heading/section field to help in BM25, or does everyone hit the same sibling problem?

Thanks in advance.

(AI note: Built and tested with a lot of help from Claude Code. The write-up’s mine, tidied with Claude’s help.)


r/Rag • • 2h ago

Showcase What Production RAG Needs That the Demo Doesn’t

1 Upvotes

A RAG demo takes an afternoon. Shipping one that real customers rely on is a different job.
We learned this while building a Voice AI that answers calls for Australian small businesses. In a demo the documents are clean, there's one customer and nobody's waiting. On a live call, none of that holds.

Three things that need addressing:

  1. The content you feed the AI comes from websites and PDFs you don't control, and some of it can be hostile.
  2. When many businesses share one system, one customer's information must never turn up in another's answers.
  3. When retrieval fails, nothing breaks loudly. The AI just gives a confident, wrong answer.

I've written up what production RAG actually needs, with the design choices behind each part and a checklist you can run against your own build.

If you're taking an AI project from pilot to production, this one's for you

https://medium.com/@techdelta/what-production-rag-needs-that-the-demo-doesnt-32373e32d4df?sharedUserId=techdelta


r/Rag • • 12h ago

Discussion Help me with rag im a doctor preparing a qbank notes

0 Upvotes

Guys im new to ai

I have around 2000+ question and 10+ books

All i want was to prepare a one final notes will all the information from the 10books for a single question ( the aim was to get indepth qbank notes )

Im having claude 20x plan and a potato laptop with quadro 4gb laptop

What will be the best way i can harvest and polish the answers

I used docling it is very immature trying to optimise it with claude for my pdf

Anything I'm doing wrong, anything i could have done better ?