MATIH Platform is in active MVP development. Documentation reflects current implementation status.
20. Appendices & Reference
Template Library Reference

Template Library Reference

The MATIH Template Library provides pre-built, parameterized starting points for common platform tasks. Templates accelerate onboarding, enforce best practices, and ensure consistency across tenant workspaces. This section catalogs every template category with detailed descriptions, parameters, and usage instructions.


Overview

Templates are stored in the templates/ directory of the platform repository, organized by discipline:

templates/
  bi/                 # Business Intelligence templates
  data/               # Data Engineering templates
  ml/                 # Machine Learning templates
  agentic/            # AI Agent templates
  ontology/           # Ontology and knowledge graph templates
  notebooks/          # Jupyter Notebook templates
  spark/              # Apache Spark job templates

Templates can be accessed through:

  1. Marketplace UI: Browse and install templates from the Config Service marketplace
  2. CLI: matih template apply <template-name> --params key=value
  3. API: POST /api/v1/marketplace/templates/{id}/apply
  4. Workbench: Template gallery in each workbench application

BI Templates (templates/bi/)

Business Intelligence templates provide pre-configured dashboard layouts, widget configurations, and data visualization patterns.

Dashboard Templates

TemplateDescriptionWidgetsData Requirements
executive-summaryC-suite overview dashboard with KPI cards, trend lines, and regional breakdowns8 widgetsRevenue, cost, user counts, time series data
sales-pipelineSales funnel visualization with conversion rates and deal stages6 widgetsCRM data with pipeline stages and amounts
customer-analyticsCustomer segmentation, cohort analysis, and retention metrics10 widgetsCustomer data with acquisition dates and behavior
financial-overviewP&L statement visualization, budget vs actual, cash flow7 widgetsFinancial data with accounts and periods
product-metricsProduct usage analytics, feature adoption, and engagement9 widgetsProduct telemetry and user activity data
operational-kpisOperations dashboard with SLAs, throughput, and error rates8 widgetsOperational metrics and incident data
marketing-performanceCampaign performance, channel attribution, and ROI7 widgetsMarketing campaign data with spend and conversions
hr-analyticsHeadcount, attrition, compensation, and diversity metrics8 widgetsHR data with employee demographics and compensation

Template Parameters (BI)

Each BI template accepts the following standard parameters:

ParameterTypeRequiredDescription
namestringYesDashboard name
dataSourcestringYesConnector or data source to bind to
dateColumnstringYesPrimary date/time column for time series
dateRangestringNoDefault date range (last_7_days, last_30_days, last_quarter, ytd)
currencystringNoCurrency code for financial formatting (default: USD)
refreshIntervalintegerNoAuto-refresh interval in seconds (default: 300)
themestringNoVisual theme (light, dark, corporate)

Usage Example

POST /api/v1/marketplace/templates/executive-summary/apply
Content-Type: application/json
 
{
  "name": "Q4 2025 Executive Summary",
  "params": {
    "dataSource": "sales_warehouse",
    "dateColumn": "order_date",
    "dateRange": "last_quarter",
    "currency": "USD",
    "theme": "corporate",
    "revenueTable": "sales.orders",
    "revenueColumn": "total_amount",
    "regionColumn": "sales_region",
    "productColumn": "product_category"
  }
}

Widget Type Reference

Widget TypeDescriptionConfiguration Keys
kpi-cardSingle numeric KPI with trend indicatormetric, comparison, format, thresholds
line-chartTime series line chartxAxis, yAxis, series, groupBy
bar-chartVertical or horizontal bar chartxAxis, yAxis, orientation, stacked
pie-chartPie or donut chartdimension, measure, donut, showLabels
area-chartStacked or regular area chartxAxis, yAxis, series, stacked
scatter-plotScatter plot with optional regression linexAxis, yAxis, colorBy, sizeBy
data-tableTabular data with sorting and paginationcolumns, sortBy, pageSize, conditionalFormatting
pivot-tablePivot table with drill-downrows, columns, values, aggregation
funnel-chartFunnel/conversion chartstages, measure, showConversion
mapGeographic map with data overlaygeoColumn, measure, mapType, colorScale
heatmapTwo-dimensional heatmapxAxis, yAxis, value, colorScale
gaugeGauge/speedometer chartvalue, min, max, thresholds
text-blockRich text annotationcontent, format
filter-controlInteractive filter widgetcolumn, filterType, defaultValue

Data Engineering Templates (templates/data/)

Data engineering templates provide pipeline definitions, transformation patterns, and data quality configurations.

Pipeline Templates

