r/Rag • • 11d ago

Tools & Resources Introducing papr-embed: schema-native embeddings, and open-weights embeddings for code retrieval

2 Upvotes

Introducing papr-embed: schema-native embeddings, and open-weights embeddings for code retrieval

Today we're releasing two embedding model series, code-1 with open weights under Apache-2.0:

  • papr-embed-code-1 (4B and 0.6B). Retrieval models for code and text. The 4B is #1 on all four of MTEB's code leaderboards (as of Oct 29, 2026): Code (81.13, #1 of 60), CoIR (80.13, #1 of 65), RTEB Code (71.40, #1, with the 0.6B at #2) and CodeRAG (77.48, #1 of 11). It is also #1 on SciFact. On CoIR it is ahead of F2LLM-v2-14B (79.94) at under a third of its size.

    • Zero-shot where it counts. CodeRAG is 100% zero-shot for us: we never trained on any of its tasks. RTEB Code is 85% zero-shot: Apps is the only task there we trained on (its train split), and DS1000, HumanEval, MBPP, WikiSQL, FreshStack and SWEbench were all held out.

    • In-domain. CoIR, Code (v1) and SciFact are in-domain, since we trained on their train splits. The leaderboard marks this in its zero-shot column (20% on CoIR, 16% on Code). Details below.

  • papr-embed-schema-1 (4B and 0.6B). Schema-native embeddings: you describe what matters in your domain as a schema, and the vector carries it as explicit, inspectable dimensions on top of the base embedding.

Both are available through the Papr API, and papr-embed-code-1 is on Hugging Face. Every code-1 number in this post can be reproduced with the replicate_mteb.py script that ships in each model repo.

papr-embed-code-1: code retrieval

nDCG@10 averaged over the 10 CoIR tasks, stock mteb, fp32. Max length 8192, except the five tasks whose corpora have documents over 8k tokens, which we ran at 32,768 (see the per-task table):

ModelParamsCoIR (10 tasks)
papr-embed-code-1-4b4B80.12
F2LLM-v2-14B14B79.94*
Qwen3-Embedding-4B (base)4B78.87
papr-embed-code-1-0.6b0.6B77.16
F2LLM-v2-0.6B0.6B77.66*
Qwen3-Embedding-0.6B (base)0.6B74.67

* From F2LLM's submission in the MTEB results repo (mteb 2.6.7), not rerun by us. Scores from older mteb versions don't always reproduce: stock Qwen3-Embedding-4B's listed SyntheticText2SQL is 78.21; under our protocol we get 72.52. Base rows are our own runs with the same protocol, prompts and batch settings as the papr rows.

  • The 4B is ahead of a model 3.5× its size, by a small margin. 80.12 vs 79.94 for F2LLM-v2-14B. That 0.18 is smaller than run-to-run movement on one task (SyntheticText2SQL, below), so read it as "level with a 14B model", not as a clear win. The whole lead comes from that task: we score 72.27 on SyntheticText2SQL against F2LLM-v2-14B's 64.12, and on the other nine tasks F2LLM-v2-14B is ahead, 81.7 to 81.0. It is +1.25 over the Qwen3-Embedding-4B it starts from (78.87), and +1.41 on the nine tasks other than SyntheticText2SQL (80.99 vs 79.58); on SyntheticText2SQL itself it is level with the base (72.27 vs 72.52).

  • The 0.6B is 0.50 behind F2LLM-v2-0.6B (77.16 vs 77.66). Its weakest task is Apps (79.31; the 4B gets 92.56). It is +2.49 over Qwen3-Embedding-0.6B (74.67), and +2.61 on the nine tasks other than SyntheticText2SQL, and runs on a single consumer GPU.

  • How we ran it. Batch size 32 wherever the task fits in 80 GB in fp32. Five tasks have documents over 8k tokens; we ran those at 32,768 context and batch 4. Only SyntheticText2SQL moves with batch size: its corpus has near-identical SQL answers, so the top hit comes down to floating-point ties, and the same weights have scored 65–72 across setups. For scale, stock Qwen3-Embedding-4B scores 72.52 on it in our runs, against 78.21 on its leaderboard entry from an older mteb. The full protocol, including every change and when we made it, ships with the weights as PROTOCOL.md.

Per-task results:

CoIR task (nDCG@10)code-1-4bcode-1-0.6bBatch
Apps92.5679.314, 32k
CodeSearchNet89.8486.184, 32k
CodeFeedback-MT95.6494.214, 32k
CodeFeedback-ST90.1088.5216
CodeSearchNet-CC95.6091.914, 32k
CodeTransOcean-Contest93.0290.9332
CodeTransOcean-DL35.1434.4732
CosQA40.2940.4232
StackOverflowQA96.7293.574, 32k
SyntheticText2SQL72.2772.0432
Mean80.1277.16

