Project-specific skill for Cortex Financial Agents demo. Dual-tool Intelligence agent combining Cortex Analyst (structured facility/covenant data) with Cortex Search RAG (credit memos, legal docs). Use when working with this project in any AI-pair tool.
Demonstrates a conversational Intelligence agent for specialty finance portfolio risk assessment, combining structured facility/covenant analytics (Cortex Analyst via semantic view) with unstructured document retrieval (Cortex Search RAG with citations).
RAW_BORROWERS ──┐
RAW_FACILITIES ─┤── SV_FINANCIAL_PORTFOLIO ──┐
RAW_COVENANTS ──┤ (Cortex Analyst) ├── PORTFOLIO_RISK_AGENT
RAW_PORTFOLIO ┘ │
_METRICS │
│
documents/*.pdf ─── COPY FILES ─── @DOC_STAGE│
│ │
RAW_DOCUMENTS ──┬── text content ────┤ │
└── GET_PRESIGNED_URL┘ │
FACILITY_DOCUMENT_SEARCH ─┘
(Cortex Search RAG + clickable citations)
| File | Role |
|---|
deploy_all.sql | Single entry point for Snowsight deployment |
sql/01_setup/01_create_schema.sql | Schema and warehouse creation |
sql/02_data/01_create_tables.sql | All table DDL |
sql/02_data/02-06_load_*.sql | Synthetic data inserts (borrowers, facilities, covenants, metrics, documents) |
sql/02_data/07_stage_documents.sql | Creates @DOC_STAGE, copies PDFs from git, enables directory table |
documents/*.pdf | 40 professional PDF documents generated from synthetic content |
scripts/generate_pdfs.py | Local helper to regenerate PDFs from SQL content (requires fpdf2) |
sql/03_search/01_create_search_service.sql | Cortex Search service with GET_PRESIGNED_URL for clickable citations |
sql/04_cortex/01_create_semantic_view.sql | Semantic view across 4 structured tables |
sql/04_cortex/02_create_agent.sql | Dual-tool Intelligence agent |
RAW_DOCUMENTS with a new doc_type value (e.g., 'workout_memo')06_load_documents.sql, then run python scripts/generate_pdfs.pydocuments/ so it deploys via the git stageCOPY FILES step stages the new PDF and the search service auto-refreshesDocumentSearch tool description in 02_create_agent.sql to mention the new typedoc_type filter example in the agent's sample_questionssql/02_data/01_create_tables.sql with COMMENT including expirationsql/02_data/0N_load_*.sql filesql/04_cortex/01_create_semantic_view.sql:
deploy_all.sqlSNOWFLAKE_EXAMPLEFINANCIAL_AGENTSSFE_FINANCIAL_AGENTS_WHRAW_BORROWERS, RAW_FACILITIES, RAW_COVENANTS, RAW_PORTFOLIO_METRICS, RAW_DOCUMENTSDOC_STAGE (internal, SSE encrypted, directory table enabled)FACILITY_DOCUMENT_SEARCHSNOWFLAKE_EXAMPLE.SEMANTIC_MODELS.SV_FINANCIAL_PORTFOLIOPORTFOLIO_RISK_AGENTCOMMENT = 'DEMO: ... (Expires: 2026-04-09)'SEMANTIC_MODELS schema, not FINANCIAL_AGENTS -- agent references the fully qualified pathorchestration: auto (no pinned model) for cross-region portabilitycontent column must be VARCHAR, not VARIANT -- Cortex Search indexes text columns onlyin_compliance is BOOLEAN but the semantic view exposes it as a dimension for filtering; the agent handles the casttitle_column: "source_url" in the agent spec is what makes citations clickable -- setting it to "title" would break citationsGET_PRESIGNED_URL in the search service source query generates 7-day URLs; the hourly refresh keeps them fresh@DOC_STAGE must use ENCRYPTION = (TYPE = 'SNOWFLAKE_SSE') for presigned URLs to work on internal stages@DOC_STAGE BEFORE the search service is created (deploy order matters)