What Databricks does here
Databricks is the data and AI platform for the betting platform. It keeps operational copies, features and decisions in governed tables, builds the terms index from the rules, serves the harm, fraud and integrity models and provides tracing and evaluation. The bet path and the orchestrator run in the application tier, and language models are reached through the AI gateway.
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 bet and session events, results feeds, KYC pointers, account and wallet extracts as received | Data engineers |
| silver | Cleaned players, bets, sessions, deposits, KYC cases, risk scores, interventions and cases, with identity, location and behaviour as sensitive columns | Engineers and analysts, with masks |
| gold | Features, evaluation sets, KPIs (Key Performance Indicators) and bias and fairness reports | Compliance, safer gambling, fraud and evaluation teams |
| knowledge | Terms-and-rules 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 safer gambling lead sees it for a case they own.
-- Player identifiers, contacts and location are masked except for approved roles
CREATE FUNCTION betting_prod.silver.mask_sensitive(value STRING)
RETURN CASE WHEN is_account_group_member('safer_gambling_leads') THEN value ELSE '***' END;
ALTER TABLE betting_prod.silver.players
ALTER COLUMN email SET MASK betting_prod.silver.mask_sensitive;
ALTER TABLE betting_prod.silver.session_events
ALTER COLUMN player_id SET MASK betting_prod.silver.mask_sensitive;
-- Jurisdiction teams see only their players
CREATE FUNCTION betting_prod.silver.jurisdiction_filter(jurisdiction STRING)
RETURN is_account_group_member('betting_global') OR is_account_group_member(CONCAT('betting_', jurisdiction));
ALTER TABLE betting_prod.silver.players
SET ROW FILTER betting_prod.silver.jurisdiction_filter ON (jurisdiction);The terms-and-rules index
Terms, house rules and policies are chunked by clause, tagged with jurisdiction, 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 jurisdiction and effective date at query time, so it cannot cite a rule from another market or an expired one.
from databricks.vector_search.client import VectorSearchClient
index = VectorSearchClient().get_index(
endpoint_name="betting-knowledge",
index_name="betting_prod.knowledge.terms_and_rules_index",
)
def search_terms(question: str, jurisdiction: str, on_date: str) -> list[dict]:
hits = index.similarity_search(
query_text=question,
columns=["clause_id", "title", "text", "jurisdiction", "source_url"],
filters={"jurisdiction": [jurisdiction, "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 harm-marker, fraud and integrity 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 |
|---|---|---|
| Stream bet and session events | Continuous | Lands events in bronze and builds streaming features with pseudonymised player ids |
| Ingest account, wallet and results extracts | Every 15 minutes | Upserts silver |
| Refresh terms index | On rule change, daily check | Re-chunks changed rules, writes the source table and syncs the index |
| Refresh features | Continuous and nightly | Builds harm, fraud and integrity features |
| Retrain and validate models | Weekly, gated | Trains, evaluates and registers candidate models; promotion needs the gate and a bias check |
| Nightly evaluation | Nightly and on every release | Runs the evaluation set, writes scores and alerts on regressions |
| Intervention fairness report | Monthly | Compares intervention and restriction rates across permitted segments and writes the review table |
What the data answers
- Time from a harm marker to the first intervention, and how many players respond.
- Share of KYC cases verified without a person, and time to decision.
- Fraud losses, wrongful restrictions and analyst queue age.
- Protection audit results: bets outside eligibility, sends to excluded players, actions without a basis.
- Intervention and restriction rates by permitted segment, for the bias review.
Build this for your business
This example is a player protection and operations platform for a licensed betting operator, but the same pattern, deterministic rules for every hard duty, a governed gateway, runtime security, protect-first automation and measured quality, fits any regulated, customer-facing service. We can scope a pilot on your own systems.
Book a discovery call