Skip to content

About

A semi-automated reference data and standardization service for global projects. This service handles common reference dimensions (marital status, education, nationality, etc.) by semantically matching new raw values, routing them to reviewers for approval, and adding them to a central mapping

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

🌐 RefData Hub

Enterprise Reference Data Management (RDM) & Data Harmonization Platform

Automate, harmonize, and standardize reference data dimensions across global enterprise systems with AI-assisted semantic matching and intuitive human-in-the-loop curation workflows.

Documentation License: MIT Python 3.10+ React 18 FastAPI


AI Semantic Matching & Playground
1. AI Semantic Matching & Playground
Canonical Reference Library
2. Canonical Reference Library
Source System Connections & Profiling
3. Source System Connections & Profiling
Match Insights & Human Curation
4. Match Insights & Curation Workflow
Multi-Tiled Interactive Demo: Harmonizing unstandardized reference data across 4 core enterprise platform use cases.

πŸ“Œ Overview

RefData Hub is an open-source Reference Data Management (RDM) and Data Harmonization platform designed to solve reference data fragmentation across modern enterprise architectures.

In inconsistent multi-system environments, raw reference valuesβ€”such as country codes, employment statuses, education levels, or marital statusesβ€”vary widely between source databases, analytics pipelines, and third-party APIs. RefData Hub establishes a single source of truth by:

  1. Ingesting & Profiling raw source data from upstream databases.
  2. Semantically Matching disparate raw values to canonical dimensions using AI embedding vectors or LLM-powered re-ranking.
  3. Empowering Reviewers with a modern human-in-the-loop dashboard to inspect, approve, or refine suggestions.
  4. Publishing Canonical Mappings to downstream data warehouses, business intelligence tools, and microservices.

✨ Key Features

  • 🧠 AI-Assisted Semantic Matching: Harmonize messy reference data automatically using local sentence-transformer embeddings (fastembed), or configurable LLM providers (OpenAI API or local offline Ollama models) β€” including optional LLM escalation that re-ranks near-tied embedding results.
  • πŸ›‘οΈ Human-in-the-Loop Curation: A streamlined dashboard for data stewards and reviewers to inspect confidence scores, approve auto-suggestions, or manually map complex edge cases.
  • πŸ”— Source System Connectors: Connect directly to upstream databases β€” PostgreSQL, MySQL, ClickHouse, Snowflake, SQL Server, Oracle, MongoDB, SQLite, DuckDB, or a generic SQL driver β€” inspect live schemas, and sample unstandardized values in real time.
  • πŸ“ Canonical Library & Custom Schemas: Define flexible reference dimensions with custom JSON metadata schemas (e.g., ISO codes, regional attributes, sorting priority).
  • πŸ“Š Match Insights & Coverage Analytics: Track overall harmonization health, percentage of standardized values, and unmapped raw value frequencies across source systems.
  • 🌳 Dimension Hierarchies & Relations: Model multi-level parent/child relationships (e.g., Country β†’ State β†’ District).
  • πŸ“ Bulk Import & Export: Effortlessly import/export canonical values and field mappings via CSV, TSV, or Excel formats.
  • 🎨 12-Palette Themeable UI: Built with React 18, Vite, and Tailwind CSS, with twelve palettes plus a System option that follows your OS. The selection persists in localStorage and is shared with the documentation site, so both stay on the same theme.

πŸ—οΈ Architecture & Data Flow

RefData Hub acts as an intelligent middleware layer between operational source systems and downstream reporting/data warehouses:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Source Systems β”‚       β”‚                      RefData Hub                       β”‚       β”‚ Downstream Consumersβ”‚
β”‚  (DBs, APIs,    β”‚ ────> β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚ ────> β”‚ (Data Warehouses,   β”‚
β”‚   Legacy Data)  β”‚       β”‚  β”‚ Schema &     β”‚   β”‚ AI Semantic   β”‚   β”‚ Reviewer  β”‚  β”‚       β”‚  BI & Analytics,    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚  β”‚ Connectors   β”‚ ─>β”‚ Match Engine  β”‚ ─>β”‚ Dashboard β”‚  β”‚       β”‚  Microservices)     β”‚
                          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Extraction & Sampling: Source connectors pull distinct raw values and record counts.
  2. Semantic Vector Matching: Matcher scores candidates using cosine vector similarity or LLMs.
  3. Approval Thresholds: High-confidence matches auto-approve while uncertain values route to human reviewers.
  4. Central Repository: Approved canonical mappings are persisted and accessible via REST APIs.

πŸš€ Quick Start (Docker Compose)

Get the complete RefData Hub platform running with a single command:

docker compose up --build

🌐 Access Service Endpoints

  • 🎨 Reviewer UI (Dashboard): http://localhost:5274
  • ⚑ Backend REST API Docs (Swagger): http://localhost:8000/docs
  • πŸ—„οΈ Primary Application DB (PostgreSQL 15): localhost:5432
  • πŸ§ͺ Bundled Demo Target DB (PostgreSQL 15): localhost:5433

πŸ’‘ Lightweight by Default: The default docker compose up stack starts PostgreSQL, the FastAPI backend, the React frontend, and a seeded target database. It requires minimal memory and CPU resources.

Note the port difference: compose serves the UI on 5274, while npm run dev serves it on 5173.


πŸ€– Optional Offline Local LLM Setup (Ollama)

