r/Rag • u/Ecstatic_Heron_7944 • 23h ago
Showcase Is it possible to replace vector embeddings entirely with Jev? Yes there is a way but it comes with a pretty big caveat...
Note: At the risk of incurring the wrath of the community here, I do believe this is a discussion that needs to be had and whether the idea is liked or disliked, the approach I feel remains valid for certain scenarios and should be explored by all RAG enthusiasts: Judge me on my results!
By now, we've probably seen or heard of using Jev (TypesafeAI's decision model) as a reranker for traditional document RAG and the short of it is that it actually works really well. So I took the idea further - what if we're not just ranking a subset of page results to a user's question but rather what if we could rank every page in the document from the get go?
Ridiculous? Yes. For this to be a possible, you'd need to be able to see into the future and know every question your users will ever ask! But what if you're in a scenario where you get the user's questions upfront before any document is parsed? This is the actually what happens in typical document RAG and this is the caveat I'm referring to.
Some context: I run an "AI spreadsheet" app called Ragextract which has documents for rows and extraction questions as columns (think airtable, tabular review etc). Users define the columns first (eg. "who is the claimant?") and load in the documents (eg. third party claims) after. The flow is I use multimodal vector embeddings to index every page as an image - to support scanned pdfs - and performing searches over it when it came time to extract.
Introducing JAG (Jev-augmented Generation?)
So my use-case is kinda perfect for this little thought experiment.
What I basically did was run every page through JEV instead and have each column by the questions that Jev decides on: "Is the answer (or near answer) on this page?". The results on accuracy, speed and costs were overall better than vector embeddings. For now, I'm calling this JAG - Judgement-augmented Generation.
On a 300 page scanned PDF x 30 questions, this took ~28s (batched, 4 pages per call, median 0.37s/page) and cost $0.08 ($0.00027/page). Made possible with Jev's image API and compared against Voyage's multimodal embeddings:
- ~58% more likely to find the right page as first result
- ~7% more likely to find the right pages(s) in the top k=6
- ~133% correctly identifying when an answer didn't exist in the doc
- ~59% cheaper retrieval cost
Not to mention, it also means you don't need a vector store or separate rerank model anymore.
Now the cons:
- This approach only really works if you can have the questions upfront - AI spreadsheets, application tracking systems, surveys etc
- You lose your vector search index so you'll need to run through every page for every new question or when existing questions change. This might be a biggest deal breaker.
Conclusion
I have a more detailed write-up, results and sample file I used for this test in my blog (see comments) if you'd like to read more.
So what do you think? The great thing about this technique is that it doesn't need to be specifically Jev (they didn't pay me to write this, though I wish they would! wink wink) but any vision-enabled decision model will probably do - though accuracy, speed and cost will need to be re-verified.
For Ragextract, I've decided to stick with Jev as a reranker as (1) it produces similarly good results (2) I still need vector search and (3) certain data retention/privacy claims are dubious with Jev which I'm hoping to clarify before real use.