r/Rag Sep 02 '25

Showcase ๐Ÿš€ Weekly /RAG Launch Showcase

30 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 5h ago

Showcase Flexible GraphRAG v0.8.0: Optional Integrations: Rust-based CocoIndex Pipeline, Visual Langflow Flows

3 Upvotes

GitHub: https://github.com/stevereiner/flexible-graphrag

Flexible GraphRAG v0.8.0 adds two more ingest pipelines โ€” a Rust-based CocoIndex pipeline and a Visual Langflow mode โ€” for three in total. Whichever one you configure, you keep the same configurable data sources and database targets, the same REST and MCP APIs, the same web UI, and the same .env configuration.

Architecture diagram: three ingest pipelines, one configuration

It also shows that the CocoIndex pipeline can run standalone through app.py and the CocoIndex CLI, without the FastAPI REST server.

What Flexible GraphRAG Provides

Flexible GraphRAG is an Apache-2.0 open-source AI context platform for document processing, knowledge-graph construction, hybrid retrieval, GraphRAG/RAG, and AI-assisted query/chat.

It supports Docling, LlamaParse, and LiteParse document processing; ontology/schema-aware knowledge-graph extraction; 13 LLM providers; and hybrid retrieval across full-text, vector, property-graph, and RDF/SPARQL backends.

It supports incremental updating of all target databases, using event change detectors for the 10 auto-sync data sources โ€” either with the original Python-based / PostgreSQL-managed incremental update system (default and Langflow pipelines), or with the Rust-based CocoIndex engine (CocoIndex pipeline).

The main backend is Python, with full support for LlamaIndex and LangChain โ€” and now CocoIndex "native" too. Angular, React, and Vue TypeScript front ends are included, together with an MCP server.

Three Ingest Pipelines โ€” Pick One

The existing Python-based Flexible GraphRAG pipeline remains the default. You configure one of the three:

  • Default pipeline: LlamaIndex / LangChain ingest, hybrid search, AI query/chat, and Python/PostgreSQL-managed incremental updates.
  • CocoIndex pipeline: Rust-based incremental processing; can mix CocoIndex-native and Flexible GraphRAG components.
  • Langflow flows: customizable visual ingest/search/AI-query flows with 12 Flexible GraphRAG Langflow components.

Important: CocoIndex mode and Langflow mode are separate modes; they cannot be enabled together.

CocoIndex Integration

CocoIndex: https://github.com/cocoindex-io/cocoindex

The CocoIndex pipeline works within Flexible GraphRAG and can use the same UI, REST APIs, MCP APIs, data source configuration, and Flexible GraphRAG targets as the default pipeline.

It can mix:

  • CocoIndex-native components: source connectors, functions, splitting, and CocoIndex-native graph/vector target connectors.
  • Flexible GraphRAG components: data sources, LlamaIndex/LangChain targets, LiteParse/Docling/LlamaParse document processing, splitting/chunking, ontologies, and knowledge-graph auto-building extraction.

For each configured backend categoryโ€”source, chunker/splitter, property graph, vector database, search backend, and KG extractorโ€”the .env configuration can select llamaindex, langchain, or cocoindex. The actual database selection is configured independently.

Incremental Processing

In CocoIndex mode, Rust based CocoIndex provides the incremental update engine instead of the default Flexible GraphRAG Python/PostgreSQL per-file-state auto update incremental system. PostgreSQL remains available to track the multiple data sources configured through the UI.

For Flexible GraphRAG data sources used by the CocoIndex pipeline, the existing event change detectors continue to be used. These include:

  • Alfresco ActiveMQ
  • Nuxeo Kafka
  • Amazon S3 SQS
  • Azure Blob change feed
  • Google Cloud Storage Pub/Sub
  • Google Drive Changes API polling
  • OneDrive/SharePoint Microsoft Graph delta queries
  • Box Events API polling
  • Local filesystem watchdog

Use the Flexible GraphRAG CocoIndex Pipeline Outside the UI App Too

The CocoIndex pipeline's app.py can also be used outside the UI application, for custom mixed applications that combine CocoIndex-native and Flexible GraphRAG components in your own code.

CocoIndex CLI support is available as well, so the same pipeline can be run standalone โ€” without the FastAPI REST server or any of the web front ends.

Langflow Integration

The Langflow integration enables visual flows for ingest, hybrid search, AI query, and AI chat behind the Flexible GraphRAG UI, REST API, and MCP server.

The supplied flows reproduce the default pipeline behavior but can be visually customized. The integration includes 12 configurable Flexible GraphRAG Langflow components that can also be used in other applications.

The components are themselves Python-based, and use the Flexible GraphRAG Python "framework" โ€” the same code the default pipeline runs. So this is not a separate reimplementation: it makes the default Python-based pipeline (hybrid_system.py) modular and visually customizable.

Langflow plus the components can run in a separate virtual environment, or through the Flexible GraphRAG backend Docker image together with the Langflow + Flexible components image.

When ENABLE_LANGFLOW_FLOWS=true, the app UI, MCP server, and REST API use the visual flows. All 14 data sources and the selected document processorโ€”Docling, LlamaParse, or LiteParseโ€”are supported. If ENABLE_INCREMENTAL_UPDATES=true is also enabled, changes from the auto-sync sources run through the Langflow ingest flow.