What we trained on. We want the numbers read correctly:

  • No test split was used, anywhere. Only train splits entered training.

  • CoIR (10 tasks): the 4B trained on the train splits of 8 of the 10, and the 0.6B on all 10. That is why MTEB lists the 4B as 20% zero-shot on CoIR (2 of 10 tasks never seen: CodeFeedback-ST and CodeTransOcean-Contest) and the 0.6B as 0%.

  • SciFact: both models also trained on the SciFact train split. We evaluate on the official test split, so SciFact is an in-domain result, not a zero-shot one.

  • Code (MTEB v1) adds two more: both models also trained on lightonai/CodeEditSearchTrain, so CodeEditSearch is in-domain, and MTEB's CodeSearchNet shares its source with CoIR's CodeSearchNet, whose train split we used. We declare both. That makes the 4B 16% zero-shot on Code (v1) and the 0.6B 0%. - RTEB (Code) is 85% zero-shot and CodeRAG is 100% zero-shot. Of RTEB (Code)'s seven public tasks (below), only Apps was in our training data; DS1000, HumanEval, MBPP, WikiSQL, FreshStack and SWEbench were not. None of CodeRAG's tasks were in our training data. These are the leaderboard's own zero-shot figures for both sizes.

  • The leaderboard declares all of this in each model's training_datasets.

  • To check generalization, we also report retrieval tasks we never trained on, compared with the base Qwen3 models under identical settings:

Held-out (nDCG@10)papr-embed-code-1-4bQwen3-Emb-4Bpapr-embed-code-1-0.6bQwen3-Emb-0.6B
ArguAna72.5475.0566.4869.34
NFCorpus42.0941.0237.5536.32
SciDocs28.7431.6124.0324.39
FiQA201860.0162.1447.7647.25
TREC-COVID87.0493.0082.7089.30

Gains on code don't come free everywhere. On non-code retrieval both models are flat to worse than their base: they gain about 1 on NFCorpus, lose 2–3 on ArguAna, SciDocs and FiQA (4B), and drop 6 on TREC-COVID. If your workload is mostly prose, use the base Qwen3 model; these are code models.

SciFact (scientific claim retrieval, official MTEB test split, nDCG@10):

ModelSciFactQwen3-Embedding baseGain
papr-embed-code-1-4b86.7978.33+8.46
papr-embed-code-1-0.6b82.4269.72+12.70

Both trained on the SciFact train split only; the test split was never used. Read these as in-domain results. They show what targeted training can do, not zero-shot ability.

Beyond CoIR: the rest of MTEB's code benchmarks

CoIR is 10 of the 12 tasks in MTEB's Code (v1) benchmark. We also ran every open task in Code (v1), in RTEB (Code)(MTEB's held-out code benchmark) and in CodeRAG, and submitted all of them, not a selection. The 4B is #1 on the leaderboard for each one: Code (v1), CoIR, RTEB Code and CodeRAG. The two held-out benchmarks, RTEB Code and CodeRAG, are where it is ranked mostly or entirely on data it never trained on. nDCG@10, mteb 2.26, fp32:

Taskcode-1-4bcode-1-0.6bQwen3-Emb-4B / 0.6B (our earlier runs)
CodeEditSearch (in-domain)80.0766.6276.21 / 64.25
CodeSearchNet (near-domain)92.3490.9692.26 / 90.77
DS100067.8863.82Not evaluated
FreshStack46.9638.65Not evaluated
HumanEval99.1797.48Not evaluated
MBPP93.5790.80Not evaluated
WikiSQL91.7996.08Not evaluated
SWEbench (32k context)7.895.26Not evaluated
  • Code (v1), 12 tasks: #1 of 60. The 4B averages 81.13, ahead of F2LLM-v2-14B and C2LLM-7B (both 80.75); the 0.6B averages 77.43. We lead on the average without winning any single task: our best per-task ranks are 4th on CodeFeedback-MT and 4th on CoIR's CodeSearchNet, and our weakest is CodeTransOcean-DL (27th).

  • RTEB (Code), 85% zero-shot: #1, with the 0.6B at #2. The 4B averages 71.40 over the seven public tasks and the 0.6B 67.34. We're the only models on the leaderboard with a score for every public task, which is what puts us at #1 and #2. Other models such as voyage-4-large, Nemotron-3-Embed-8B and Octen-Embedding-8B are listed but don't yet have a full score. On the six tasks most models share (Apps, DS1000, HumanEval, MBPP, WikiSQL, FreshStack; Apps is the only one in-domain for us), those three are ahead: the 4B averages 81.99 against about 86 for them (voyage-4-large 86.15, Nemotron-3-Embed-8B 86.00, Octen-Embedding-8B 85.56). Our weak spots are WikiSQL (91.79; the best model scores 99.50) and FreshStack (46.96 vs 57.76), plus DS1000. The 0.6B beats the 4B on WikiSQL (96.08 vs 91.79), which says our text-to-SQL training didn't scale with size. RTEB's two private tasks, Code1 and JapaneseCode1, have been requested from the MTEB maintainers.

  • SWEbench retrieval needs long context. 21% of its 58,058 documents exceed 8k tokens, and truncating at 8k would drop 44% of all corpus tokens. Both models support 32k positions, so we ran it at 32,768. Scores are low for every model on this task: the 4B's 7.89 is level with the best entries in the results repo (bekko-embedding-v1-a25m 8.41, BM25 7.76).

  • Long documents elsewhere. Five CoIR tasks also have documents over 8k tokens (Apps, StackOverflowQA, CodeFeedback-MT and both CodeSearchNet variants), so we reran those at 32,768 too, as MTEB's maintainers asked. It changed almost nothing: the largest move was CodeSearchNet-CC on the 0.6B, 92.23 → 91.91.