TemplateDescriptionTechnologySchedule
elt-basicBasic ELT pipeline: extract from source, load to staging, transform to targetTemporal + dbtHourly
elt-incrementalIncremental ELT with change tracking and mergeTemporal + dbtEvery 15 minutes
cdc-pipelineCDC pipeline using Flink to stream database changes to IcebergFlink SQLContinuous
data-warehouse-loadFull data warehouse load with dimension/fact table patternsTemporal + SparkDaily
data-lake-ingestionIngest files from S3/Azure Blob/GCS into Iceberg tablesSpark + AirflowOn arrival
api-to-lakeExtract data from REST APIs and load into the lakehousePython + TemporalConfigurable
streaming-aggregationReal-time aggregation of event streams into materialized viewsFlink SQLContinuous
data-compactionScheduled Iceberg table compaction and snapshot managementSparkDaily

Pipeline Template Parameters

ParameterTypeRequiredDescription
namestringYesPipeline name
sourceConnectorstringYesSource data connector name
targetCatalogstringYesTarget Iceberg catalog
targetSchemastringYesTarget schema/namespace
schedulestringNoCron expression for scheduling
notifyOnFailurebooleanNoSend notification on pipeline failure
retryCountintegerNoNumber of retry attempts on failure (default: 3)
timeoutintegerNoPipeline timeout in minutes (default: 60)

dbt Project Templates

TemplateDescriptionModels
dbt-starterBasic dbt project with staging, intermediate, and mart layers5 example models
dbt-ecommerceE-commerce analytics dbt project15 models (customers, orders, products, sessions)
dbt-saas-metricsSaaS metrics dbt project (MRR, churn, LTV, cohorts)12 models
dbt-financialFinancial reporting dbt project (P&L, balance sheet, cash flow)10 models

Data Quality Templates

TemplateDescriptionRules
quality-basicBasic data quality checks (nulls, uniqueness, range)5 rule types
quality-comprehensiveFull quality suite with statistical profiling and anomaly detection15 rule types
quality-freshnessData freshness and SLA monitoringFreshness checks + SLA definitions
quality-schema-driftSchema drift detection and alertingSchema comparison rules

ML Templates (templates/ml/)

Machine learning templates provide experiment configurations, training scripts, model serving definitions, and monitoring dashboards.

Experiment Templates

TemplateDescriptionFrameworkTask
classification-tabularBinary/multiclass classification on tabular datascikit-learn, XGBoostClassification
regression-tabularRegression on tabular datascikit-learn, LightGBMRegression
timeseries-forecastingTime series forecasting with multiple modelsProphet, ARIMA, LSTMForecasting
nlp-text-classificationText classification with transformer modelsHugging Face, PyTorchNLP
image-classificationImage classification with CNN/ViTPyTorch, torchvisionComputer Vision
recommendation-engineCollaborative filtering recommendation systemPyTorch, SurpriseRecSys
anomaly-detectionUnsupervised anomaly detectionscikit-learn, PyODAnomaly Detection
clustering-analysisCustomer/data segmentation via clusteringscikit-learn, HDBSCANClustering

Training Job Templates

TemplateDescriptionResources
training-single-gpuSingle GPU training job1 GPU, 4 CPU, 16Gi memory
training-multi-gpuMulti-GPU distributed training4 GPUs, 16 CPU, 64Gi memory
training-ray-distributedRay-based distributed trainingRay cluster (1 head + 4 workers)
training-cpu-onlyCPU-only training for traditional ML8 CPU, 32Gi memory
hyperparameter-sweepHyperparameter tuning with Ray TuneConfigurable (2-16 workers)

Model Serving Templates

TemplateDescriptionServing Technology
serve-fastapiSimple model serving with FastAPIFastAPI + Uvicorn
serve-tritonHigh-performance serving with NVIDIA TritonTriton Inference Server
serve-rayScalable serving with Ray ServeRay Serve
serve-batchBatch inference pipelineSpark + Temporal
serve-ab-testA/B testing deployment with traffic splittingRay Serve + Istio

Model Monitoring Templates

TemplateDescriptionMetrics
monitor-basicBasic model performance monitoringAccuracy, latency, throughput
monitor-driftData and concept drift detectionPSI, KS test, JS divergence
monitor-fairnessFairness and bias monitoringDemographic parity, equalized odds
monitor-comprehensiveFull monitoring suiteAll of the above + custom metrics

ML Template Parameters

ParameterTypeRequiredDescription
experimentNamestringYesMLflow experiment name
modelNamestringYesModel registry name
datasetPathstringYesPath to training dataset (S3/ADLS/GCS)
targetColumnstringYesTarget variable column name
featureColumnslistNoFeature column names (default: all non-target)
testSizefloatNoTest set proportion (default: 0.2)
randomSeedintegerNoRandom seed for reproducibility (default: 42)
gpuCountintegerNoNumber of GPUs (default: 0)