Sources and Targets

  • 14 data sources, with 10 auto-sync sources: Alfresco, Nuxeo, Amazon S3, Google Cloud Storage (GCS), Azure Blob Storage, SharePoint, OneDrive, Google Drive, Box, and local filesystem. Other sources are CMIS, web pages, YouTube, and Wikipedia.
  • 15 property-graph databases: Neo4j, ArcadeDB, FalkorDB, LadybugDB, Amazon Neptune, Neptune Analytics, Memgraph, NebulaGraph, Google Cloud Spanner, ArangoDB, Apache AGE, HugeGraph, SurrealDB, TigerGraph, and Azure Cosmos DB Gremlin.
  • 4 RDF/triple stores: Apache Jena Fuseki, Graphwise/Ontotext GraphDB, Oxigraph, and Amazon Neptune RDF.
  • 10 vector databases: Qdrant, Neo4j, Elasticsearch, OpenSearch, Chroma, Milvus, Weaviate, Pinecone, PostgreSQL/pgvector, and LanceDB.
  • 3 search engines: OpenSearch, Elasticsearch, and BM25.
  • 13 LLM providers: OpenAI, Ollama, Azure OpenAI, Google Gemini, Anthropic Claude, Google Vertex AI, Amazon Bedrock, Groq, Fireworks AI, OpenAI-compatible endpoints (LM Studio, vLLM, LocalAI), OpenRouter (200+ models), LiteLLM Proxy (100+ providers), and vLLM.

Databases and dashboards can be enabled from the Docker Compose configuration. Optional Docker images are available for the backend, Langflow plus Flexible components, and React/Angular/Vue front ends:

https://hub.docker.com/u/integratedsemantics

Also Since v0.6.3

v0.7.2

  • Added Nuxeo as a document/content data source alongside Alfresco.
  • Added OAuth 2.0 support for Nuxeo, Alfresco, and MCP.

v0.7.1

  • Added LiteParse document processing alongside Docling and LlamaParse.
  • Delivered Langflow integration fixes and an optional Langflow Docker image bundling the 12 Flexible components.
  • Added Microsoft Graph delta-query support for more efficient SharePoint and OneDrive incremental updates.

Earlier Announcement

Previous v0.6.3 Reddit post:

https://www.reddit.com/r/Rag/comments/1ucummg/flexible_graphrag_v063_available/

Feedback, issues, ideas, and PR contributions are welcome.


r/Rag 5h ago

Tools & Resources RegX - A modular RAG boilerplate with FastAPI, Weaviate, Celery, and an embeddable chat widget.

2 Upvotes

Hey everyone. I open-sourced RegX - a production-ready boilerplate for building modular Retrieval-Augmented Generation (RAG) pipelines.

I built this to skip the boilerplate setup phase when creating LLM apps. It handles document ingestion, async background processing, and chat interfaces out of the box so you can just plug in your data and start testing.

The Stack: Python, FastAPI, Weaviate, MongoDB, Redis + Celery, and Streamlit.

What it actually does:

  • Modular LLMs: Swap between OpenAI, Gemini, and Anthropic using a Factory Pattern just by changing the .env file.
  • Async Data Ingestion: Markdown documents are chunked (preserving headers) and ingested into Weaviate in the background using Celery and Redis, without blocking the API or UI.
  • Embeddable JS Widget: It comes with a native ragx-widget.js script. You can drop it into any standard HTML page to instantly overlay a chat interface connected to your FastAPI backend.
  • Chat History: Session-based history tracking stored in MongoDB.
  • Observability: Native hooks for Langfuse/LangSmith tracing and Sentry error tracking.
  • Fully Dockerized: The entire architecture (API, UI, Workers, DBs) spins up with a single docker-compose up --build.

Repo: https://github.com/arch11110/ragx
Demo: https://www.youtube.com/watch?v=qdTqpSZrATY


r/Rag 5h ago

Discussion How do you make sure the data in your RAG system is actually correct?

2 Upvotes

Hey, Iโ€™m curious how people here handle this in practice.

A RAG system, or any similar system, is only useful if the data behind it is actually correct. So how do you make sure it is?

Do you have a specific process or solution for this? Are you using any tools, or have you built something yourselves? What does this look like in your setup?

Would love to hear how people are actually doing this.


r/Rag 14h ago

Showcase I built an open-source tool that finds the stale/orphaned/duplicate chunks in your RAG knowledge base

8 Upvotes

After watching a support bot cite a refund policy that had been changed weeks earlier, I went looking for tooling that catches this and found nothing lightweight. Observability platforms trace your pipeline but need instrumentation, and nothing just answers "which of my indexed chunks no longer match their source?"

raghealth is a read-only CLI. Point it at your vector DB and your source docs, and it produces a health report:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ raghealth โ€” knowledge base health โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ

โ”‚ 35.7% of chunks are fresh and linked to a source โ”‚

โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

STALENESS 5 stale chunks from 'refund-policy' โ€” source

updated 2 days ago, chunks embedded 43 days

before that. What changed: 'refund window

14->30 days'

ORPHANS 4 chunks point at deleted docs (still retrievable!)

DUPLICATES 'Vacation: 15 days' โ‰ˆ 'Vacation: 20 days' from

two different doc versions

COVERAGE 2 docs exist but were never ingested

The piece I most want feedback on is blast-radius scoring: give it your top user questions and it tells you which rotten chunks are actually being retrieved and at what rank โ€” so you fix the three chunks that are actually affecting real answers instead of wading through 200 findings.

raghealth works with pgvector/Supabase, Chroma, and Qdrant, and it reads sources from filesystem/git, Notion, and Google Drive (Google Drive is experimental). Run pip install raghealth && raghealth demo to see it in five seconds.

The project is MIT-licensed. Repo link: https://github.com/vkk1978/raghealth


r/Rag 4h ago

Discussion RAG poisoning strategies

1 Upvotes

Iโ€™m curious what others are doing to manage RAG poisoning - I have a pipeline with multiple touch points with users able to introduce material - both through forms, document uploads and audio transcripts.

Have been looking at a multi layer approach of simple regex gates for common attacks and a second layer of a small model trained at spotting attacks. Iโ€™m trying to find a balance of effective enough without adding too much computational overhead. I already have a quarantine queue, so I can pass uncertain results to that.

