Loyalty · 13 / 26

Databricks Data and AI (artificial intelligence) Platform

How Databricks holds the loyalty platform's governed data, features, program-terms index, model serving, tracing and evaluation.

What Databricks does here

Databricks lakehouse for the loyalty platform Ledger and member extracts, flight and partner data and agent traces land in Unity Catalog as bronze, silver and gold tables, with a program-terms index, features and masks on identity and travel history. Model Serving hosts fraud and propensity models, and the agent application and MLflow tracing and evaluation read and write the governed tables. Ledger and member extracts balances · profiles Flights and partner data segments · files Agent traces from the gateway Unity Catalog · loyalty_prod bronze · silver · gold knowledge · features · masks Model Serving fraud · propensity Agent app retrieval + tools MLflow tracing · evaluation
One governed platform holds the data, features, the terms index, the serving endpoints and the evaluation loop.

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.

SchemaContentsWho can read
bronzeRaw flight events, partner files, claim pointers, ledger and member extracts as receivedData engineers
silverCleaned members, ledger entries, flight activity, claims, redemptions, offers and fraud cases, with identity and travel history as sensitive columnsEngineers and analysts, with masks
goldFeatures, evaluation sets, KPIs (Key Performance Indicators), liability inputs and fairness reportsFinance, fraud, marketing and evaluation teams
knowledgeProgram-terms index and its source tableThe agent service principal
securityScan results and security events from the gatewaySecurity 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.

Unity Catalog · masks and row filters
-- 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.

knowledge/search.py · filters are enforced at query time
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"]
A rule changes and the index follows The program office publishes an amended rule with an effective date. A job parses and chunks it, writes the clauses with tier scope and dates to the source table, and the index syncs from that table. At question time the copilot searches with a tier and date filter. Program office Lakeflow job Source table Vector Search Service copilot publish amended rule document change event parse, chunk by clause write clauses with tier and dates sync from change feed embed and index search + tier and date filter cited clauses
A rule changes and the index follows

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

JobScheduleWhat it does
Ingest flight events and ledger extractsEvery 15 minutesLands events in bronze and upserts silver
Ingest partner filesOn arrivalValidates signature and totals, lands in bronze, then matches
Refresh terms indexOn rule change, daily checkRe-chunks changed rules, writes the source table and syncs the index
Refresh featuresHourly and nightlyBuilds fraud and propensity features with masked identifiers
Retrain and validate modelsWeekly, gatedTrains, evaluates and registers candidate models; promotion needs the gate
Nightly evaluationNightly and on every releaseRuns the evaluation set, writes scores and alerts on regressions
Offer fairness reportMonthlyCompares offer allocation across permitted segments and writes the review table
Nightly evaluation job A nightly job runs the evaluation set through the agents and the gateway, records traces in MLflow, scores the results and writes them to a gold table. A regression raises an alert. Lakeflow job Agent app AI gateway MLflow Gold table Alert run dataset v7 model calls replies traces per case score with scorers and judges scores write scores by version compare with last release regression found
Nightly evaluation job

What the data answers

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