How We Built a Full Customer 360 Inside Snowflake with Cortex Code

Greg Wolszczak Mon June 1, 2026

Building a true Customer 360 is one of the most requested and most stalled initiatives in enterprise data programs. The ambition is always clear: one unified view of the customer, predictive insights, actions surfaced to the people who need them. The execution is where it usually gets painful. Months of pipeline work. Fragmented tooling. ML models that never make it out of notebooks. Dashboards that show what happened, not what to do next.

We decided to rebuild that journey from scratch, inside Snowflake, using Cortex Code as the engine. What came out the other side changed how we think about delivery.

What Cortex Code Actually Is

Cortex Code is Snowflake's agentic AI coding assistant, built directly into the platform. The word agentic is important - it doesn't just complete lines of code. It plans, reasons across multiple steps, writes and executes code in your Snowflake environment, inspects the results, corrects itself, and moves to the next task. You describe what you want to build. Cortex Code figures out how to build it.

For a data team, that changes the equation. The gap between knowing what architecture you need and having it running in Snowflake - a gap that normally takes weeks of engineering - compresses to hours. Not because the engineering disappears, but because Cortex Code handles the mechanical translation from intent to code. Your team stays focused on the decisions that actually need expertise: what to build, why, and whether the output makes sense for the business.

The Use Case: Customer 360

The scenario will sound familiar. Five disconnected source systems, CRM, transactions, support tickets, product catalogue, portal clickstream, each owned by a different team, none of them joined. Hundreds of thousands of rows of dirty data sitting in silos. And a business questions every commercial leader in an asset-heavy, contract-driven industry has asked at some point: who is about to leave, what are they worth, and how do I get that in front of my account managers before it's too late. We see this across industries - manufacturing, professional services, technology distribution, financial services. The data is there. The question is clear. What stalls these projects is not ambition. It's the engineering weight between raw data and a decision someone can act on.

So we built it. A full end-to-end Customer 360 covering churn prediction, customer lifetime value scoring, and an activation layer that surfaces prioritized retention actions to account managers. Not a proof of concept on clean data. A working pipeline on realistic, messy, multi-source data. In a fraction of the time a traditional project would take.

In a conventional engagement, this is a multi-workstream effort. Data engineering, feature engineering, ML modelling, and application development running in parallel, each with different tooling, different hand-off points, and a timeline measured in months. We approached it differently - and Cortex Code is the reason why.

The Data Layer - From Raw to Golden Record

The first challenge was the data itself. Cortex Code generated the full medallion architecture and wrote the transformation logic for each layer. In the staging layer alone, it produced over forty cleaning operations across five tables: standardizing inconsistent categorical values from dozens of dirty variants down to controlled clean values, parsing three different date formats, flagging invalid records rather than dropping them so the audit trail stays intact.

What made this fast wasn't just the code generation. It was that Cortex Code reasoned about the data. When it encountered a column with mixed formats, it diagnosed the pattern, proposed the cleaning logic, tested it against the actual data in Snowflake, and confirmed the output before moving on. A task that would normally occupy a data engineer for days was done in a single session.

The output was a Golden Customer Record - one materialized table, one row per customer, all five sources joined on a single customer identity. On top of that, Cortex Code computed both deterministic fields (order count, ticket volume, last login date) and derived signals that capture patterns the raw data can't express on its own: spend trend ratios comparing the last 90 days to the prior 90 days, consumable purchase trend, RFM quintile scores, composite engagement scores, and a churn risk composite from 0 to 100.

 The consumable trend signal is a good example of why derived features matter. In a device and service contract business, a customer who stops ordering consumables is likely decommissioning their devices - months before they formally cancel the contract. The derived consumable trend ratio turns that into a number the model can actually learn from. 

The ML Layer - Two Models, One Priority

With the Golden Customer Record in place, Cortex Code trained two models directly inside Snowflake. No Python environment to configure, no external ML platform, no data leaving the Snowflake perimeter.

The first was a Churn Prediction classifier. It takes the labelled training table, learns the relationships between features and the target variable, and returns a model stored inside Snowflake. Cortex Code wrote the training call, evaluated the performance metrics, and generated the scoring query that runs across the full customer base - outputting a churn score and a risk tier (High, Medium, Low) for every customer. Feature importance comes with it, so business users can see which signals drove each prediction rather than receiving an opaque number.

The second was a Customer Lifetime Value regression model - trained on historical spend patterns and customer signals, scored against the full base, outputting a predicted CLV and a five-tier value segment from Bronze to Diamond.

Combining the two - churn risk on one axis, lifetime value on the other - produces the prioritization logic that drives everything downstream. High risk and high value is the Monday morning call. Low risk and low value can wait. That quadrant is what turns 48,000 customers into a manageable list.

The Activation Layer - Insight Into Action

Most Customer 360 projects stop at the score. A ranked list handed to a sales team with no context and no clear next step. We went further.

For each at-risk customer, Cortex Code generated a call that passes the customer's signals to a large language model running inside Snowflake. No data leaves the perimeter. The model returns three things: why this customer is at risk in plain language, what the account manager should do, and what upsell opportunity exists based on their purchase history. These outputs are stored as a column in the curated table - AI-generated insight treated as structured data, queryable and refreshable.

On top of that, Cortex Code scaffolded a seven-page Streamlit application wired to all layers: customer overview, churn and CLV model results with feature importance, a full Customer 360 profile, a retention action board with outreach messages ready to copy, a renewal pipeline view, and a pipeline health page. The account manager sees who to call, why, and what to say. That's the whole interaction.

 The retention action board is the end point of a pipeline that starts with five dirty CSV files. Cortex Code connected every step - cleaning, joining, feature engineering, model training, scoring, LLM inference, and visualization - inside a single Snowflake environment, without switching tools. 

What This Changes

Cortex Code doesn't replace data engineers or data scientists. The architecture decisions, the feature engineering rationale, the model selection, the business logic behind the activation layer - all of that needed real expertise. What it replaced was the mechanical translation between a decision and the running code. The hours writing SQL by hand. The back-and-forth debugging a cleaning expression. The boilerplate of model deployment. The context-switching between tools. In practice:

 

  • Faster to value - From problem definition to something stakeholders can interact with, in days rather than months. 
  • Lower risk - Everything stays inside Snowflake, governed and auditable, with no stitched-together toolchain to maintain or secure. 
  • Wider access - The skill that matters shifts from writing the cleaning expression to knowing why the cleaning rule matters in the first place. That is a more useful place for senior expertise to live. 
  • Credibility from day one - A working prototype in the first week is not just efficient. It is a different kind of conversation with the business. 

What This Means for Our Clients

Cortex Code is only as good as the expertise behind it. It accelerates delivery, but it doesn't replace knowing what to build, why it matters, and how to tell the difference between a model that performs and one that just looks like it does.

At SBI, we've done this. We designed the transformation architecture, wrote the feature engineering logic, selected and validated the models, built the activation layer, and used Cortex Code to execute it at a pace that would have been impossible otherwise. That combination is what we bring to Snowflake engagements: the depth to make the right decisions, the tools to execute them without the usual wait.

Partagez cet article

Nos Actus

Data
29 avril 2024
The state of the art in Snowflake Governance

Context Imagine you're the new CIO of an international group.

AI
10 juillet 2025
What AI Agents Are Really Changing for the Finance Function

Over the past few months, “intelligent agents” have been popping up everywhere — digital assistants seamlessly integrating into our everyday tools....

Data
10 janvier 2022
Turn Your BI Project into a Success Story with the Agile Method

The Agile BI method has become a strategic advantage for successful Business Intelligence projects. Inspired by agile software development practices,...