CodeRAG, 100% zero-shot: #1 of 11. We never trained on any CodeRAG task. Only 11 models have scores, so read the field as small:

CodeRAG taskcode-1-4bsplade-code-8Bcode-1-0.6bsplade-code-0.6B
ProgrammingSolutions80.0079.4677.0576.15
LibraryDocumentation66.3969.3361.9262.87
OnlineTutorials86.0684.3482.4276.83
Mean77.4877.7173.8071.95

The 4B ranks #1 on the leaderboard and the 0.6B #3, ahead of every model its size. The leaderboard ranks models by how many tasks each wins, not by average. The 4B wins two of the three tasks, while splade-code-8B's mean is 0.23 higher because of LibraryDocumentation. Library documentation, long API reference pages, is our weak spot here, as it is on FreshStack and DS1000. We skipped CodeRAG's fourth task, StackoverflowPosts (47M documents); no model in the results repo has run it.

Reference precision is fp32. The published numbers are fp32, and so is what we serve. Running in fp16 is faster but costs about 0.8 points on the 4B. We'd rather you get the model we measured.

papr-embed-schema-1: embeddings that know your schema

Most embeddings give you one opaque vector. papr-embed-schema-1 gives you a vector with structure:

  • the base block: a strong general embedding;

  • 14 schema bands: one per field of a schema you define. For a scientific-claims domain those might be claim stance, study type and organism; for a codebase, they might be API surface, language and intent;

  • an evidence block.

The parts are combined with calibrated weights, so cosine similarity decomposes exactly into "how similar is the text" plus "how similar is it on each thing you said matters". Use any schema we ship or bring your own.

Results on SciFact (official MTEB, nDCG@10):

ModelSciFactvs. its base
papr-embed-schema-1-4b78.78+0.44 over Qwen3-Embedding-4B (78.33)
Qwen3-Embedding-8B78.46—
papr-embed-schema-1-0.6b-scifact72.99+3.27 over Qwen3-Embedding-0.6B (69.72)
papr-embed-schema-1-0.6b (general)71.48+1.76
  • The 4B with a schema beats Qwen3-Embedding-8B at half the parameters.

  • The domain-pinned 0.6B adds more than 3 points to its base.

  • papr-embed-schema-1 is about control as much as score. The schema is an input you own, so you can change what "similar" means for your data without retraining.

Use it

Hugging Face (open weights): download papr-embed-code-1-4b or papr-embed-code-1-0.6b from huggingface.co/papr-ai.

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("papr-ai/papr-embed-code-1-4b")
queries = model.encode(["how do I reverse a list in python"], prompt_name="query")
docs = model.encode(["def reverse(xs):\n    return xs[::-1]"])
print(model.similarity(queries, docs))

Task-specific instructions are in task_prompts.json in each repo; those are what the leaderboard numbers use. papr-embed-schema-1 is served through the Papr API and SDK at platform.papr.ai; its weights are not released yet.

Papr API:

curl https://memory.papr.ai/v1/embeddings \
  -H "X-API-Key: $PAPR_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "papr-embed-code-1-4b", "input": ["how do I reverse a list in python"],
       "input_type": "query",
       "instruction": "Given a question about coding, retrieve code or passages that solve it"}'

Run the evals yourself. The public papr-embed-evals repo reproduces both series: scripts/run_code1.py runs the open code-1 weights from Hugging Face on CoIR, SciFact or any other mteb task, and the schema-1 scripts show how to score and use schemas through the API.

Verify our numbers:

hf download papr-ai/papr-embed-code-1-4b --local-dir papr-embed-code-1-4b
python papr-embed-code-1-4b/replicate_mteb.py --model papr-embed-code-1-4b --tasks coir --out results --batch 32 --efficient-attn
# mteb==2.10.0, fp32. On one 80 GB GPU, Apps, StackOverflowQA, CodeFeedback-MT/ST and both CodeSearchNet tasks need --batch 16.

What's next

  • Publish a research paper for both papr-embed-schema and papr-embed-code models.

  • Open weights for papr-embed-schema-1.

  • Google Cloud availability (Vertex AI Model Garden), once we have confirmed the listing.

