AI analytics with RAG
Source-grounded analytics that cite every number and refuse when data is partial.
Standard retrieval-augmented generation fails analytical and regulatory work in two opposite ways: either it blends unverified text chunks into fabricated statistics, or it runs ad-hoc SQL over messy raw files that leak sensitive records. MSV separates precomputed, test-verified DuckDB marts from citation-locked retrieval so every indicator links back to its exact table and refuses to answer when coverage is incomplete.
What is source-grounded AI analytics with RAG?
Source-grounded AI analytics with RAG combines precomputed, test-verified analytical warehouses (such as DuckDB and layered dbt marts) with retrieval restricted to pinned reference tables and approved documents. Every numerical claim cites its exact dataset version, and missing or partial cohort coverage triggers an explicit refusal rather than model estimation.
- 01Source
- 02Index / Rules
- 03Prompt / Proposal
- 04Log
- 05Retention
- 06Human Review
Pinned Official & Internal Sources
Ingest official statistical feeds (Eurostat LFS, JVS, SES; national GTFS feeds; census small-area boundaries; deprivation indices) alongside local client tables (such as payroll or approved clinic/policy manuals) without uploading raw internal rows to shared external SQL servers.
Layered Index, dbt Rules & Quality Gates
Transform raw sources through explicit staging and mart layers (for instance, WorkforceGuard AI's 16 staging and 19 mart dbt models validated by 71 data tests, or Aequitas's 103 per-country quality checks). Index approved policy clauses in pgvector HNSW or structured lookup tables with version metadata.
Constrained Prompt & Citation Retrieval
When an analyst asks a question, the retrieval layer fetches precomputed indicators and pinned source definitions only. The model cannot invent SQL joins on the fly or extrapolate missing cohorts; if coverage falls below threshold, it outputs an explicit coverage refusal.
SHA-256 Hash-Chained Query & Verification Log
Every API lookup and retrieval response verifies and appends to an immutable SHA-256 hash-chained governance log recording dataset version, query parameters, cited source IDs, and refusal flags.
Zero-Leakage Retention Boundary
Internal analytical rows stay inside embedded DuckDB warehouses or customer-controlled environments; external inference calls see aggregated indicators or de-identified snippets only, never raw employee compensation or patient records.
Human Analyst Review & Publication Sign-Off
Policy analysts, reward leads, or planners inspect the cited tables, harmonisation notes, and statistical caveats before exporting a regulator-facing position or public briefing.
Why Precomputed Marts Outperform Text-Only RAG
Text-chunk vector search alone cannot answer quantitative compliance questions reliably. Asking a generic PDF chatbot to calculate a sector gender pay gap or a 400 m public-transport stop catchment invites silent unit mismatches, hallucinated denominators, and missing-data imputation. By performing all mathematical joins inside deterministic Python and dbt pipelines first, and restricting RAG to citing those verified outputs alongside pinned statutory definitions, MSV gives human reviewers numbers they can rerun line by line.