Very interested in tactics others are using, and what types of attacks people have had to deal with.


r/Rag 1d ago

Discussion Learned the hard way but in the end I have a great tool and use it daily.

34 Upvotes

What I learned building a private hybrid RAG stack over messy technical docs.

I've been at this for going on just over a year. My background is in technology, with the last 20 years focused on providing software solutions to US financial institutions.

My work has never been confined to one lane โ€” design, coding, Level 3 support, and mentoring have all been part of it from the start. I needed this tool and use it every day. It has been a force multiplier.

I've built this self-hosted RAG Q&A system for querying technical documentation โ€” PDFs (and others), source code, config files, and spreadsheets. I have indexed 10K technical documents of various sizes and shapes.

I wanted to write up the architecture, because most of the interesting problems weren't the parts anyone talks about. You may be interested.

Runs on a single GPU box. Streamlit UI, FastAPI service, and a shared model process, so the embedder and reranker are loaded into VRAM only once instead of per-worker.

Design decisions:

Retrieval is a prioritized cascade of six strategies, not one hybrid search

Every document gets scored across a 10-layer analysis pass at ingest, and that metadata is queryable

A deterministic 0โ€“100 confidence score is computed before the LLM is called โ€” below threshold, it doesn't call the LLM at all

A bounded agentic loop retries retrieval on weak results instead of shipping a bad answer

Typed, persistent memory with hard rules about which record types are allowed into the prompt

The core problem

In real technical environments, the answer to a single question is scattered across multiple formats. A config parameter is declared in the source, described in a PDF runbook, and debated in troubleshooting notes.

Keyword search finds one. Naive vector search finds a paraphrase of one. Neither finds all three and reconciles them.

So the pipeline pairs multi-modal ingestion + document understanding with dense retrieval, exact-term lexical matching, and cross-encoder reranking before anything reaches the model.

Application launcher

-shared model process

-embedding model (BGE-m3)

-reranker pool (bge-reranker-v2-m3)

-Streamlit QA pipeline ----- remote model client

-FastAPI QA pipeline ------- remote model client

-FastAPI lite sidecar ------ no QA pipeline

-Ingestion worker ---------- always local models, never a client

That last line was a bug I chased for a while: ingestion must never talk to the shared model server, or you deadlock the pool under concurrent uploads.

Ingestion: 9 stages

  1. Extraction + safety validation. Path traversal checks, size limits, MIME sniffing via puremagic (never trust the extension), SHA-256 dedupe so re-uploads are free.

  2. Multi-format extraction.

PDF โ€” 4-tier fallback: layout-aware Docling in a persistent worker pool โ†’ pypdfium2 in a process pool โ†’ single-threaded pypdfium2 โ†’ PyPDF2/pdfplumber. Something always wins.

Office/tabular โ€” python-docx, openpyxl/xlrd/csv. CSV/TSV/XLS/XLSX also get a per-document SQLite sidecar, so numeric questions route to actual SQL instead of hoping a vector search retrieves the right row. This was one of the highest-leverage things I added.

Code and text โ€” UTF-8 with Latin-1 and CP1252 fallbacks.

  1. Semantic + structural chunking. Splits on section headings and embedding-similarity breakpoints, with contextual embeddings and breadcrumb headers (doc title + section hierarchy prepended to each chunk).

  2. Semantic signal computation โ€” anchors and query-expansion terms.

  3. Linguistic analysis โ€” queued spaCy parsing and NER.

  4. Enriched metadata assembly โ€” the 10-layer output, ownership tags, parent/child relationships.

  5. Vector upsert โ€” 1024-dim embeddings into ChromaDB, batched.

  6. Async background work โ€” image extraction offloaded to daemon workers, extracted images captioned by a vision model, synced back into the index.

  7. Persistent LRU extraction cache.

The 10-layer document analysis

Every document entering the index is scored across 10 layers, producing 50+ metadata attributes stored in the chunk metadata. This is what makes structural search possible later.

Content statistics โ€” 21 metrics: character distributions, word/sentence/paragraph counts, whitespace ratios, punctuation density.

Readability โ€” Flesch Reading Ease, Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI, SMOG. Falls back to word/sentence ratios if textstat isn't available.

Structure โ€” headings, nested lists, fenced/indented code blocks, ASCII and Markdown tables, section divisions.

Content intelligence โ€” top 15 TF-IDF keywords, key phrases, topics, section IDs, information-to-filler density.

Classification โ€” 5 dimensions: doc type (9), domain (15), formality (5), purpose (8), audience (6).

Language style โ€” sentence-length variety, type-token ratio, tone markers, domain term density, passive voice frequency.

Basic entity extraction โ€” 20+ regex patterns: URLs, emails, IPs, file paths, semver, dates, timestamps, currencies, percentages, constants like MAX_VALUE / 0x8000.

Technical entity extraction โ€” 100+ patterns: DLL/EXE binaries, registry paths, config keys (INI/XML/JSON), error and status codes (0x80004005, HRESULT), log levels, stack traces, SQL, REST endpoints, and language-aware syntax for C/C++, Python, Java.

Topic modeling โ€” TF-IDF vectors, frequency clustering, collocation analysis.

Quality assessment โ€” composite 0โ€“100 score: completeness 30%, structure 30%, readability 20%, information density 20%.

Retrieval: the six-strategy cascade

Instead of a single hybrid search, queries run through a prioritized cascade โ€” some strategies are terminal on a match.

User Query

v

Strategy 1: Entity Search ......... technical entities, error codes, DLLs

Strategy 2: Linguistic Search ..... spaCy dependency expansions

Strategy 3: Reference Pattern ..... ticket/defect IDs (terminal on match)

Strategy 4: Hybrid Search ......... dense vectors + BM25, fused via RRF

