Building a RAG Chatbot on Snowflake
A Presentation & Publishing Guide
(https://github.com/rohitashaug31-beep/sfcbt)
A hands-on walkthrough of turning PDFs into a question-answering chatbot entirely inside Snowflake — no separate vector database and no external ML code.
A Snowflake account (free trial).
Register at the official signup page: https://signup.snowflake.com/
The trial gives $400 of free credits, valid for 30 days — no credit card required to sign up.
At signup choose: Edition = Enterprise, Cloud = AWS, Region = a US region (e.g. US West – Oregon or US East – N. Virginia). This is the most important choice — not every region supports the Cortex AI features.
Two documents (PDFs). Any PDFs work; digital-native (text-based) PDFs parse most cleanly.
That's it. Compute, storage, parsing, embeddings, the LLM, and app hosting are all provided by Snowflake.
Answer
Do I need a card to sign up?
No. The trial is cardless.
Do I need a card to use the AI (Cortex) features?
Yes. Snowflake gates Cortex AI (parsing, embeddings, LLM answers) behind a payment method. Without a card you'll see "COMPLETE is not available for trial accounts."
Does adding a card mean I get charged?
Not immediately. Your $400 free credits are spent first; you're billed only once they run out.
What's the real cost of this demo?
About $2 of the $400. Effectively free.
Free / low-cost model options (once Cortex is unlocked):
llama3.1-8b — smallest and cheapest; ideal for a first "hello world" test.
llama3.1-70b — strong answer quality; the recommended default.
mistral-large2 — good alternative.
claude-3-5-sonnet — excellent, but region-dependent (not enabled everywhere).
All are billed per token from free credits — pennies for a demo.
Avoiding a card entirely: you would replace Snowflake's Cortex generation with an external free LLM API — but that breaks the "everything inside Snowflake" story, which is the point of the demo. For a clean Snowflake-native session, add the card (it stays effectively free).
The universal 6-stage RAG pipeline, and the Snowflake tool for each stage:
Stage
What it does
Snowflake tool
1. Store
Hold the raw PDFs
Internal stage
2. Parse
Extract text from PDFs
AI_PARSE_DOCUMENT
3. Chunk
Break text into retrievable pieces
SPLIT_TEXT_RECURSIVE_CHARACTER
4. Embed + index
Turn chunks into vectors, build search
Cortex Search service
5. Retrieve + generate
Find relevant chunks, write an answer
SEARCH_PREVIEW + COMPLETE
6. Host
Give it a chat UI
Streamlit in Snowflake
Key concept to land: Snowflake separates storage (your data), compute (warehouses that run queries), and security (roles). Every step needs all three.
5 min — What is RAG? (the 6 stages)
5 min — Prerequisites + signup + the card/model note
20 min — Live build (Steps 0–5)
8 min — Streamlit app + live Q&A demo
5 min — Cost dashboard + gotchas
2 min — Takeaways