How does MSV eliminate RAG hallucination and silent imputation?
MSV prevents RAG hallucination and silent imputation through four technical controls: precomputing metrics in tested dbt and NumPy pipelines, blocking answers on partial cohort coverage, enforcing single-country index boundaries, and requiring every statement to resolve to a versioned source record.
| Failure Mode in Generic RAG | Operational & Legal Risk | MSV State-Verification Control | Live Evidence in MSV Systems |
|---|---|---|---|
| Confident answers on partial cohort coverage | Fabricated or imputed pay-gap numbers submitted to regulators or works councils | Refuse, do not guess: return explicit partial-coverage refusal when cell counts or fields are missing | WorkforceGuard AI declines to answer confidently on partial coverage; Moveq never imputes demographic gaps |
| Cross-country metric conflation | Misleading rankings comparing incompatible national deprivation indices | Isolate national warehouses and document every metric harmonisation (same, replace, omit) | Aequitas England (80.0), Ireland (55.5), Netherlands (69.6), France (47.7) never share an axis |
| Raw payroll or PII sent to hosted SQL/LLM clouds | GDPR minimisation breach and works-council objection | Run embedded DuckDB locally with zero external database server and zero raw payroll sharing | WorkforceGuard AI embedded DuckDB warehouse; "Your payroll never shared" |
| Text-to-SQL hallucinating table joins | Silent double-counting or wrong NACE/census aggregations in executive briefings | Restrict analyst retrieval to precomputed, test-verified dbt marts and read-only FastAPI lookups | WorkforceGuard AI 35 dbt models, 71 tests; Aequitas per-country quality checks |
| Uncited or non-reproducible briefing figures | Analysts cannot reconstruct which feed date produced a published chart | Attach dataset IDs, timetable/census dates, and SHA-256 governance log verification to every call | WorkforceGuard AI SHA-256 log verified per API call; Evgraph links sources with certainty levels |
| Multilingual retrieval and generation drift | Non-English queries degrade silently under aggressive model compression | Audit token premium and language accuracy loss before selecting compressed inference models | WhoPays 858 GPU runs across 11 languages showing Spearman rho 0.51 to 0.94 disparity |
Statistical Honesty as a Product Invariant
Analytical credibility also depends on distinguishing correlation from causation. In MSV's working paper MPRA 129330 (11-sector Eurostat analysis, 2019 to 2024), the cross-sectional correlation between employment rates and gender pay gaps is r = +0.41 (p = 0.07). Both the paper and MSV's analytical software treat the estimate as indicative. The paper constructs the Hiring Pressure Index (HPI) and Equity Risk Score (ERS) using Eurostat data.
How does MSV build a source-grounded RAG analytics pipeline in four stages?
MSV builds source-grounded analytics in four structured stages: source audit and cohort threshold definition, layered DuckDB or PostgreSQL warehouse construction with automated dbt and Python quality tests, citation-locked retrieval and refusal-gate integration, and SHA-256 query logging with reproducible pipeline code handover.
- Source Audit & Threshold Scoping
- Embedded Warehouse & Automated Data Tests
- Citation-Locked Retrieval & Refusal Gates
- Hash-Chained Query Logging & Analyst Handover
Source Audit & Threshold ScopingStage 1, Week 1
Inventory internal tables, official statistical series (Eurostat, GTFS, national census), or approved policy documents. Define minimum cohort thresholds, harmonisation rules, and explicit non-comparability constraints.
Embedded Warehouse & Automated Data TestsStage 2, Weeks 2–3
Construct local DuckDB warehouses, layered dbt staging/mart transformations, or pure-NumPy inequality pipelines. Write automated schema, freshness, null, and boundary tests (following the 71-test WorkforceGuard and 103-check Aequitas patterns) so bad inputs fail before indexing.
Citation-Locked Retrieval & Refusal GatesStage 3, Weeks 4–5
Bind retrieval strictly to verified marts and versioned policy vectors (such as pgvector HNSW with Apache Tika extraction). Implement hard refusal paths when coverage is incomplete, confidence thresholds fail, or queries step outside approved cohorts.
Hash-Chained Query Logging & Analyst HandoverStage 4, Week 6
Verify SHA-256 governance logs across every API call, test multilingual retrieval quality where non-English corpora apply, and deliver reproducible SQL/dbt/Python code alongside a written methodology and limitation annex.
Which MSV systems, open-source tools, and technology stacks prove this capability?
Three shipped MSV systems and open-source tools demonstrate this architecture across production and research environments: WorkforceGuard AI for EU Pay Transparency benchmarking, Aequitas and Moveq for national transport equity warehouses, and Devernance's Apache Tika and pgvector pinned legal-corpus retrieval engine.
WorkforceGuard AI
Joins pseudonymised pay extracts at the internal mart level with 22 Eurostat datasets (LFS, JVS, SES) across 27 EU member states and 13 NACE sectors inside an embedded DuckDB warehouse (no hosted SQL server at query time). Runs 35 dbt models (16 staging, 19 marts) and 71 data tests, verifies a SHA-256 hash-chained governance log on every API call, and declines to report a result when coverage is partial.
WorkforceGuard AIWorked Proof // WorkforceGuard Pay Position
Aequitas & Moveq (moveq-cli 0.2.0)
Aequitas runs per-country Python pipelines and DuckDB warehouses across England, Ireland, the Netherlands, and France. The August and September 2026 country packs report 400 m coverage of 79.27% in England, 55.05% in Ireland, 88.27% in the Netherlands, and 56.3% in France. Each country uses its own deprivation index. Moveq (4 PyPI packages, pure NumPy, 0 required GIS dependencies) computes Gini, Palma, and Wagstaff indices and logs every cross-country harmonisation choice explicitly.
Devernance & MaSoVa Enterprise Fleet
Devernance uses Apache Tika 4.0.0, PostgreSQL, pgvector HNSW, DJL, and ONNX Runtime to retrieve against a pinned legal corpus, while Enterprise Fleet grounds manager queries over an operations manual via RAG before routing tasks to specialists.
Stack compatibility
MSV analytics pipelines run natively in Python 3, DuckDB, dbt Core, PostgreSQL (with pgvector HNSW), Apache Tika, FastAPI, NumPy, optional pandas, React/TypeScript, MapLibre GL, and GCP Cloud Run or on-premise containers. Because DuckDB embeds directly inside the application runtime, teams avoid provisioning external analytical database clusters for confidential datasets.
How does MSV scope and price a bounded RAG analytics pilot?
A bounded 4 to 6 week RAG analytics pilot covers one internal or public dataset pair, one set of approved reference documents, automated dbt or Python quality tests, and an explicit partial-coverage refusal boundary, priced transparently by sensitivity, language, and site scope.
Pilots and production run in your own AWS, Azure, or Google Cloud account, in a region you choose. You hold the account, data, and keys.
- Duration & Focus
- 4 to 6 weeks focused on one analytical question (such as a single-country Pay Transparency benchmark, one regional GTFS equity audit, or one cited policy-retrieval assistant).
- Data Limits
- Pseudonymised pay extracts or confidential records remain in client-controlled DuckDB or PostgreSQL storage under our GDPR Article 28 DPA (/trust/dpa/), with zero model training on client inputs.
- Exit Criteria
- Reproducible dbt/Python transformation code, passing data quality test suite, citation-enabled API or UI surface, SHA-256 query log verification, and a written statistical limitation statement.
Pricing drivers
We do not publish fees. A pilot is quoted in writing in USD, EUR, or GBP before work starts. You owe nothing until you accept that quote.
Pilot fees scale with five verifiable drivers:
- Data sensitivity and deployment topology: embedded DuckDB or isolated database service in the client’s account.
- Dataset and source count: number of internal schemas, Eurostat/GTFS feeds, or legal/policy documents indexed.
- Language coverage: single-language retrieval versus multi-language evaluation informed by WhoPays disparity checks.
- Public-authority status: whether Directive 2014/24/EU lot rules and EU MCC-AI documentation apply.
- Assessment-only versus full pipeline: audit of an existing RAG failure rate versus building a verified mart and retrieval layer.
Common engineering questions on source-grounded RAG
What happens when a user asks about a cohort or region with missing data?
The system refuses to answer confidently rather than inventing or imputing values. Following WorkforceGuard AI and Moveq design rules, partial cohort coverage triggers an explicit gap notice naming the missing dimension so analysts never present guessed statistics as verified facts.
Why use embedded DuckDB instead of a hosted multi-tenant analytical warehouse?
Embedded DuckDB runs inside the application process with no separate database server at query time. For sensitive inputs like employee payroll, this architecture simplifies GDPR data minimisation, avoids cross-tenant SQL exposure, and allows full pipeline execution inside a controlled client environment.
How do you prove which source produced a number in an executive briefing?
Every precomputed metric carries its source dataset identifier, dbt model version, and timestamp through read-only API endpoints into the briefing UI. Each API call verifies and records an entry in a SHA-256 hash-chained governance log that auditors can inspect later.
Does MSV support non-English European RAG queries?
Yes, with explicit multilingual verification. MSV's preregistered WhoPays study across 11 languages demonstrates how aggressive model compression degrades non-English accuracy disproportionately, so multilingual RAG pilots evaluate retrieval and generation quality per supported language rather than relying on English-only aggregate accuracy scores.
Bring us an analytical question you need to defend.
Share the source datasets, policy documents, and refusal rules your analysts require. We aim to reply to enquiries within 2 business days, Monday to Friday, India time.