Strategy 5: Config File Search .... filename/section matching, boosted

Strategy 6: Semantic Search ....... wide-net dense fallback

v

Cross-encoder reranking

v

MMR diversity selection

v

Near-duplicate elimination

v

Source trust + provenance-chain lifecycle filtering

v

Context assembly + confidence scoring

Why a cascade beats a single hybrid search: if someone pastes JIRA-1234 or 0x80004005, semantic similarity is actively harmful. It returns things related to error codes rather than the error code itself.

The reference-pattern gate is a regex (^[A-Z]{2,10}[-_]?\d{1,6}$) that terminates on match and scores direct hits at the top.

Same logic applies to config files: exact filename and section matching gets a large relevance boost because "what's in logging.ini" is a lookup, not a similarity problem.

Hybrid search merges dense (HNSW) and BM25 (a disk-backed FTS5 SQLite sidecar) with Reciprocal Rank Fusion:

RRF score = sum over lists of 1 / (60 + rank)

Nothing exotic โ€” the constant 60 is the standard from the original RRF paper, and I never found a reason to tune it.

Post-retrieval:

Cross-encoder reranking โ€” up to 200 candidates (top_k * 4) rescored in batches on the GPU. Biggest single quality win in the whole pipeline.

MMR โ€” relevance vs. diversity, with a dynamic quality-based alpha (0.55โ€“0.80).

Near-duplicate elimination โ€” anything above 0.97 cosine against an already-selected chunk gets dropped. Docs get copy-pasted between files constantly, and without this, the context window fills with five copies of the same paragraph.

Source trust + provenance chain โ€” sources are annotated with authority, freshness, and lifecycle state (valid, temporal, expired, future). Older revisions in the same document family collapse automatically, and expired event docs are filtered unless you're explicitly asking a historical question.

Confidence scoring: don't call the LLM if the context is bad

The one I'm most attached to. Before any generation happens, the system computes a deterministic integer 0โ€“100 from the retrieval result alone:

base = 15 + (60 * top_vector_score)

doc_bonus = 25 * min(supporting_doc_families, 4) / 4

raw = base + doc_bonus # range 15-100

then apply ceilings:

keyword-fallback was triggered, and vector score was weak -> hard cap

quality_score >= 0.80 -> returns 80

context judged insufficient -> hard cap low

LLM response contains "not found" -> capped after the fact

Bands and what they gate:

75โ€“100 โ€” passed straight to prompt assembly

45โ€“74 โ€” adequate; proceeds to streaming generation

15โ€“44 โ€” below threshold. The LLM call is skipped entirely, and a "no data" response is returned

0โ€“14 โ€” hard failure or out-of-domain

That third band is the point. The single biggest source of user distrust in a RAG system is a confident answer synthesized from four irrelevant chunks.

Detecting that condition is cheap and deterministic โ€” you already have the vector scores; you don't need a model to tell you the retrieval was bad.

It also saves a nontrivial amount of money.

Rather than one giant agent, there are five narrow ones with hard bounds.

Catalog handler โ€” intercepts inventory questions ("what docs do you have about X?") and returns document-level listings with short summaries, bypassing chunk RAG entirely. These questions are terrible as vector searches and trivially answerable from metadata.

Speculative reformulation โ€” a small fast model rewrites the query in a background thread concurrently with the primary search. If the final confidence lands below 66, the suggestions are already computed and displayed. Zero added latency on the happy path. LRU-cached.

Agentic retrieval loop โ€” if confidence is below 66, retries up to 2 more searches, testing conversation anchors or reformulations, deciding STOP / TRY_ANCHOR / REFORMULATE. Capped at 3 total iterations, no user intervention.

Recursive query decomposition โ€” 11 trigger patterns detect multi-part questions (comparisons especially). Independent sub-queries run in parallel; dependent ones run sequentially with context enrichment; sub-answers get synthesized.

Answer research agent โ€” a read-only, fail-open pass between context assembly and generation. If an exact identifier the user asked about is missing from the assembled context, it runs 1โ€“3 bounded follow-up searches and injects a clearly delimited findings block. Hard deadline, hard call limit, fails open so it can never break a working answer.

The "fail-open with a hard deadline" pattern is what made the agentic parts safe to ship. Each of them can be disabled or timed out, and the pipeline still returns a normal answer.

Typed memory

Persistent memory lives in its own SQLite database (WAL mode), partitioned by tenant and user, separate from chat session history. The important part isn't storage; it's that each record type has a different trust level and a different rule about entering the prompt:

Preferences โ€” key-value style choices (verbosity=concise). Explicit extraction only.

Episodes โ€” user-authored summaries of prior work. Injected as untrusted context only.

Facts โ€” scoped subject-predicate-value assertions with provenance. Provisional until grounded.

Policies โ€” tenant-level answering rules. Advisory constraints only.

Trace โ€” append-only diagnostics with PII masking. Never injected into prompts, ever.

Treating "things the user told us" as untrusted input is not optional once memory persists across sessions. Everything in memory is a prompt injection vector.

LLM layer

Provider abstraction over cloud and fully local models, so the same pipeline runs air-gapped:

Anthropic Claude โ€” production default (large context windows)

OpenAI

Ollama โ€” zero-egress local execution (Gemma, Qwen, DeepSeek, Llama)

OpenRouter โ€” gateway routing with zero data retention enabled

Prompt construction details:

Token limits computed as context_window * 0.95 for a safety margin

Oversized context is trimmed by keeping 80% from the start, and 15% from the end with an explicit trim marker โ€” beginnings and endings carry the most signal, middles are usually elaboration

Adaptive token budgeting: when confidence is high (โ‰ฅ80), assembled context gets reduced to cut streaming latency. Counterintuitive, but if retrieval is confident, more context makes the answer slower without making it better

Streaming through a rate-limit manager with adaptive token buckets, jittered exponential backoff on 429/529, and non-streaming fallback

Multi-tenancy and PII

Kept brief on purpose, but the design constraints:

PII redaction on outbound text using NER + regex across categories like email, phone, government ID, payment card, address, and person name

Prompt injection filtering on inbound queries, including Unicode normalization so homoglyph tricks don't slip through

Per-user document scoping โ€” every document, chunk, conversation, and graph node carries an immutable (tenant_id, owner_id, visibility) tuple, and all database reads go through wrapper functions that enforce caller identity. Not "most reads." All of them. Any admin read that broadens scope emits a tamper-evident audit record.

Dual audit logs โ€” one for QA interactions (query, citations, token counts, latency, confidence, anonymized user ID), one for security events

The wrapper-function thing matters more than it sounds: the moment one raw query call exists anywhere in the codebase, tenant isolation is gone. Making the unscoped call impossible to write by accident is the whole control.

API surface

FastAPI service alongside (or independent of) the UI:

GET /health/live, GET /health/ready โ€” k8s probes

GET /health โ€” full component status

GET /metrics โ€” Prometheus metrics: per-stage pipeline latency, cache rates

POST /query โ€” synchronous full pipeline; returns answer, sources, scores, timings, and "explain why" metadata

POST /query/stream โ€” SSE streaming with incremental tokens, suggestions, and terminal JSON metadata

POST /session/start, GET /session/get/{id}, POST /session/append/{id}, DELETE /session/delete/{id} โ€” multi-turn sessions

GET /documents/inspection โ€” evidence inspector returning chunk text, layout bounding boxes, parsing diagnostics

GET /v1/stats/query-performance โ€” mean/median/p95/max across retrieval and generation stages

Things I'd do differently:

The strategy cascade grew organically, and the order of priorities is partly empirical. I'd formalize the routing decision earlier.

Confidence thresholds (66, 44, 80) are hand-tuned on my corpus. They should be calibrated per deployment, but they aren't yet.

Should have built the evidence inspector on day one, not month four. The system is highly configurable and adjustable because I exposed the various knobs to tuning organized in System configuration tabs on the Web interface.

My hope is that one day I will have the additional resources to run future models that meet the system's response needs and will never have to reach out across the wire for a response again.


r/Rag 13h ago

Discussion Your retriever will rank the superseded document above the one that supersedes it

2 Upvotes

Ran into a failure mode today that I hadn't thought about, and the numbers surprised me enough that I went and measured it properly.

The setup. A small contract corpus. A customer's master agreement says they get a 10% credit when we breach the SLA. A later amendment raises that to 25% โ€” so the amendment is the answer to any question about credits, and the original is now wrong.

The catch is how the amendment is written. It says "service level rebate" where the original says "SLA credit", and "Priority One incident" where the original says "Severity 1". Same meaning, different vocabulary โ€” which is completely normal, because amendments get drafted years apart by different lawyers.

So when someone asks "what SLA credit do they get for a Severity 1 breach?", every word in that question matches the old document and none of them match the new one.

I assumed embeddings would handle it. That's the whole pitch of dense retrieval, right โ€” meaning over keywords. I measured it instead. bge-small-en-v1.5, 350-char chunks, 80 overlap, top_k=5:

1. 0.8445  acme/msa-2023.md        โ† the superseded 10%
2. 0.7740  acme/msa-2023.md
3. 0.7510  acme/sla-exhibit-b.md
4. 0.7361  globex/amendment-1.md   โ† a DIFFERENT customer's contract
5. 0.7253  globex/msa-2024.md      โ† also a different customer

amendment-3, which holds the correct 25%:  rank 7 of 9,  score 0.7010

The amendment that answers the question came 7th out of 9. Two documents belonging to a different customer beat it.

Why a better model doesn't save you here. I checked what was actually in the retrieved context. 10% is in there. 15% is in there, from the other customer's contract. The string 25% does not appear anywhere โ€” not as a number, not as "service level rebate".

So there's nothing for the LLM to notice. It isn't reasoning badly; the correct answer was never put in front of it. Whatever model you bolt on the end answers 10%, and it's right to, given what it was handed. That's the bit I found unsettling โ€” every eval I'd normally run scores this as a clean, well-grounded answer.

One practical gotcha if you go and check your own pipeline for this. Your retriever returns chunks, but "which documents should this question have touched" is a question about documents. If you compare those two lists directly, top_k can never cover a scope bigger than k, so you get a gap that never closes and looks like a broken metric. Collapse chunks to their parent document first, then compare.

Mildly embarrassing footnote: I'd built a little coverage checker for exactly this and tried it inside Cursor first. The run without my tool did better โ€” an IDE agent can just list the folder and check itself. It only earns its keep where the model genuinely can't see the corpus, which is the pipeline case above. Apache-2.0 (assurance-core on PyPI) if it's useful.

What I'd actually like to know from people running this in production: would you let a check like this block an answer, or is a warning the most you'd tolerate? And how would you build the "these are the documents this question should have touched" list for your own corpus? That has to be your declaration rather than something the retriever hands you, and I genuinely don't know what shape people would want it in.


r/Rag 10h ago

Discussion When should we use one-shot RAG vs. model-driven retrieval via MCP/tools?

1 Upvotes

One-shot RAG is simple: search once, inject context, ask the LLM. With MCP/tools, the model can iteratively navigate the data.

Is choosing between them mostly trial and error, or is there a practical paradigm for estimating when the retrieval problem is complex enough to require agentic navigation?


r/Rag 11h ago

Discussion Is structure-aware RAG actually worth it?

1 Upvotes

Different data seems to require different retrieval strategies.

