What Databricks does here
Databricks is the data and AI platform for the loyalty platform. It keeps operational copies, decisions and features in governed tables, builds the terms index from the program rulebook, serves the fraud and propensity models and provides tracing and evaluation. The orchestrator itself runs in the application tier and calls the AI gateway for language models.
Governance in Unity Catalog
One catalog per environment, with schemas by purpose. Access is granted to groups, never to individuals, and sensitive data is protected in the table, so every notebook, dashboard and evaluation job inherits the control.
| Schema | Contents | Who can read |
|---|---|---|
| bronze | Raw flight events, partner files, claim pointers, ledger and member extracts as received | Data engineers |
| silver | Cleaned members, ledger entries, flight activity, claims, redemptions, offers and fraud cases, with identity and travel history as sensitive columns | Engineers and analysts, with masks |
| gold | Features, evaluation sets, KPIs (Key Performance Indicators), liability inputs and fairness reports | Finance, fraud, marketing and evaluation teams |
| knowledge | Program-terms index and its source table | The agent service principal |
| security | Scan results and security events from the gateway | Security operations |
Protecting sensitive data in the table
Row filters and column masks make the rule part of the table. Analysts see a masked identifier; a program lead sees it for a case they own.
-- Member identifiers and contact data are masked except for approved roles
CREATE FUNCTION loyalty_prod.silver.mask_sensitive(value STRING)
RETURN CASE WHEN is_account_group_member('loyalty_leads') THEN value ELSE '***' END;
ALTER TABLE loyalty_prod.silver.members
ALTER COLUMN email SET MASK loyalty_prod.silver.mask_sensitive;
ALTER TABLE loyalty_prod.silver.flight_activity
ALTER COLUMN member_id SET MASK loyalty_prod.silver.mask_sensitive;
-- Market teams see only their members
CREATE FUNCTION loyalty_prod.silver.market_filter(market STRING)
RETURN is_account_group_member('loyalty_global') OR is_account_group_member(CONCAT('loyalty_', market));
ALTER TABLE loyalty_prod.silver.members
SET ROW FILTER loyalty_prod.silver.market_filter ON (market);The program-terms index
The program rulebook is chunked by clause, tagged with tier scope, effective dates and a version, and stored in a gold table. A Vector Search index (the product is now branded Databricks AI Search) syncs from that table, so a rule change updates the index without a rebuild. The copilot filters by tier and effective date at query time, so it cannot cite a rule that does not apply to the member or has expired.
from databricks.vector_search.client import VectorSearchClient
index = VectorSearchClient().get_index(
endpoint_name="loyalty-knowledge",
index_name="loyalty_prod.knowledge.program_terms_index",
)
def search_terms(question: str, tier: str, on_date: str) -> list[dict]:
hits = index.similarity_search(
query_text=question,
columns=["clause_id", "title", "text", "tier_scope", "source_url"],
filters={"tier_scope": [tier, "all"], "effective_from <=": on_date, "effective_to >=": on_date},
num_results=5,
)
return hits["result"]["data_array"]No rebuild is needed. Effective dates make sure a rule applies only when it should.
Serving, the gateway and tracing
Model Serving
Hosts the fraud and propensity models behind endpoints with scaling, versioning and monitoring, separate from the language-model gateway.
AI Gateway on endpoints
Rate limits, usage tracking, guardrails, fallbacks and inference tables for served endpoints, to complement the enterprise gateway.
MLflow tracing
Spans for each retrieval, model call and tool call, logged with the case and trace identifier from the gateway.
Agent evaluation
Runs the evaluation set with built-in and custom judges, and stores results in a gold table for comparison across releases.
Jobs that keep it current
| Job | Schedule | What it does |
|---|---|---|
| Ingest flight events and ledger extracts | Every 15 minutes | Lands events in bronze and upserts silver |
| Ingest partner files | On arrival | Validates signature and totals, lands in bronze, then matches |
| Refresh terms index | On rule change, daily check | Re-chunks changed rules, writes the source table and syncs the index |
| Refresh features | Hourly and nightly | Builds fraud and propensity features with masked identifiers |
| Retrain and validate models | Weekly, gated | Trains, evaluates and registers candidate models; promotion needs the gate |
| Nightly evaluation | Nightly and on every release | Runs the evaluation set, writes scores and alerts on regressions |
| Offer fairness report | Monthly | Compares offer allocation across permitted segments and writes the review table |
What the data answers
- Share of claim value credited without a person, and time from claim to credit.
- Fraud queue precision at analyst capacity, stolen-miles losses and wrongful holds.
- Offer response and spend by segment, and the fairness review of allocation.
- Cost per claim, per copilot case and per scored event, from gateway and endpoint metadata.
- Miles liability inputs and breakage evidence by rule version.
Build this for your business
This example is a loyalty platform for an airline, but the same pattern, deterministic financial rules, a governed gateway, runtime security, consent-aware personalisation and measured quality, fits any program that holds a customer balance and makes offers. We can scope a pilot on your own systems.
Book a discovery call