Interpret Gene Ontology enrichment results with an agent in Snowflake

Tatsuya Koreeda gave a Cortex Code agent SQL access to RNA-seq results in Snowflake plus the OLS4 ontology MCP, and it ran the enrichment, looked up eight GO terms and wrote a sourced interpretation.

Done withCustom agent· Nov 5, 2026

What they did

Tatsuya Koreeda loaded differential expression results from the public airway RNA-seq dataset (999 genes changed by dexamethasone) into Snowflake and wrote a stored procedure for Gene Ontology enrichment that matched clusterProfiler on all 4,540 terms. He then built an agent with Snowflake's Cortex Code Agent SDK, limited to two tools: SQL against Snowflake and EMBL-EBI's OLS4 MCP server, which serves GO definitions and hierarchies. The system prompt told it to take numbers only from the enrichment procedure and definitions only from OLS4, and to label anything else as outside knowledge. He asked it once, in plain language, to run the enrichment for up and down genes and explain what the treatment did.

How it went

The agent ran the enrichment through SQL, then called OLS4 to look up eight GO terms, and answered in four parts: statistics, ontology meaning, interpretation as hypotheses, and limitations. The statistics matched the stored procedure. Because it read the hierarchy, it noticed that one extracellular matrix term and two of its parents came from the same 28 genes and were one finding, not three. He gives no figures on time or cost.

Worth knowing

Snowflake's built-in Cortex Agent MCP connector needs OAuth and cannot reach OLS4, which has no authentication, so he used the Agent SDK instead; the other route is a stored procedure calling the OLS4 REST API through an external access integration. Searching OLS4 by keyword returns child terms first, so look terms up by GO ID. This was a demo on a public dataset.

Try it

With Custom agent· 4 parts to fill in

You have read-only SQL access to [my warehouse and schema] and the OLS4 ontology MCP server. Take the significantly changed genes from [my differential expression table], run a Gene Ontology Biological Process enrichment with [my enrichment procedure], separately for up and down regulated genes. For the top [number] terms in each, look up the definition and parent terms by GO ID in OLS4. Answer in four parts: statistics (only from the procedure), ontology meaning (only from OLS4), interpretation as hypotheses to test, and limitations. Mark anything not from a tool as outside knowledge. Do not write to any table. Stop after the report.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related