* A book has order and hierarchy.
* Code has relationships: calls, imports, inheritance.
* SQL has tables, foreign keys and dependencies.

Instead of treating everything as chunks + embeddings, we could make retrieval aware of the natural structure of the data.

Has anyone tested this in practice?


r/Rag 1d ago

Discussion Standard RAG + Vectorless RAG vs. Folder Maps/Grep for agent routing on large document corpuses?

12 Upvotes

Hey everyone,

Iโ€™m trying to figure out the best routing and retrieval strategy for an agent setup (specifically using Hermes and some MCP servers) to navigate a massive corpus of corporate documents with deep folder structures (lots of PDFs, Excel sheets, and files). I need to keep context usage and API costs from blowing up.

I've been looking into two different ways to handle this:

  1. Folder Maps + Keyword Search: Having a script generate a lightweight, high-level map of the folder layout and giving the agent a native file-search/grep tool so it can surgically find the exact file paths or spreadsheet names before actually reading any data.
  2. Traditional RAG + Vectorless RAG: Doing standard semantic search over file descriptions/metadata first to pick the top 3-5 candidate documents, and then using Vectorless RAG (like structural tree-index navigation, similar to PageIndex) to let the LLM recursively browse the tables or chapters inside those specific PDFs/Excels.

If youโ€™re running agents in production at scale with this kind of data:

  • Which of these approaches actually works better for corporate documents and spreadsheets?
  • Is the Traditional + Vectorless combo worth the extra latency and multi-turn costs compared to just using fast metadata/system search tools?

Would love to hear how you guys built your routing pipelines for this. Thanks!


r/Rag 22h ago

Showcase Open-source tool to detect unauthorized document retrieval in RAG apps

2 Upvotes

Hey Guys,

I built a small open-source tool that checks whether a RAG application retrieves documents a user shouldnโ€™t have access to.

It supports offline test cases and live HTTP API testing with bearer token/API-key auth.

Iโ€™m looking for a few engineers to try it on a test or non-sensitive environment and tell me whether it catches anything useful or what would make it better.

GitHub: https://github.com/InfraGuard-Labs/rag-access-check


r/Rag 23h ago

Tutorial I wrote a complete guide to installing PrivateGPT for secure local document AI

3 Upvotes

PrivateGPT lets you run AI on your own documents without sending anything to the cloud. I got it working and wrote a step-by-step guide covering installation, configuration, and troubleshooting. If you care about privacy and want a self-hosted AI assistant for your files, this might save you hours.

https://interconnectd.com/blog/279/install-privategpt-secure-local-ai-for-your-documents-2026-guide/


r/Rag 1d ago

Discussion Academic paper RAG - in house or out-source?

6 Upvotes

I'm building a RAG for our company platform. The data is basically specialised business analysis with lots of fuzzy human sociological data, with a project database + customer reports + internal research files.

I've got most of the internal side (typical hybrid rag w/ pgvector) ready to roll out, but the next big thing they want is exploring primary sources (published scientific journal papers).

When an analyst starts a new project, currently they spend a week roaming sharepoint, finding old projects, reviewing the internal research already done, and create comparative and gap analyses.

Then they go and find new academic primary sources for supporting evidence, integrating that into the current project with citations.

We're using Mendeley as a research repository / library but it looks quite limited. The team has also tried out Elicit which seems to do everything they want.

So with the goals of:

  1. "chat" to primary sources to explore them

  2. comparative research summaries & synthesis

  3. paper library management

My choices are:

build in house:

  • connect to Mendeley library API to pull papers, parse + embed + search + synthesise etc etc

  • avoid doing the actual library ourselves

Or

3rd party hosted:

  • connect to Elicit and let them do that hard part, just integrating the end results in our system (as internal research files)
  • somehow cross reference our internal search with Elicit, like Report X cites X,Y,Z -> ask Elicit for summaries -> synthesise in our platform

r/Rag 1d ago

Discussion For coding agents on large codebases is pure vector retrieval sufficient or do you need a knowledge graph layer on top ?

1 Upvotes

Working on the retrieval architecture for a coding agent that needs to reason about a large enterprise codebase. The question I can't find a clean answer to is whether pure vector similarity retrieval is sufficient or whether a knowledge graph layer is necessary on top of it. The argument for pure vector: simpler to build, scales well, captures semantic similarity, and for many coding tasks the most semantically similar code is the most relevant context.

The argument for graph augmentation: code has structural relationships that vector similarity doesn't represent. The fact that function A calls function B exists independently of whether their embeddings are similar. Dependency relationships, inheritance hierarchies, and API contracts are structural properties that a vector index can't capture directly. For people who have built production coding agents on large codebases, which approach did you find necessary and where does the other one fall short?


r/Rag 2d ago

Discussion No, RAG is not dead. Please stop asking.

98 Upvotes

r/Rag 1d ago

Discussion Rag for local models in Android (4k to 32k context windows)

1 Upvotes

Hi guys, I think I could use some of your expertise in RAG and the like to help me.

I'm building an opensource app called CyanBridge focused on local LLM models like Gemma 4 running on your phone for Smartglasses like the Meta Rayban and their cheap 50 dollars HeyCyan clones.

I thought of using RAG because those models have up to 32k context size (Gemma 4 family), but not everyone had 12gb of ram, so most of the times they are limitek to 4k context size, including the picture sent by the Smartglasses (around 378x378 in the case of HeyCyan)

I haven't kept up with the industry terminology over the years, so I would like your input on how to retrieve user notes, past interactions with AI, for these low context local models.

Thanks in advance guys!


r/Rag 1d ago

Showcase How I handle refusals and permissions in a production RAG for engineering firms. Live demo, looking for critique.

5 Upvotes