Agentic Templates (templates/agentic/)

Agentic templates provide pre-configured AI agent workflows and conversation patterns.

Agent Templates

TemplateDescriptionAgents
chat-basicBasic conversational Q&A agentIntent classifier, RAG retriever, response generator
text-to-sql-standardStandard text-to-SQL pipelineIntent classifier, schema retriever, SQL generator, validator, executor
text-to-sql-advancedAdvanced text-to-SQL with disambiguation and visualizationAll standard + disambiguator, visualizer, explainer
data-analystAutonomous data analyst agentFull pipeline + automated follow-up questions
report-generatorAutomated report generation from natural languageFull pipeline + report formatter, PDF generator
custom-domainTemplate for building domain-specific agentsBase agent scaffold with custom tool integration

Agent Template Parameters

ParameterTypeRequiredDescription
namestringYesAgent workflow name
defaultDataSourcestringYesDefault data source for queries
defaultDialectstringNoSQL dialect (default: trino)
llmProviderstringNoLLM provider override (default: tenant setting)
llmModelstringNoLLM model override
enableGuardrailsbooleanNoEnable safety guardrails (default: true)
enableStreamingbooleanNoEnable response streaming (default: true)
maxRetriesintegerNoMax SQL generation retries (default: 3)

Ontology Templates (templates/ontology/)

Ontology templates provide domain-specific knowledge graph schemas.

TemplateDescriptionEntitiesRelationships
enterprise-dataGeneral enterprise data ontologyDatabase, Schema, Table, Column, User, Applicationcontains, owns, uses, produces
ecommerceE-commerce domain ontologyCustomer, Product, Order, Category, Review, Sellerpurchases, contains, reviews, belongs_to
financial-servicesFinancial services ontologyAccount, Transaction, Customer, Portfolio, Riskholds, transfers, owns, manages
healthcareHealthcare domain ontologyPatient, Provider, Encounter, Diagnosis, Medicationtreats, prescribes, diagnoses, refers
saas-productSaaS product analytics ontologyUser, Account, Feature, Session, Event, Subscriptionuses, triggers, subscribes, belongs_to
iot-sensorIoT sensor data ontologyDevice, Sensor, Reading, Location, Alertmeasures, located_at, triggers, contains

Ontology Template Parameters

ParameterTypeRequiredDescription
namestringYesOntology name
namespacestringYesOntology namespace URI
formatstringNoOutput format (owl, rdf, json-ld, default: owl)
includeShaclbooleanNoInclude SHACL validation shapes (default: true)
mapToSchemastringNoDatabase schema to auto-map entity-to-table

Notebook Templates (templates/notebooks/)

Jupyter Notebook templates provide interactive analysis starting points.

TemplateDescriptionLanguageLibraries
eda-basicBasic exploratory data analysisPythonpandas, matplotlib, seaborn
eda-advancedAdvanced EDA with profiling and correlationPythonpandas-profiling, plotly, scipy
sql-analysisSQL-based analysis with TrinoPython + SQLtrino-python-client, pandas
ml-experimentML experiment notebook with MLflow trackingPythonscikit-learn, mlflow, matplotlib
deep-learningDeep learning training notebookPythonPyTorch, torchvision, tensorboard
nlp-analysisNLP text analysis and visualizationPythontransformers, spacy, wordcloud
geospatialGeospatial data analysisPythongeopandas, folium, shapely
timeseriesTime series analysis and forecastingPythonstatsmodels, prophet, plotly
spark-analysisDistributed analysis with SparkPySparkpyspark, spark-connect
data-quality-reportData quality assessment reportPythongreat-expectations, pandas

Notebook Template Parameters

ParameterTypeRequiredDescription
namestringYesNotebook file name
dataSourcestringYesData source connection name
tableNamestringNoDefault table to analyze
outputFormatstringNoOutput format for reports (html, pdf)
kernelSpecstringNoJupyter kernel (python3, pyspark)

Spark Job Templates (templates/spark/)

Apache Spark job templates provide production-ready Spark application scaffolds.

TemplateDescriptionLanguageMode
batch-etlBatch ETL job: extract, transform, load to IcebergScala/PythonBatch
streaming-etlStructured Streaming ETL from Kafka to IcebergScala/PythonStreaming
data-compactionIceberg table maintenance (compaction, snapshot expiry)ScalaBatch
feature-engineeringFeature computation and materialization to FeastPythonBatch
data-validationLarge-scale data validation with custom rulesPythonBatch
graph-analyticsGraphX-based graph analyticsScalaBatch
delta-migrationMigrate data from Delta Lake to IcebergScalaBatch

Spark Template Parameters