Heavy preloaded LLM images are not downloaded by default to conserve bandwidth and system memory.

If you want to use local offline LLM semantic matching, start the optional Ollama service profile:

# Launch the core stack WITH the optional local Ollama LLM runtime
docker compose --profile ollama up --build

Pulling Lightweight Models

When running the optional Ollama container, pull a compact, lightweight model such as smollm:135m or tinyllama:

docker compose exec ollama ollama pull smollm:135m

You can then select Offline Ollama in the Settings workspace of the Reviewer UI or configure REFDATA_LLM_MODEL=smollm:135m in your environment.


πŸ“Έ Interface Preview

A single end-to-end pass through the reviewer console β€” dashboard metrics, the canonical library, source profiling, and the approval queue.

RefData Hub Reviewer Console end-to-end walkthrough

RefData Hub Reference Data Management Dashboard: from raw upstream values to approved canonical mappings.

πŸ› οΈ Tech Stack

Component Technology Description
Backend API FastAPI + Python 3.10+ High-performance asynchronous REST API
ORM / Database SQLModel + PostgreSQL 15 Type-safe SQL querying and schema migrations
Frontend UI React 18 + Vite + Tailwind CSS Fast, themeable single-page application
Matching Engine fastembed + OpenAI / Ollama ONNX sentence-transformer embeddings & LLM re-ranking
Testing Pytest & Vitest Complete unit, integration, and UI test coverage
Containerization Docker & Docker Compose Multi-container service orchestration

πŸ’» Local Development Workflow

Backend Setup

Run from the repository root. REFDATA_DATABASE_URL is required for the API server; without it the app falls back to the compose-internal hostname db:5432, which does not resolve outside Docker.

# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r api/requirements.txt pytest pytest-cov

# Point the API at a reachable database
export REFDATA_DATABASE_URL="postgresql+psycopg://refdata:refdata@localhost:5432/refdata"
export REFDATA_CORS_ORIGINS="http://localhost:5173"

# Run API server locally
uvicorn app.main:app --app-dir api --reload --port 8000

Frontend Setup

# Navigate to UI directory
cd reviewer-ui

# Install dependencies
npm install

# Start Vite dev server (http://localhost:5173)
npm run dev

# Run UI test suite
npm test

The UI defaults to http://localhost:8000 for API calls on localhost. Set VITE_API_BASE_URL to point it elsewhere.

Tests

The test suite lives in tests/ at the repository root, so run pytest from there. Tests use an in-memory SQLite database and need no running Postgres.

# Backend β€” from the repository root
pytest

# With coverage
pytest --cov=app --cov-report=html

# Integration tests only
pytest -m integration

# Frontend
cd reviewer-ui && npm test

Documentation

pip install -r requirements-docs.txt

# Port 8000 is the API, so serve the docs on 8001
mkdocs serve -a localhost:8001

The docs theme is generated from the app's stylesheet. After changing a palette in reviewer-ui/src/styles.css, regenerate it with:

python scripts/generate_docs_tokens.py

πŸ“– Complete Documentation Index

Full documentation is published at β†’ https://rezer-bleede.github.io/refdata-hub/

The hosted site is the canonical, always-current version of every guide below. It ships the same 12-palette theme switcher as the Reviewer UI, so it reads as part of the product rather than a separate website. The Markdown sources for each page are committed in docs/ and build locally with mkdocs serve.

Getting Started

Guide Description
πŸš€ Quickstart Guide Detailed walkthrough for Docker and local setup

Workspace

Guide Description
🏠 Features Overview What the platform does, capability by capability
πŸ“Š Dashboard Metric tiles and the semantic match playground
🧱 Dimensions Dimension definitions, attribute schemas, and parent/child relations
πŸ“š Canonical Library Curating golden records, bulk import, and attributes

Integration

Guide Description
πŸ”Œ Source Connections Register upstreams, test connectivity, introspect live schemas
πŸ—ΊοΈ Field Mappings Bind source columns to dimensions and capture samples

Quality Control

Guide Description
πŸ“ˆ Match Insights Coverage rates, top matched and unmatched values
πŸ’‘ Suggestions Reviewing and approving semantic match suggestions
πŸ•“ Mapping History Audit trail plus CSV/XLSX round-trip

Reference & Developers

Guide Description
βš™οΈ System Settings Match thresholds, embedding models, LLM escalation
πŸ›οΈ Architecture Guide Deep dive into system components and vector matching
πŸ—„οΈ Database Schema Reference Complete ERD, table specs, and migration guides
πŸ“‘ REST API Documentation API endpoints, payloads, and integration examples
πŸ”§ Configuration Reference Environment variables, matcher settings, and tuning
πŸ› οΈ Developer Guide Local development, testing, and contribution patterns
πŸ§ͺ Testing Guide Test strategies and execution
☁️ Deployment Guide Production Docker, Kubernetes, and Cloudflare Pages setup
πŸ†˜ Troubleshooting Common issues and solutions

🀝 Contributing

We welcome contributions from the community! Please read our CONTRIBUTING.md guide for details on submitting pull requests, coding standards, and running tests.


πŸ“œ License

This project is open-source software licensed under the MIT License.

About

A semi-automated reference data and standardization service for global projects. This service handles common reference dimensions (marital status, education, nationality, etc.) by semantically matching new raw values, routing them to reviewers for approval, and adding them to a central mapping

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages