Snowflake-Labs/sfguide-Snowflake-Asset-Management-with-Cortex-AI
Jupyter Notebook
Captured source
source ↗Snowflake-Labs/sfguide-Snowflake-Asset-Management-with-Cortex-AI
Language: Jupyter Notebook
License: MIT
Stars: 7
Forks: 11
Open issues: 0
Created: 2025-09-11T19:55:12Z
Pushed: 2025-12-04T17:52:24Z
Default branch: main
Fork: no
Archived: no
README:
🏔️ Snowflake Asset Management AI Transformation
🎯 Objective: Build a comprehensive AI-powered asset management system that combines document search, portfolio analytics, and intelligent assistance capabilities.
This demo provides detailed step-by-step instructions for setting up a sophisticated Asset Management AI demo in Snowflake, featuring:
- 🔍 Cortex Search - Intelligent document search and retrieval
- 📊 Cortex Analyst - Advanced portfolio data analysis
- 🖥️ Streamlit Integration - Interactive web application
- 🤖 Snowflake Intelligence - AI agent with advanced portfolio analysis and document search
🚀 What You'll Build
By the end of this setup, you'll have a fully functional AI system that can:
✅ Search through research documents using natural language ✅ Analyze portfolio data with conversational queries ✅ Provide intelligent recommendations combining both data sources ✅ Deliver insights through an intuitive web interface
📋 Repository Structure
├── README.md # This comprehensive guide ├── LEGAL.md # Legal notices ├── LICENSE # License information ├── notebooks/ # Snowflake Notebooks │ ├── environment.yml # Python package dependencies │ └── 0_start_here.ipynb # Main setup notebook for Cortex Search ├── scripts/ # SQL and configuration files │ ├── setup.sql # Database and schema setup script │ └── semantic_models/ # Sample semantic models for Cortex Analyst │ └── PORTFOLIO_ANALYSIS.yaml # yaml model for Cortex Analyst │ └── generated_pdfs/ # Sample research documents │ └── *.pdf # PDF research documents for demo └── streamlit/ # Streamlit application ├── app.py # Streamlit dashboard code
📋 Prerequisites
🔑 Required Access & Permissions
☑️ Snowflake account with appropriate privileges ☑️ SQL execution permissions ☑️ Ability to create databases, schemas, and stages ☑️ Access to Snowflake Notebooks ☑️ Access to Snowflake Intelligence features ☑️ Cross Region Cortex Inference enabled (if required for your region)
📁 Required Demo Files
Ensure you have all the following files ready:
| File Type | Description | Location | Usage | |-----------|-------------|----------|-------| | 📄 SQL setup script | Database and schema creation | scripts/setup.sql | Step 1 | | 📚 PDF documents | Sample research documents (download first) | scripts/generated_pdfs/ folder | Step 2 & 3 | | 📓 Jupyter notebook | Cortex Search setup and processing (download first) | notebooks/0_start_here.ipynb | Step 2 & 4 | | 📊 Cortex Analyst | Portfolio analysis semantic model | scripts/PORTFOLIO_ANALYSIS.yaml | Step 5 | | 🤖 Snowflake Intelligence | AI agent configuration and testing | Step 6 | Step 6 | | 🖥️ Streamlit app | Interactive dashboard code | streamlit/app.py | Step 7 |
---
🏗️ Setup Instructions
1️⃣ Step 1: Execute SQL Setup Statements
1.1 Access Snowsight and Open Worksheets
1. Open Snowflake in your web browser (Snowsight interface) 2. Navigate to Projects → Worksheets in the left sidebar 3. Click + Worksheet to create a new SQL worksheet
1.2 Import and Execute the Setup Script
1. Locate the scripts/setup.sql file from this repository 2. Open the file and copy all contents 3. Paste the SQL statements into your new Snowflake worksheet 4. Important: The script uses accountadmin role for initial setup 5. Execute all statements by clicking ▶ Run All or pressing Ctrl+Shift+Enter
1.3 What the Setup Script Creates
The enhanced setup.sql script will automatically create:
Security & Access:
- Role:
asset_management_ai_rolewith Cortex and Streamlit capabilities - Warehouse:
asset_management_ai_wh(Small, auto-suspend after 60 seconds) - Grants: Comprehensive permissions for AI services and data access
Data Infrastructure:
- Database:
ASSET_MANAGEMENT_AI - Schema:
RESEARCH_ANALYTICS - Stage:
RESEARCH_DOCSinternal stage (with encryption enabled) - Table:
PORTFOLIO_HOLDINGSwith sample portfolio data - Sample Data: 13 portfolio holdings across Technology, Healthcare, ESG, Real Estate, and Utilities sectors
Snowflake Intelligence Setup:
- Database:
snowflake_intelligencefor AI agent storage - Schema:
snowflake_intelligence.agentsfor agent management - Permissions: CREATE AGENT privileges for the demo role
Note: If you continue with accountadmin, that's fine too - the setup script grants all necessary permissions to both roles.
---
2️⃣ Step 2: Download Demo Files
2.1 Download the Notebook
1. Navigate to the notebooks/ folder in this repository 2. Download the notebook file: 0_start_here.ipynb
- Click on the file in GitHub
- Click the Download button
- Alternative: Clone the entire repository to get all files locally
3. Note the location where you saved the notebook file for Step 4
2.2 Download Research Documents
1. Navigate to the scripts/generated_pdfs/ folder in this repository 2. Download all PDF files individually or clone the repository to get them locally 3. Ensure you have all 8 research documents downloaded:
- NovaTech Insights - Technology Sector Overview.pdf
- NovaTech Insights - Emerging Markets.pdf
- NovaTech Insights - ESG Trends.pdf
- Gaming Industry Trends in 2025.pdf
- FinTech Innovation Investment Opportunities.pdf
- Dissertation on the Utility Sector.pdf
- Stellar Motors Inc. - 10-K Annual Report.pdf
- SNOW_2025.pdf
---
3️⃣ Step 3: Upload Research Documents
3.1 Locate Your Downloaded Research Documents
1. Find the downloaded PDF files from Step 2.2 on your local machine 2. These documents are specifically chosen to match the portfolio holdings created in Step 1 3. Document types include:
- Technology Sector Analysis: NovaTech Insights - Technology Sector Overview.pdf
- Emerging Markets Research: NovaTech Insights - Emerging Markets.pdf
- ESG/Sustainability Analysis: NovaTech Insights - ESG Trends.pdf
- Gaming Industry Trends: Gaming Industry Trends in 2025.pdf
- FinTech Investment Research: FinTech Innovation Investment Opportunities.pdf
- **Utility Sector...
Excerpt shown — open the source for the full document.