ParameterTypeRequiredDescription
namestringYesSpark application name
mainClassstringYes (Scala)Main class fully qualified name
mainFilestringYes (Python)Path to main Python file
driverCoresintegerNoDriver CPU cores (default: 2)
driverMemorystringNoDriver memory (default: 4g)
executorCoresintegerNoExecutor CPU cores (default: 4)
executorMemorystringNoExecutor memory (default: 8g)
executorInstancesintegerNoNumber of executors (default: 2)
inputPathstringYesInput data path
outputPathstringYesOutput data path
icebergCatalogstringNoIceberg catalog name (default: iceberg)

Template Versioning

Templates follow semantic versioning. When a template is updated, existing instances are not automatically modified. Users can check for template updates via:

GET /api/v1/marketplace/templates/{id}/versions

Updating an existing instance to a new template version is done via:

POST /api/v1/marketplace/templates/{id}/upgrade
{
  "instanceId": "inst-abc123",
  "targetVersion": "2.0.0",
  "preserveCustomizations": true
}

Custom Templates

Teams can create and publish custom templates to the Marketplace:

  1. Create a template definition in the appropriate templates/ subdirectory
  2. Include a template-manifest.yaml with metadata, parameters schema, and documentation
  3. Submit via POST /api/v1/marketplace/templates
  4. Templates undergo review before publication
# template-manifest.yaml
name: custom-sales-dashboard
displayName: Sales Dashboard (Custom)
version: 1.0.0
category: bi
author: Sales Analytics Team
description: Custom sales dashboard with regional breakdown and YoY comparison
parameters:
  - name: dataSource
    type: string
    required: true
    description: Sales data connector
  - name: revenueColumn
    type: string
    required: true
    default: total_amount
  - name: dateColumn
    type: string
    required: true
    default: order_date
tags: [sales, revenue, dashboard, bi]

Template Application Workflow

When a user applies a template, the platform follows this workflow:

Step-by-Step Process

StepActionComponent
1User browses or searches for templatesMarketplace UI or API
2User selects a template and reviews its description and parametersWorkbench gallery
3User provides parameter values (data source, names, options)Parameter form
4Platform validates parameters against the template's JSON SchemaConfig Service
5Platform renders the template with the provided parametersTemplate engine
6Platform creates the resulting resources (dashboard, pipeline, experiment, etc.)Target service
7Platform confirms creation and provides a link to the new resourceWorkbench UI

Template Rendering Engine

Templates use a Mustache-compatible rendering engine with the following built-in helpers:

HelperDescriptionExample
{{param}}Simple parameter substitution{{name}} renders to My Dashboard
{{#if param}}...{{/if}}Conditional rendering{{#if enableStreaming}}streaming: true{{/if}}
{{#each items}}...{{/each}}Iteration over arrays{{#each columns}}{{name}}: {{type}}{{/each}}
{{uppercase param}}Convert to uppercase{{uppercase name}} renders to MY_DASHBOARD
{{lowercase param}}Convert to lowercase{{lowercase name}} renders to my_dashboard
{{slugify param}}Convert to URL-safe slug{{slugify name}} renders to my-dashboard
{{timestamp}}Current ISO 8601 timestamp2026-02-12T10:30:00.000Z
{{uuid}}Generate a new UUIDa1b2c3d4-e5f6-7890-abcd-ef1234567890

Template Testing

Before publishing a template, run the template test suite:

cd templates/{category}/{template-name}
matih template test --params test-params.json

The test suite validates:

CheckDescription
Schema ValidationAll required parameters are defined and typed correctly
RenderingTemplate renders without errors with test parameter values
Resource ValidationRendered resources pass the target service's validation (e.g., valid dashboard JSON, valid pipeline DAG)
IdempotencyApplying the same template twice with the same parameters does not create duplicate resources
Parameter BoundariesTemplate handles edge cases (empty strings, maximum values, special characters)

Template Categories Summary

CategoryDirectoryCountTarget Service
Business Intelligencetemplates/bi/8 dashboard templatesBI Service
Data Engineeringtemplates/data/8 pipeline + 4 dbt + 4 quality templatesPipeline Service, Data Quality Service
Machine Learningtemplates/ml/8 experiment + 5 training + 5 serving + 4 monitoring templatesML Service
Agentic AItemplates/agentic/6 agent workflow templatesAI Service
Ontologytemplates/ontology/10 domain ontology templatesOntology Service
Notebookstemplates/notebooks/10 Jupyter notebook templatesJupyterHub
Spark Jobstemplates/spark/7 Spark application templatesSpark Operator

Total: 79 templates across 7 categories

Each template is maintained as part of the platform repository and follows the same CI/CD process as application code: automated testing on pull requests, versioned releases, and documentation updates.