← Back to home
Case Study · Data & AI Architecture

Turning lending documents into an AI-powered data asset

How a specialty healthcare-practice lender turned the unstructured documents it already receives — practice-sale prospectuses, credit memos, financials — into queryable intelligence using Snowflake-native AI, plus a reusable framework so the next document type follows the same path.
My role: data & AI architect and hands-on builder. Over a multi-month engagement I designed and built the applied-AI stack, the knowledge-discovery framework, the document knowledge base, and the productization strategy — and ran the AI-native workflow used to build it.
4
AI apps built & running (agent, search, semantic views, app)
67
documents run through an AI discovery pipeline (61 analyzed)
460→25
raw source terms normalized to canonical fields
5
AI-powered data products scoped & mapped to personas
The through-line. Every loan the lender makes brings in unstructured documents — practice-sale prospectuses, credit memos, financials. This work turned those documents into queryable intelligence using Snowflake-native AI (no data leaves the platform), and codified the how into a reusable framework so the next document type follows the same path. The result is a compounding, proprietary data asset — not a one-off model.
AI outcomes — what the work delivers
The business results the AI work drives, and what enables each one.
Underwriting from hours to minutes
A borrower uploads a prospectus; AI extracts the canonical fields and pre-populates the credit memo. The underwriter reviews instead of re-keys — collapsing manual data entry per loan.
enabled by the credit-memo agent + AI_EXTRACT extraction schema
A proprietary data asset no competitor has
A normalized, queryable database of practice economics across 12+ brokers — the foundation of the benchmarking products. Institutional knowledge encoded in YAML, not people's heads.
enabled by the Knowledge Discovery Framework + controlled vocabulary
Customer-facing intelligence, self-service
Borrowers and loan officers get instant benchmarking and plain-language search over the document corpus — new revenue products and better deal conversations, served without exposing raw tables.
enabled by Cortex Search + semantic views (Cortex Analyst)
Each new document type gets cheaper
The methodology is reusable — the next corpus follows the same 5-phase path at lower cost because the framework, schema pattern, and AI-native workflow already exist. A compounding capability, not a one-off build.
enabled by the 4-layer / 5-phase framework + dual-agent model

01 Applied AI — built and running

Snowflake-native AI deployed and working in the analytics account — real objects, real data, callable. Not slideware.
Credit Memo Analyst agent LIVE
A Cortex Agent that extracts and interprets commercial-lending credit memos in natural language — borrower profiles, loan structure, risk ratings, collateral, DSCR/LTV, repayment sources. Orchestrates two tools: semantic search + a structured extraction function.
Cortex Agent · orchestration auto · 60s / 16k-token budget
search tool → credit-memo Cortex Search service
extract tool → EXTRACT_CREDIT_DATA UDF on the compute warehouse
Cortex Search service LIVE
A managed retrieval index over source documents — the backbone of document Q&A and the agent's search tool. Chunked + embedded narrative content, queried semantically.
service: READ_CREDIT_MEMO · 39 docs indexed
title column: RELATIVE_PATH · max 10 results
Semantic views (Cortex Analyst) LIVE
Five governed text-to-SQL semantic views powering self-service analytics without exposing raw tables. One is AI-extended for provider-compensation benchmarking.
PROVIDER_COMPENSATION_SV (AI-extended)
CREDIT_MEMO_DEALS_SV ×2 · LOAN_ANALYSIS_SV ×2
Documentation Streamlit app LIVE
A Streamlit-in-Snowflake app surfacing the benchmark data dictionary, specialty reference, and semantic-view documentation to internal users — a persona-specific serving surface.
Streamlit-in-Snowflake · internal serving surface

AI functions in the toolbox: AI_COMPLETE AI_EXTRACT AI_PARSE_DOCUMENT AI_CLASSIFY — used across discovery, extraction, and classification.

02 The Knowledge Discovery Framework

The reusable IP — a 4-layer, 5-phase methodology for turning any unstructured document corpus into a queryable knowledge base. Developed and validated on the prospectus corpus; designed to be applied to the next document type at lower cost.

Four layers — document → decision

1
Document Ingestion & Classification
Stage, deduplicate by content, classify document type, identify the producer/template (broker ID), route by size tier.
2
Knowledge Structuring & Representation
AI discovery sweep → taxonomy → coverage mapping → controlled vocabulary (raw terms → canonical fields) → extraction schema with validation rules.
3
Data Architecture for Serving
Bronze/Silver/Gold tables, structured extraction into Silver, comparison views in Gold, chunk + embed for search, Cortex Search service.
4
Serving & Action
Semantic model for Cortex Analyst (text-to-SQL), wire Search + Analyst into a Cortex Agent, persona-specific interfaces tied to business questions.

Five phases — the repeatable process