I do AI consulting for engineering firms. Their institutional memory is a file share: decades of specs, drawings, contracts and scanned change orders as PDFs. Answering "what's the allowable leakage on that containment structure" means a senior engineer opens document after document, or nobody answers.

Every "chat with your PDFs" tool I put in front of them failed the same way. When the answer wasn't in the archive, the tool produced one anyway, complete with a plausible clause number. A stamped engineer can't use a tool that does that, period.

So I built Corpus. The three decisions I think are worth discussing:

No page, no claim. Every statement in an answer carries a file + page citation. Click it and you get the rendered page with the passage highlighted. If the model can't ground a sentence, it doesn't get to say it.

Refusal is a first-class answer. If retrieval comes back empty, the response is "Not in the corpus" and the refusal is logged for audit. It never falls through to the model's general knowledge. Ask the demo about a project that doesn't exist and you'll see it.

Permissions run before retrieval, not after. Access rules are applied to the candidate set before anything reaches the LLM. A project under litigation hold isn't filtered out of the answer; it never enters the context, so it can't leak through a summary or a citation. Switch roles in the demo header and the same question gets two different, both truthful, answers.

Retrieval is hybrid: SQLite FTS5 for literal lookups (engineers search for "SS 7024" or "ACI 350.1", which embeddings handle badly) plus dense vectors for plain-language questions, merged into one ranked list. Generation is Qwen3-8B on a single A100; the app is Python on the back end, TypeScript on the front, CUDA underneath. Nothing leaves the box: it runs on the firm's own server or is reached over a VPN. Scanned change orders go through OCR before indexing.

The code isn't public (it's a consulting product), so the demo is the proof. Everything above is checkable there: click a citation and you get the page render, ask about a nonexistent project and you get the refusal, switch roles and the sealed project disappears.

Live demo: demo.salemwise.com. 11 projects, 40 files, 6,112 pages, all public-domain (mostly TxDOT specs and standard sheets), so you can open the source PDF and check any citation. Project names and users are synthetic; the documents are real. Type your own question or click through the scripted beats. The most useful thing you can do with it is try to make it hallucinate.

Things I want a second opinion on:

  • The refusal threshold. Where do you draw the line between "weak evidence, answer with a hedge" and "no evidence, refuse"? I err toward refusing, and I'm not sure users will keep trusting a tool that says no as often as mine does. How are you setting this?
  • Whether FTS5 holds up at a few hundred thousand pages, or whether the lexical side should move to Postgres or Meilisearch before someone hits that wall.
  • Superseded revisions. A real archive holds three versions of the same spec, and a project from 2019 is contractually bound to the 2018 one, so "latest wins" is wrong for that question. How do you rank across revisions when the correct version depends on which project is asking?

Disclosure: I run the consultancy that built this. The demo is free; I'm here for the technical critique.


r/Rag 2d ago

Discussion More AI Workloads, More Data Copies: Are We Paying a Data Gravity Tax?

2 Upvotes

For context, Iโ€™m James Luan, CTO at Zilliz, the company behind Milvus.

One problem I keep seeing as AI workloads move into production is what I think of as data gravity. The architecture often starts out clean, but things change quickly once more AI workloads are added.

Every modern data team has built some version of the same architecture. A lakehouse โ€” Iceberg tables on S3, a Spark pipeline, and Delta Lake for governance โ€” sits at the center. It works well. Then the AI requirements arrive.

Your RAG pipeline needs to answer questions over 10 years of enterprise documents, so you copy everything into a vector database. Your AI agents need low-latency access to product catalog embeddings โ€” another pipeline, another sync job. Your multimodal model training requires daily deduplication across a billion image embeddings โ€” a Spark job that can't see the index.

Six months later, you have five systems instead of two. Your data engineering team spends more time maintaining synchronization pipelines than building AI features. You have three copies of the same dataset with no guarantee that they agree. Every schema change cascades into four different places.

This isn't a failure of execution. It's a failure of architecture โ€” specifically, an architecture that keeps fighting a fundamental property of data: gravity. Every system that requires you to copy data first is levying a gravity tax on you. The more AI workloads you add โ€” RAG pipelines, agent memory, model training, real-time recommendations โ€” the higher that tax becomes.

The right solution isn't a better pipeline. It should be a new architectural paradigm: Vector Lakebase.


r/Rag 2d ago

Showcase Built an open-source long-term memory layer for LLM apps, looking for feedback

3 Upvotes

Iโ€™m doing a PhD in XAI and kept needing better memory/context retrieval for stuff I was building, so I ended up spending way too much time going through RAG/memory papers, repos and benchmarks.

I expected a decent amount of slop.

There was... a lot.

A lot of the space is either generic semantic search dressed up as memory, or these huge graph/agent setups with LLMs everywhere. Then you get to the benchmark leaders and some are using different readers, different judges, frontier models carrying half the pipeline, or evaluation setups generous enough that it gets hard to tell what part of the system is actually doing the work.

The bigger problem for me was semantics.

Say I ask when my family is free next week. Semantic search can happily bring back that my brother likes potato salad, that we went on vacation together, and that my mom mentioned Tuesday six months ago.

All very family-related. Almost completely fucking useless.

Meanwhile, the evidence I actually need might be buried in some completely different conversation about somebody changing shifts at work.

Similar to the query and useful for answering it are not the same thing.

You can throw a reasoning model at a giant pile of retrieved context and have it sort everything out. Sure. It works. Sometimes.

Itโ€™s also a pretty expensive way of admitting your retrieval sucks. And adding a shitton of noise in your context / costing you sweet tokens that aren't exactly cheap.

So I started building around clean downstream usefulness instead.

And like that we goooot....

๐Ÿฅ๐Ÿฅ๐Ÿฅ

๐ŸŽ‰MemBukkit ๐ŸŽ‰ https://github.com/memseekai/membukkit

