Two ways to use this template
- 1. Click "Copy prompt" below
- 2. Paste into Cursor, Claude Code, Codex, or any coding agent
- 3. Your agent builds the app — it asks questions along the way so the result is exactly what you want
Follow the steps below to set things up manually, at your own pace.
Inventory Intelligence
Retail inventory management with AI-powered demand forecasting, replenishment recommendations, and optional Genie analytics. Built on a live medallion pipeline synced to Lakebase.

Includes a working starter app
Real, runnable code lives on GitHub. When you copy the prompt above, your coding agent clones it as the starting point and adapts it to your data and use case.
examples/inventory-intelligence/template/This template builds a full retail inventory management system on the Databricks stack: a React app where store managers monitor stock health, review AI-generated replenishment recommendations, and approve purchase orders — all powered by a live medallion pipeline and pluggable demand forecast job.
Data Flow
Sales and stock data flow from Lakebase Postgres through the lakehouse, get enriched by a demand forecast model, and are served back to the app through reverse sync:
- OLTP writes land in Lakebase Postgres (stores, products, stock levels, sales transactions, replenishment orders).
- Lakehouse Sync replicates every change into Unity Catalog as CDC history tables (bronze layer).
- A Lakeflow Declarative Pipeline transforms CDC history into current-state silver tables and gold materialized views (inventory overview, low stock alerts, sales velocity).
- A Lakeflow Job runs on a schedule, loads the silver sales history, and runs a pluggable demand forecast model to produce 30-day unit forecasts and replenishment recommendations in a Delta gold table.
- Sync Tables (reverse sync) replicate the gold tables back into Lakebase for low-latency reads.
- The Inventory Intelligence App (Databricks App) reads from both OLTP and synced gold tables to show dashboards, store drill-downs, a replenishment queue, and optional Genie analytics.
Design
The app should have a beautiful, polished design — clean typography, consistent spacing, and a professional retail aesthetic. Use shadcn/ui components as the foundation, Tailwind for all styling, and brand colors throughout. Dashboards should feel data-rich but uncluttered; the replenishment queue should make approval workflows feel effortless.
What to Adapt
Provisioning (Unity Catalog schemas, Lakebase REPLICA IDENTITY), seeding, pipeline deploys, reverse sync, and app deploy are documented in the repository's template/README.md alongside the code.
To make this template your own:
- Catalog: Set the
catalogvariable in each pipeline'sdatabricks.ymlto your Unity Catalog catalog name. - Lakebase: Point the app's
databricks.ymlat your own Lakebase project, branch, and database. - Tables: The seed script creates the OLTP schema with 5 stores, 25 products, and 90 days of sales history. After seeding, configure Lakehouse Sync to replicate the
inventoryschema tables. - Sync Tables: Manually create the three reverse sync configurations (see the README for the exact table mappings).
- Forecast Model: Set the
forecast_modelvariable in the demand forecast pipeline toweighted_moving_average(default),exponential_smoothing,prophet, ormodel_serving. - Genie Space: Create a Genie space over your gold tables and set the
genie_space_idin the app bundle to activate the Analytics tab.
Built on these templates
This example's codebase and the agent prompt above both build on top of the templates below. Open one to dive into a specific technique on its own or apply it to a different project.
End-to-end setup for analyzing operational database data in the lakehouse: Unity Catalog with external storage, Lakebase provisioning, Lakehouse Sync CDC replication, and a medallion architecture pipeline with silver and gold layers.
Wire up a Databricks App with Lakebase for persistent data storage. Includes schema setup and full CRUD API routes.
Embed a Databricks AI/BI Genie chat interface so users can explore data through natural language. Configure a Genie space, wire up server and client plugins, declare app resources, and deploy.