GuidesSnowflake
An AI agent for Snowflake that lets the warehouse do the maths.
A warehouse is where a model summing rows by itself goes most wrong: the table is too large to read, so it reads a page and reports a total for the page. DeepORG has Snowflake compute every sum, count and ranking, and returns the result with the query that produced it.
The short version
What you get on Snowflake.
- The warehouse computes. Aggregates, grouping and ordering compile into the Snowflake statement. The model plans the query; it never adds up rows.
- Big catalogs, small prompts. Discovery pages through
SHOWresults, and the agent searches the catalog for the tables a question needs instead of reading every schema. - Warehouse plus app database. A question that needs Snowflake history and today’s rows from Postgres is one query; the engine runs each part where its data lives.
- Rules from the caller. Row filters and column lists are compiled into the statement, so an analyst’s agent sees what the analyst may see.
Connect
Key-pair sign-in, in config.
curl -fsSL https://deeporg.io/install.sh | bash# config/dev.yml
sources:
- name: warehouse
kind: database
type: snowflake
default: true
# user@account/database/schema?warehouse=compute_wh&account=account
connection_string: ${SNOWFLAKE_DSN}
private_key_path: ${SNOWFLAKE_KEY_PATH}
key_passphrase: ${SNOWFLAKE_KEY_PASSPHRASE}
read_only: true # start read-onlyKey-pair sign-in uses an RSA-2048 key in PKCS#8 form:
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pubRegister the public key with ALTER USER my_user SET RSA_PUBLIC_KEY='…'. Give that user a role that can read the schemas the agent should see and use one warehouse, sized for the questions you expect.
deeporg serveYour AI client
Add it to Claude Code or Codex.
claude mcp add deeporg -- deeporg mcp --path /absolute/path/to/config
codex mcp add deeporg -- deeporg mcp --path /absolute/path/to/configYour client’s model does the reasoning. To give a team one agent with a chat console and standing questions instead, run deeporg serve with a model key and see the built-in agent.
Across systems
Warehouse history, live app data, one question.
sources:
- name: app
kind: database
type: postgres
connection_string: ${DATABASE_URL}
- name: warehouse
kind: database
type: snowflake
connection_string: ${SNOWFLAKE_DSN}
private_key_path: ${SNOWFLAKE_KEY_PATH}
relationships:
- from: warehouse.account_revenue.account_id
to: app.accounts.id
as: accountNow “revenue last year for every account with an open support ticket” is one query. Snowflake computes the revenue, Postgres finds the accounts, and the engine joins the two.
Limits
Where Snowflake differs.
- No live subscriptions. Standing questions that poll for changes are for operational databases; a warehouse query on a timer is a cost you should choose on purpose.
- Declared keys are hints. Snowflake does not enforce foreign keys, and many warehouses declare none. Name the joins the agent should follow in config.
- No full-text or geo filters through the query language.
- Every query uses your warehouse. It resumes if suspended and bills as usual. Aggregates keep results small, but the scan is Snowflake’s.
Go deeper
Related pages.
- BigQuery AI agent: the same idea on Google’s warehouse.
- Multiple databases: how a cross-database query runs.
- Answers with evidence: why the database computes and the model does not.
- Database config: Snowflake options in full.