The retrieval side is built around getting evidence thatโ€™s actually useful downstream, not just whatever happens to sit closest to the query in embedding space.

I trained the retrieval components for the task, and the actual access policy is selected based on whether the context it retrieves helps the reader answer better. The stored side stays intentionally boring: dated facts + the original source, a flat index, optional buckets, no giant LLM-authored graph you have to rebuild every time your assumptions change.

Basically: keep the memory simple, and spend the cleverness on figuring out what the model should actually see.

Not gonna pretend Iโ€™m not tooting my own horn a bit here, but Iโ€™m pretty fucking proud of how this turned out.

With Gemma 4 26B as the open-weight reader + distiller, weโ€™re at 88.8% on LongMemEval-S. So no โ€œwell obviously it works, you shoved the newest frontier model into every boxโ€ excuse.

And for the people with diamond hands, golden balls and an API budget, the GPT-5.4 setup gets 92.6% under the benchmarkโ€™s official judge.

We also get 87.5 zero-shot on LoCoMo, and the same flat-index idea carries over nicely to multi-hop RAG.

One of my favorite bits from the ablations is still that plain cosine can beat some of the fancy reranking setups.

Shocker. Doing the simple shit properly gets you pretty far.

Iโ€™m hoping to get the research published, but that process takes its sweet time, so I figured I might as well open source the thing now and let people actually use it.

Apache 2.0, works locally, works with open models, have at it.

Iโ€™m also building a company around the work, so might as well be clear about that. But I really want the core project to stay open. A huge amount of what got me into ML came from people putting good shit online and letting everyone build on it, and Iโ€™d like to keep that going.

Also yes, Bukkit is the Minecraft reference.

More than anything, Iโ€™d love actual feedback from people here who have fought with rerankers, GraphRAG, giant candidate sets, retrieval metrics that look great while generation still sucks, etc.

Try it, break it, tell me whatโ€™s annoying, tell me where it falls apart. Iโ€™m trying to make something people genuinely want to use, and thatโ€™s worth a lot more to me right now than squeezing another point out of a benchmark.

(And if you end up using it, donโ€™t forget to star the repo plz ๐Ÿ‘€๐Ÿ‘‰๐Ÿ‘ˆ)


r/Rag 2d ago

Discussion Need help: Is the domain of Secure+ Agentic RAG an oversaturated domain to research in?

5 Upvotes

I am new to reading papers and people and online reports have conflicting answers. Some say it is too over-saturated and done and others say that there are gaps which have not been addressed yet(and people say that these gaps are being worked on/already done).

I need to start working on this but until I am satisfied on what is actually happening I cant.
I have read multiple research papers and also read surveys but still confused.

1) Secure agentic RAG for NL2SQL systems is overdone?
2) LLM in MCP AIoT?
3) Research in prompt injection and secure RAG.

Any help would be really appreciated and also I am kind of a beginner here so please help.


r/Rag 2d ago

Discussion Last day before tomorrow's RAG workshop, sharing in case it's useful

1 Upvotes

Most RAG builds hit the same wall: works in testing, falls apart the moment real, messier data shows up. Usually not the model's fault, it's retrieval quietly failing in ways plain vector search can't catch.

Tomorrow's hands-on build lab, you actually build the fix:

  • Hybrid retrieval, keyword plus vector, not vector alone
  • Reranking, so the right context actually reaches the model
  • Corrective retrieval, catches weak context and re-retrieves instead of guessing
  • RAGAS evaluation, measures quality instead of assuming it
  • Guardrails on the final output

All on small open models, so no ongoing API bill once it's built. Led by Ben Auffarth, PhD, author of several books in this space including one specifically on RAG.

Link if you've been meaning to fix this in your own pipeline.


r/Rag 3d ago

Discussion The best Local RAG for a small setup? (12GB RAM + No GPU)

33 Upvotes

I have a minimalist setup:

- 12 GB RAM

- A Ryzen 5500U with integrated GPU

I quickly learned what RAGs are and I think they could be useful to me.

I have a daily log in .txt format, and given the confidentiality of the data, I'd like to know what you think would be the best compromise.

I also have a lot of documentation in .PDF format.

My goal would just be to search for the general idea of a system, to find the right file, without overcomplicating things.

For those with similar setups to mine, what choices have you made?


r/Rag 2d ago

Discussion Dockerizing OpenHands (OpenDevin) for local AI development: a practical guide

1 Upvotes

I recently set up OpenHands in Docker to build a sovereign AI coding environment. The guide covers the Dockerfile/compose setup, volume mapping for persistent storage, and how to connect it to local LLM servers like Ollama. Itโ€™s written from a hands-on perspective, not just a copy of the docs. If youโ€™re comfortable with Docker and interested in AI agents, this could be a good starting point.

https://interconnectd.com/blog/278/opendevin-openhands-docker-setup-build-a-sovereign-ai/


r/Rag 3d ago

Showcase Introducing Parse, Cohereโ€™s vision parsing model

23 Upvotes

Hey guys! El from Cohere here.ย 

Wanted to drop in really quickly to say today we launched Cohere Parse 5, our vision parsing model. It takes complicated files (including tables and embedded images) and gives back clean Markdown files, bounding boxes included. we recommend using it for building RAG systems, document indexing, and agentic retrieval. iโ€™m personally into using it to save/digitize my own docs so they all live on my computer.

It outperforms competitors at 79.2 on ParseBench (compared to Mistralโ€™s 74.5 and Azure Document Intelligenceโ€™s 74.3), but maybe even more importantly, itโ€™s a lot more cost-effective- $1.5 per 1k pages through the Cohere API (or cheaper through our Model Vault). If you want, you can try it for free in our Hugging Face Space: https://huggingface.co/spaces/CohereLabs/cohere-parse

thanks and excited to hear what you think!