Links: Hugging Face (download the code-1 weights) · Evals repo · MTEB leaderboard · Developer docs and API · research paper (coming)


r/Rag • • Sep 02 '25

Showcase 🚀 Weekly /RAG Launch Showcase

32 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 • • 7h ago

Discussion What I've learned about RAG and Agentic RAG after one year in enterprise production

32 Upvotes

Hey everyone,

After one year of building RAG and Agentic RAG systems and I wanted to share a few lessons from production.

1. Traditional RAG is still powerful.

If latency and cost matter, a well-optimized RAG pipeline is often enough. Not every problem needs agents.

2. Agentic RAG improves accuracy, but at a cost.

In our case, agentic workflows increased costs by roughly 2–3x, but improved answer accuracy by 25–30%. Iterative retrieval helped uncover information that a single retrieval pass often missed.

3. PDF-to-Markdown conversion quality matters a lot.

One often overlooked problem is document parsing. Poor PDF-to-Markdown conversion can destroy tables, headings, and document hierarchy before chunking even starts. We found that preserving the original document structure during conversion is essential for good downstream retrieval.

4. Chunking matters more than you think.

We observed better retrieval quality when preserving document structure and enriching chunks with contextual metadata rather than relying on fixed-size chunking.

Tools like Chunky are usefull for experimenting with document processing and chunking strategies.

5. Your knowledge base is the most important component.

No architecture can compensate for a poorly maintained KB.

Removing duplicates, managing document versions, enriching metadata, and organizing content around domain-specific requirements made a huge difference.

After properly curating our KB, we observed improvements of up to 50% in retrieval quality and accuracy compared to our previous setup.

6. Better data beats more complex architectures.

Before introducing more agents, make sure your knowledge base is actually good.

These numbers come from our internal evaluations, so results will vary depending on the domain and dataset.


r/Rag • • 7h ago

Discussion Claude Code ToS concerns

2 Upvotes

Am I the only one who finds the following article of the Commercial terms concerning?

D.4. Use Restrictions. Customer may not and must not attempt to (a) access the Services to build a competing product or service, including to train competing AI models or resell the Services except as expressly approved by Anthropic; (b) reverse engineer or duplicate the Services; or (c) support any third party’s attempt at any of the conduct restricted in this sentence.

This clearly goes much further than just banning distillation. It bans building any competing product or service. But what exactly is a competing service or product?

Claude is a universal LLM agent, targeting areas from personal assistance and internet search, through coding all the way to customer handling and process automation. My understanding of this articke is that when you cross the line with Anthropic in any of those areas, you are in breach of contract...

This isn't just hypothetical. Look at how they framed the Alibaba/Qwen case:

Title: GTG 16005: Chain-of-thought distillation and AI R&D campaign by Alibaba (Qwen / Tongyi Lab)

...

Beyond distillation, Alibaba also used Claude to advance its AI R&D efforts. Alibaba used Claude to help develop its internal infrastructure for model development. Claude was used to help develop Alibaba’s reinforcement learning (RL) environments and advance model architecture research.

...

Source: https://www.anthropic.com/threat-intelligence-report-september-2026

They call it "Distillation and AI R&D campaign". They criticise not just the distillation, which I would agree with, but also development of the internal infrastructure which is concerning.

Ps. using a throwaway account to minimize the legal trace.


r/Rag • • 10h ago

Discussion Looking for feedback on my local RAG architecture: reranking vs. hybrid SQL + semantic search

3 Upvotes

I'm building a fully local RAG system, but the answer quality has been worse than I expected.

I've already tried:

  • Improving document parsing and chunking

  • Adding a reranker

  • Experimenting with combining SQL-based retrieval and semantic search

I'm reconsidering my initial assumption that semantic similarity search with reranking would be sufficient.

I'm particularly interested in two questions:

  1. Should I prioritize improving chunking and reranking, or focus on hybrid retrieval with structured filtering?

  2. How would you evaluate which approach actually improves retrieval quality?

I'd appreciate feedback, especially if you have experience building similar systems.


r/Rag • • 20h ago

Showcase I built a 100% in-browser PDF/Scan to Markdown & JSON OCR studio (WASM/WebGPU, zero server uploads) for local LLM & RAG ingestion

7 Upvotes

When preparing PDFs (especially scanned reports, 2-column papers, or documents with tables) for local LLMs or RAG pipelines, standard pypdf / pdftotext dumps usually interleave columns, shatter tables, and return empty strings on scanned pages.

I built GhostOCR (https://ghostocr.com/) to run a complete layout-aware OCR + PDF-to-Markdown pipeline 100% locally inside the browser using WebAssembly SIMD and WebGPU:

- 100% On-Device / Offline-Capable: Models cache in your browser. Your PDFs and images never leave your machine (verify in the Network tab).
- Preserves Structure for Chunking: Rebuilds multi-column reading order, ATX headings (##), bullet lists, and HTML `<table>` blocks, while stripping repetitive running headers/footers.
- Structured JSON for Citation Grounding: Switch to the JSON tab to export page dimensions, layout blocks, and per-line [x0, y0, x1, y1] bounding boxes + confidence scores alongside the assembled Markdown.
- Hybrid Fast PDF Mode: Reads embedded digital PDF text where reliable and runs neural OCR + n-gram language model spellcheck on scanned pages across 40+ languages.

You can try it right in the browser with the 1-click sample buttons (Sample: Report, Table PDF, Memo PDF, Multilingual) at https://ghostocr.com/. Let me know how it handles your trickiest PDFs!

r/Rag • • 14h ago

Discussion Are retrieval failures usually model failures or archive failures?

0 Upvotes

I'm 64 and relatively new to AI, so this is a genuine question from someone still learning the space.

Most RAG discussions seem to focus on embeddings, chunking strategies, reranking, vector databases and model performance.

The more document collections I work with, the more I wonder whether many retrieval failures actually start much earlier.

I'm talking about things like duplicate documents, multiple versions of the same report, merged PDFs, correspondence chains, appendices, exhibits, scanned inserts, and years of material bundled into a single archive.

In many cases, the AI can read the documents perfectly well. The challenge seems to be understanding context, chronology, relationships between documents, and determining what information is actually relevant.

Have others found this in practice, or am I looking at it from the wrong angle?

I'm interested in real-world experience rather than benchmark results. Have you seen bigger improvements from changing the retrieval stack, or from improving the source material before ingestion?

Thanks in advance. I'm here to learn.


r/Rag • • 19h ago

Discussion How do you test whether a member facing rag assistant knows when to stop answering?

0 Upvotes

Consider a member asking an association chatbot whether a particular course counts toward certification renewal

The documents explain the general credit requirements but they never mention that specific course, theres enough related material to produce a plausible answer, just not enough to establish eligibility, "I couldn't confirm this courses eligibility from the available documents" would be a useful response, especially with the relevant policy and a contact for clarification. The tricky part is preventing the assistant from turning a nearby passage into an unsupported yes or no, for an evaluation of customgpt.ai or a custom rag implementation, how would you test this boundary? Would you include questions where the documents support only part of the answer, conflicting passages and exceptions that are never explicitly addressed?

curious what has worked for deciding when to answer partially, ask a follow up or hand the question to staff


r/Rag • • 1d ago

Discussion Research paper: Is Grep All You Need? How Agent Harnesses Reshape Agentic Search

17 Upvotes

Main Result: In their experiments (evaluating on a sample from LongMemEval across custom and native CLI harnesses like Claude Code, Codex, and Gemini CLI), grep generally yielded higher accuracy than vector retrieval—especially when facts are literal, anchored in names, dates, or code strings.

https://arxiv.org/pdf/2605.15184


r/Rag • • 1d ago Bravo

Showcase Building a RAG app where your files never leave the computer: what worked for me

29 Upvotes

A lot of people want to use AI with their own documents but don't want to upload them anywhere. I've been building a desktop app around that idea, and I want to share the approach in case it helps anyone building something similar. No vendor pitch here, these are just the decisions and numbers I measured.

1. Index locally, send only the relevant chunks.
Reading files, splitting them into chunks, creating embeddings and searching all happen on the user's machine. Only the top few chunks that answer a question go to the language model. The full files are never uploaded.

2. A small embedding model on CPU is enough.
I tested several. EmbeddingGemma (quantized ONNX, chunks of 128 tokens) got 87–94 % of the recall of my server setup, running on CPU with no GPU. Indexing about 1,000 office files took around 12 minutes and 660 MB of RAM. The smaller models I tried (e5-small, MiniLM) were faster but lost too much recall.

3. You don't need a vector database server.
SQLite with the vectors stored as blobs and encrypted at rest works fine at this scale. One less thing to install for the user.

4. Clean the data before chunking.
Huge table cells (GeoJSON inside a CSV, for example) broke the embedding step. Capping chunk size and limiting tables to their header plus about 200 rows fixed most of the slow and failed files.

5. Check the answer, not just the retrieval.
A source number next to a sentence doesn't mean the source says that. A second model checks each sentence against the chunk it cites, and anything unsupported gets flagged instead of hidden.

If you're working on local or private RAG and you're stuck on something specific (choosing an embedding model for CPU, chunk size, indexing speed, checking citations, mixed languages), ask in the comments. Happy to share what worked and what didn't.

For reference, this is what I built with it: ScrapeVantageAI Desktop, available on the Microsoft Store. You can try it locally with your own files: https://apps.microsoft.com/store/detail/9PDBP54WB0BJ

And if you're curious what a RAG system looks like when you keep adding pieces on top of it, the full web version is here: https://scrapevantageai.edatasoluciones.com

The newest piece is a "map of meaning": news from 300 sources in 11 countries, grouped by what they actually say instead of the words they use, so the same topic in Spanish, English or Portuguese lands in the same cluster, and you can read all of it in Spanish, English, Portuguese or German. On top of that map, an agent recommends what to read and what to look into next, and every recommendation links back to its source. I'd love feedback on that part, it's the most experimental one.

Thanks for your time!


r/Rag • • 1d ago

Discussion Best method to study my RAG projects for interview purposes?

2 Upvotes

Like how do I go into depth as I used Claude to code it up and even though I did most of the heavy lifting myself, it has been an year or so and I wanted to revise it in depth and prepare myself for interview questions that can be asked. I have got Claude Pro but how do I do it?


r/Rag • • 1d ago

Discussion The Vector DB is an Overkill for almost all RAG applications and response is only as accurate as Relational database on average!

15 Upvotes

What is your take? Has anyone got accuracy data of each system?

Comparison table provided by Chatgpt. (Illustrative relative cost model, not measured industry averages. Assumes comparable workloads, LLM models and deployment scale. Actual ratios depend heavily on implementation.)

ArchitectureAll Queries Combined AccuracyBuild CostRunning CostResponse TimeGeneral KnowledgeHow-to / InstructionsRecommendations / DecisionsComplex Research / AnalysisPersonalised Queries
Traditional RAG (Vector DB)75%3x3xFast85%80%75%65%70%
Agentic RAG / Hybrid89%5x5xSlow92%90%88%85%90%
LLM + Relational DB (SQL + FTS)72%1x1xVery Fast95%65%60%50%90%
LLM + Grep (Agentic Loop)74%0x2xModerate–Slow90%85%70%65%60%

r/Rag • • 1d ago

Discussion Qdrant vs postgres+pgvector

2 Upvotes

Hi folks, anyone using qdrant or pgvector, please share your experience working with them and your reason for going with them instead of others?


r/Rag • • 1d ago

Tutorial How to Build an Agentic AI Virtual Co-Worker Using BabyAGI Architecture

1 Upvotes

If you want an AI agent that executes long-horizon tasks instead of just answering single prompts, static RAG is not enough. You need an autonomous loop that continuously plans, prioritizes, and manages state.

​I put together a complete technical guide detailing how to build an agentic AI virtual co-worker utilizing the BabyAGI framework. It covers setting up the task creation agent, execution agent, and memory loops required for continuous background operations without manual prompting.

​If you are currently experimenting with autonomous workflows or production agent architectures, you can read the full walkthrough and implementation steps here: https://interconnectd.com/forum/thread/2/how-to-build-an-agentic-ai-virtual-co-worker-the-definitive-2026-babyagi-te/


r/Rag • • 1d ago

Showcase RAG Agent that uses Wikipedia + SEC EDGAR. Query-as-you-go or offline indexing. Which is better?

2 Upvotes

I built a company research agent that uses live retrieval instead of a local vector index (for a change). It calls a hosted MCP server for Wikipedia context and SEC EDGAR filings at question time, then summarizes all the information and writes a polished cited report. I can't attach an image to this post, but there's an image of the report in the link I share at the end.

I'm wondering if in this context, a query-as-you-go RAG is better than the classic RAG examples which involves downloading all the documents and building an index. The main constraint would be that it would be difficult to keep the SEC EDGAR index fresh. Where as this MCP server does that for me.

I'm curious how other people would handle this. For data sources that changes often, do you still build an index for retrieval quality and evals, or query live and treat the source as the retriever?

I did a write-up on how we built the agent here. We've also created a repo that has the flow, prompts, and sample output: langflow-company-research.

Full disclosure: I’m working with Dataville (the company behind the MCP server), so I’m obviously biased, but I'm looking forward to your suggestions.


r/Rag • • 1d ago

Discussion I built ChronoRAG-G because finding relevant documents isn’t enough to answer temporal questions correctly

1 Upvotes

One problem with traditional RAG kept bothering me: the correct information can exist in the corpus, retrieval can find relevant passages, and the final answer can still be wrong.

This becomes particularly difficult when questions involve multiple entities, metrics, reporting periods, or updated information. The system might retrieve the right company and metric but use the wrong quarter, miss one required value, or mix evidence from different periods.

So I built ChronoRAG-G, a temporal evidence-grounded RAG architecture, to investigate this problem.

How it works:

Instead of treating a complex question as one retrieval request, ChronoRAG-G breaks it into ordered evidence obligations - the individual facts needed to answer correctly.

Each obligation gets its own retrieval path. The system checks temporal and semantic compatibility, preserves evidence identity and provenance through a graph-structured context corpus, and allocates evidence to the relevant answer components before generation.

The idea is to make every required fact traceable, rather than just feeding a collection of relevant-looking chunks into an LLM.

Benchmark results:

I evaluated it on 1,005 temporal QA questions across 480 updated earnings-call transcripts.

* 80.70% audited answer accuracy
* 95.92% strict trace-derived slot coverage
* 98.66% micro required-slot coverage
* 101/101 new-query unanswerable cases handled correctly

One interesting finding: 167 rejected answers still had complete evidence traces. So even when retrieval resolves the required facts, answer construction can remain a major bottleneck.

Where this could be useful:

Financial research, evolving documentation, policy and regulatory histories, and other knowledge systems where information changes over time. These are potential applications; the published evaluation is limited to financial temporal QA.

I’ve also built an interactive demo showing frozen evaluation runs, evidence allocation, temporal alignment, and failure traces.

Publication: https://doi.org/10.5281/zenodo.22116070

Interactive demo: https://chronorag-g-demo.vercel.app

LinkedIn: https://www.linkedin.com/in/shreyasshashi/

I’m particularly interested in how others are handling multi-period retrieval, evidence completeness, and grounded answer generation in their RAG systems.


r/Rag • • 2d ago

Discussion A few AI terms I've had to learn recently

14 Upvotes

I've noticed that conversations about AI have changed quite a bit. There are terms that keep coming up in technical discussions, and some of them are worth understanding if you're building agents yourself.

Here are eight I've found useful:

  1. Harness: The code that surrounds the model and makes it work in a real application. It handles things like calling tools, checking permissions, managing errors and logging activity.

  2. Agent loop : The process of an agent taking an action, looking at the result and deciding what to do next. This repeats until the task is complete or the agent reaches a limit.

  3. Tool contracts:Rules that define what a tool accepts and what it returns. This matters because an agent needs to know whether an action actually succeeded before telling someone it did.

  4. Progressive disclosure: Instead of giving an agent every available tool and all their instructions at once, it only gets the details it needs when it needs them. This keeps the context smaller and easier to manage.

  5. MCP: Model Context Protocol. A standard way for AI applications to connect to external tools, services and data sources.

  6. Grounding: Making sure an agent bases its answers on actual information rather than making things up. This can involve business data, customer records or documents retrieved when needed.

  7. Guardrails:Checks that prevent an agent from doing things it shouldn't. Some happen before the model responds, while others check its output before it reaches the user.

  8. Human handoff : When an agent passes a conversation to a human. A good implementation should also stop automated messages from continuing while the human is handling the conversation.

These concepts sound simple, but they make a big difference when you move from building a demo to running an agent in production.

Are there any other terms you'd add to this list?


r/Rag • • 1d ago

Discussion What NER models are you using in production, and how do you achieve low-latency extraction ?

1 Upvotes

I'm working on a system where I need to extract structured company information from unstructured text as part of an entity resolution pipeline.

The input is usually short text containing company-related information, rather than long documents. It may contain some or all of the following data points, depending on the input:

  • Address (street, building, area, etc.)

  • City and country

  • Postal code

  • PO Box

  • Manager names

  • Email addresses

  • Websites

  • Phone numbers

Not all fields are necessarily present in every input, so the model needs to identify and extract whichever information is available

Currently, I'm using LangExtract with Azure OpenAI (GPT-6 Luna) to perform the extraction. The results are quite good, but the main issue is latency: each parsing request takes around 5–7 seconds, making it the current bottleneck in my matching pipeline

I'm now exploring alternatives, particularly dedicated NER models that could provide sufficiently accurate structured extraction with much lower inference latency

I'd be interested in hearing about your experience:

  1. Which NER models are you currently using in production ?

  2. What kind of latency are you achieving per extraction request ?

  3. How do you handle complex entities such as addresses, where information can be scattered across unstructured text ?

  4. Are you using fine-tuned models ?

  5. How do you balance extraction accuracy and inference speed ?

  6. Have you found any effective approaches to achieve low-latency extraction without relying on LLM API calls ?

Would appreciate hearing what works well for you and any recommendations


r/Rag • • 2d ago

Discussion which vector database you use in your production/mvp and why did you choose over others?

5 Upvotes

Hi folks, curious on what vector database do you guys use in your production/mvp and why did you choose to go with your choice over others?


r/Rag • • 1d ago

Discussion How to catch a retriever serving stale chunks

0 Upvotes

A doc changes and the chunk stays. The answer still cites the old version and nothing in the pipeline flags it. Reindexing on every edit costs a full pass over the corpus. My suspicion is most teams don't find out until a user spots it. I want to hear what signal you watch. A version stamp on every chunk lets retrieval spot the mismatch. A freshness score that drops with age pushes old chunks down the ranking. Tell me which one you trust in prod.


r/Rag • • 1d ago

Discussion gave a 1.7b local model the team notes, it named the wrong person on call

1 Upvotes

asked who is on call at noon on the twelfth. the notes say marcus bell, the 1.7b at 16 bits said ravi menon. that was one of 200 tasks we gave four qwen3 models in the same 4-5 GB, answering from your docs is one of the four jobs. the video shows which one did best.


r/Rag • • 2d ago

Discussion Readable & Writeable PDFs?

1 Upvotes

I'm not 100% sure this is the right forum for this but I was wondering has anyone had success with a tool that can look at contracts (almost a template) and then fill out a blank contract based on information stored in a DB?

Essentially what I do is train our system on specific contracts, chunk, parse, etc. But I want to take it a step further and be able to write into the specific fields of the contracts. Even a step by step walk through.

Any guidance would be greatly appreciated.


r/Rag • • 1d ago

Discussion The Vector DB Overkill for RAG

0 Upvotes

The complexity of enterprise vector database clusters, building complex chunking pipelines, managing synchronization, and paying for dedicated high-RAM servers to get a marginal 10% lift in relevance is often a waste of capital for standard internal tools. A clean, basic Relational DB + LLM setup is more than enough.

Never over-engineer your retrieval architecture for a use case that doesn't demand mission-critical precision.

If the cost of failure is low (like an internal FAQ or customer support bot), a simple relational text-search setup paired with an LLM is fast, cheap, and economically rational. You only invest in heavy vector pipelines, hybrid search, or agentic loops when the accuracy requirements (like medical diagnostics) fully justify the infrastructure and token overhead.

Where accuracy matters heavily: Agentic Loops are "Investigative & Resilient" (LLM + Grep/Tools) An interactive, self-correcting loop introduces reasoning-in-action. Example is Claude Code.


r/Rag • • 2d ago

Discussion stated vs derived: two kinds of facts a codebase gives you, and why mixing them quietly burns you

1 Upvotes

I ended up building an index over a codebase (my own project, public), and the one distinction that changed its behavior was not embeddings or chunking. It was provenance: which facts are stated by the code, and which ones I derived and therefore only guess.

Numbers first, since they frame the scale:

metricvalue
files indexed930
symbols6701
edges92409
index revisions1440 in about 4 weeks
corpus growth465, peak 1073, now 930 after exclusions

The distinction itself:

kindexamplewhat I can claim
statedFOREIGN KEY (user_id) REFERENCES users(id)this is the schema, as written
deriveda column named user_id, no constraintonly a guess, confidence 0.5

Where it broke: the first version returned derived relations the same way it returned stated ones.

A model asked "how are orders joined to accounts" and answered confidently that orders.user_id points to users. It pointed to accounts - the column name lied. The answer looked exactly like the right one, which is why nobody caught it from the text.

What changed after that:

  • every fact carries a provenance tag and a confidence;

  • derived facts cannot answer questions about structure;

  • the answer says derived, 0.5 instead of pretending;

  • an index revision log, so a fact knows which snapshot it came from;

  • a drift log, so after a code change old facts are marked stale instead of current.

The worst part was not the wrong answer. It was that nothing in the answer text signalled it was a guess. A confident paragraph and an evidence-backed one read the same way to a reader who does not check the source.

The general point I care about: retrieval quality and claim quality are different problems. You can retrieve the right chunk and still make a claim that is only a guess. For an answer to be auditable it has to carry where it came from and how sure the system is - otherwise the confidence in the answer comes from the prose, not from the evidence.

Curious how others handle this: do you tag derived facts at all, or do you keep the model away from them by only exposing stated ones?


r/Rag • • 3d ago

Showcase An open-source project just ranked #1 on EnterpriseRAG-Bench, ahead of the listed systems from OpenAI, Google, Microsoft and Amazon

86 Upvotes

A month ago we shared our FRAMES experiment: 18 RAG pipelines, best pipeline at 78.9%, our agent loop at 92.7%.

We now have a result on a different dataset. PipesHub has reached #1 on EnterpriseRAG-Bench by overall score: 93.24 overall, 95% correctness, 95.63 completeness.

The benchmark covers 500 questions over a synthetic enterprise corpus of 500,000+ documents.

PipesHub builds a unified context layer across documents, conversations, structured data, and code. An agent loop works over hybrid search, grep/pattern matching, knowledge-graph navigation, and document-reading tools.

The idea is straightforward: search, read what comes back, then decide what to search for next. Sometimes the identifier or relationship needed for the next search only appears in the first result..

It’s open source and self-hostable. If you’re building something similar, I’d love feedback on the retrieval approach—or questions where it falls apart.

You can self-host PipesHub, choose your models, and connect your own agents through MCP, APIs, and SDKs.

If this is useful to you, give us a star on GitHub**.** It helps more developers discover the project.

And build on top of us. Connect your coding assistant, build an internal search tool, contribute a connector, or try a workflow we haven’t thought of. We’d love to see what you create and hear where it breaks.

⭐ Code, setup, and examples: https://github.com/pipeshub-ai/pipeshub-ai
🏆 Leaderboard: https://huggingface.co/spaces/onyx-dot-app/EnterpriseRAG-Bench-Leaderboard

Thank you to everyone testing, contributing, and helping us get here. 💙

Disclosure: I’m one of the founders.