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.
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.
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_COMPLETEAI_EXTRACTAI_PARSE_DOCUMENTAI_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.
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
Insight
Detail
Design implication
3 size tiers
83% 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 extraction
98% have financial data but only 89% have a "Financials" section
Ask "find the asking price," never "find the Pricing section"
Uneven coverage is real
Universal fields 85%+, common 40–85%, sparse <40%
Distinguish "not found" from "not applicable"; design products on Tier-1 fields
Dedup at ingestion
29% of raw files were GUID-suffixed duplicates
Content hash + file size, never filename alone
Mixed document types
76% prospectuses, 6% valuations, plus out-of-domain docs
Classify 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 product
Answers
For
Credit Memo Auto-Populate
Auto-fill the credit memo from an uploaded prospectus
Underwriter
Practice Benchmarking Report
"How does my practice compare? Am I overpaying?"
Borrower, Loan Officer
Practice Intelligence Search
Plain-language search across the corpus
Loan Officer, Exec
Market Pulse Dashboard
Portfolio stats, broker deal-quality
Exec, 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.
Delegation is shell-out. Direct subcommands for known actions (no extra LLM call); prompted invocations to let the specialist's model drive a skill.
Shared guardrails. Both agents read one guardrails file — read-only default, prod protection, per-statement confirmation for DDL/DML.
Stateless bridging. A handoff log carries last-action / next-action / open-questions between agents and sessions.
Isolation. One git worktree per parallel stream so the two agents don't collide.
06 Cost & operations intelligence
Running AI in an account means watching what it costs. The work included a forensic cost analysis and reusable monitoring.
Cost analysis — a 14-day forensic reconstruction of AI/Cortex usage that identified the delegation loop between the two agents as the primary cost driver (74% of peak-day CLI spend), then tuned it.
Reusable monitoring — a set of ACCOUNT_USAGE queries plus a daily-email variant for ongoing cost visibility.
Team best-practices guide — how to keep the AI-native workflow efficient.
Economics — discovery + analysis ran ~$25; a complete knowledge base was projected at ~$85 in AI inference. The framework itself lowers the cost of the next corpus.
07 What this demonstrates
Capabilities exercised end-to-end across the engagement.
Capability
Evidence
Applied GenAI in a live account
Cortex Agent + Search + Analyst + Streamlit, all deployed and callable
Unstructured → structured pipelines
67-doc corpus through discovery → normalization → extraction schema
Reusable methodology / IP
4-layer, 5-phase Knowledge Discovery Framework, codified in YAML
Data-product strategy
5 products mapped to 5 personas + a defensibility/moat narrative
Multi-agent orchestration
Two-agent AI-native operating model with shared guardrails