PHASE 1
Single-doc deep dive
Zero-shot discovery on one representative doc. ~$0.10.
PHASE 2
Model comparison
Same doc, 2+ models (Claude vs Gemini) — quality × cost. ~$0.20.
PHASE 3
Corpus sweep
Batch AI_COMPLETE across all docs, error-resilient. ~$0.04/doc.
PHASE 4
Dedup & validate
Content dedup, coverage %, build controlled vocabulary. SQL only.
PHASE 5
Analysis snapshot
Constraints, normalization challenges, business-value mapping.
Core principle: discovery before extraction. Let AI tell you what's in the documents before designing the schema. Run zero-shot discovery, validate the ontology across the corpus, then design the canonical schema. YAML is the source of truth; HTML reports and database tables are downstream renders.

03 The document knowledge base

The proof the framework works — a proprietary, normalized database of practice economics that no competitor has. Built for ~$25 in AI inference.
99 → 67
files ingested → unique after dedup (29% dupes)
61
unique docs analyzed via AI_COMPLETE
12+
broker firms / dialects profiled
6
knowledge domains, consistent across all brokers

The core technical challenge: normalization

Every broker names the same metric differently — asking_price alone has 7 variants; revenue has 20+. 460 raw financial term keys collapse to ~25 canonical concepts. There's no industry standard, so normalization is handled at ingestion via a dual approach: AI_EXTRACT against a fixed canonical schema (primary), plus a controlled-vocabulary mapping table (audit trail + edge cases). Knowing that four differently-named price fields all mean the same thing is domain knowledge that took four phases of AI discovery to build — and it's encoded in YAML, not people's heads.

What discovery surfaced

InsightDetailDesign implication
3 size tiers83% of docs work with any model; 17% need a larger-context model or splitting (page/token limits)Ingestion needs a size router, not one model path
Concept > section extraction98% have financial data but only 89% have a "Financials" sectionAsk "find the asking price," never "find the Pricing section"
Uneven coverage is realUniversal fields 85%+, common 40–85%, sparse <40%Distinguish "not found" from "not applicable"; design products on Tier-1 fields
Dedup at ingestion29% of raw files were GUID-suffixed duplicatesContent hash + file size, never filename alone
Mixed document types76% prospectuses, 6% valuations, plus out-of-domain docsClassify first, route to corpus-specific extraction
A model comparison (Claude vs Gemini) was captured to a results table to choose the right model on quality × cost; the discovery corpus and source PDFs live in a directory-enabled document stage feeding the pipeline.

04 Strategy & productization

Turning the data asset into revenue — five products, each mapped to a persona and a way it pays for itself.
Data productAnswersFor
Credit Memo Auto-PopulateAuto-fill the credit memo from an uploaded prospectusUnderwriter
Practice Benchmarking Report"How does my practice compare? Am I overpaying?"Borrower, Loan Officer
Practice Intelligence SearchPlain-language search across the corpusLoan Officer, Exec
Market Pulse DashboardPortfolio stats, broker deal-qualityExec, Investor
Lending Performance Predictor"Default rate for practices priced above 1× revenue?"Investor

Why this compounds — in work like this the moat isn't the model. It's the proprietary corpus a business already receives through its own workflow, plus the institutional knowledge encoded around it (controlled vocabulary, source dialects). The highest-value layer is correlating that data with real outcomes — something only the operator of the workflow can do.

05 The AI-native build model

How the work itself was built — a two-agent operating model that pairs a general-purpose driver with a platform specialist.
Claude Code — the driver
General development, file editing, refactoring, orchestration, git, and all the HTML/Python/SQL tooling. Holds the guardrails and drives the reasoning.
Cortex Code — the platform specialist
50+ Snowflake-native skills (data-quality, lineage, cost-intelligence, agent, semantic-view, ML). Invoked by shelling out — direct subcommands when the action is known, prompted skills when reasoning is needed.

06 Cost & operations intelligence

Running AI in an account means watching what it costs. The work included a forensic cost analysis and reusable monitoring.

07 What this demonstrates

Capabilities exercised end-to-end across the engagement.
CapabilityEvidence
Applied GenAI in a live accountCortex Agent + Search + Analyst + Streamlit, all deployed and callable
Unstructured → structured pipelines67-doc corpus through discovery → normalization → extraction schema
Reusable methodology / IP4-layer, 5-phase Knowledge Discovery Framework, codified in YAML
Data-product strategy5 products mapped to 5 personas + a defensibility/moat narrative
Multi-agent orchestrationTwo-agent AI-native operating model with shared guardrails
AI cost governanceForensic cost analysis + reusable monitoring + best-practices guide
Model evaluationClaude vs Gemini A/B comparison captured to a results table

08 Stack & techniques

The tools and methods this case study drew on.
SnowflakeCortex AgentsCortex Search Cortex Analyst (semantic views)AI_COMPLETE / AI_EXTRACT / AI_CLASSIFY Streamlit-in-SnowflakeMedallion (Bronze/Silver/Gold) Controlled vocabulary / ontologyClaude CodeCortex Code Multi-agent orchestrationPythonSQLYAML-as-source-of-truth