<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Caleb Alexander on Medium]]></title>
        <description><![CDATA[Stories by Caleb Alexander on Medium]]></description>
        <link>https://medium.com/@caleb.alexander?source=rss-11ae3182d233------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AQDz9qZL1ha0sT7Db3pynA.png</url>
            <title>Stories by Caleb Alexander on Medium</title>
            <link>https://medium.com/@caleb.alexander?source=rss-11ae3182d233------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 10:17:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@caleb.alexander/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cortex, Claude, or Both? A Practical Guide to Choosing the Right Architecture]]></title>
            <link>https://medium.com/@caleb.alexander/cortex-claude-or-both-a-practical-guide-to-choosing-the-right-architecture-f3f98068a49f?source=rss-11ae3182d233------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3f98068a49f</guid>
            <category><![CDATA[snowflake-cortex]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Caleb Alexander]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 14:20:46 GMT</pubDate>
            <atom:updated>2026-10-12T14:28:06.372Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>A field guide to orchestration, governance, and Snowflake integration patterns.</em></h4><p><strong><em>This is Part III of my Snowflake Cortex MCP Series.</em></strong></p><p>You figured out access. REST for your backend pipelines. MCP for your AI clients. Your first Cortex agent is running. Then someone on the team asks the one question nobody prepared for:</p><p><em>“When this breaks, whose job is it to fix it?”</em></p><p>That sounds like an operations question — but it’s an architecture question.</p><p>Every agent deployment makes an implicit decision about where responsibility lives in the loop: who governs the data, who manages the reasoning, and who controls the tool calls. Most teams skip that decision. They find out where the line was during an incident.</p><p>This article draws that line before that happens.</p><h3>A Concept Worth Borrowing</h3><p>Cloud architecture has a useful precedent: <a href="https://aws.amazon.com/compliance/shared-responsibility-model/">the AWS Shared Responsibility Model</a>. The simple idea is that AWS owns security of the cloud, including infrastructure, hardware, and virtualization. You own security in the cloud, including your data, configurations, and access controls.</p><p>The value of the model is not that it eliminates responsibility. It makes the boundary explicit, so teams can design and operate against it.</p><p>The same logic applies to agent architecture, but the boundary is about orchestration and data access rather than security alone. Every deployment should make clear who owns the reasoning loop, the tool calls, the access decision, and the response. The four patterns below draw that boundary in different places. In these patterns, the external LLM could be Claude or any other model.</p><h3>The Four Patterns at a Glance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5O768dwBmPkw3zjjfWaDIQ.png" /><figcaption><em>Four agent architecture patterns, from Snowflake-managed orchestration to application-owned orchestration.</em></figcaption></figure><h3>Pattern 1: Cortex Agent End-to-End</h3><p>The entire orchestration loop runs through a Snowflake Cortex Agent. The agent plans the request, selects its configured tools, executes them, and generates the response. Snowflake manages the agent’s orchestration, tool configuration, and data access through Snowflake roles and privileges. Agent runs, tool calls, and responses can be reviewed through the monitoring and thread capabilities available for Cortex Agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q4ejvds320pdqqn4t0jcDA.png" /><figcaption><em>Cortex Agent end-to-end: Snowflake manages the orchestration loop, tool selection, execution, and data access.</em></figcaption></figure><p>You configure the agent. Snowflake runs the agent. This pattern keeps the orchestration loop and Snowflake data access in the Snowflake-managed agent layer.</p><p><strong>Best fit:</strong> Regulated industries and teams that need centralized monitoring, strong governance controls, and clearly defined data access.</p><p><strong><em>Example:</em></strong><em> A healthcare organization analyzing patient cohorts in Snowflake, with data access controlled through Snowflake roles and the organization’s own compliance controls.</em></p><p><strong>When it breaks:</strong> Snowflake-side agent configuration and RBAC are owned by the data platform team.</p><h3>Pattern 2: External LLM with Cortex Agent Handoff</h3><p>The external LLM handles the user-facing reasoning and external context. It delegates Snowflake data operations to a Cortex Agent through an application-controlled integration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Q_ti32ptxetr71o9WpC0w.png" /><figcaption><em>External LLM with Cortex Agent handoff: the application decides when to hand off, while Snowflake governs agent execution and data access.</em></figcaption></figure><p>The external LLM owns intent and external context. The application decides when to hand off. Snowflake owns the Cortex Agent’s execution, tool access, and data permissions. Instruction files can provide routing guidance, but the handoff must be enforced through application logic, Snowflake roles, and tool permissions.</p><p><strong>Best fit:</strong> Teams that need external LLM reasoning for complex orchestration but need Snowflake RBAC to govern what actually runs against their data.</p><p><strong><em>Example:</em></strong><em> A financial services application where an external LLM reasons about market conditions and portfolio strategy, then delegates customer account queries to a Cortex Agent under Snowflake access controls.</em></p><p><strong>When it breaks:</strong> Handoff logic is owned by the application team. Cortex Agent configuration and data access are owned by the data platform team.</p><h3>Pattern 3: External LLM with Snowflake-Managed MCP</h3><p>The external LLM is the client. Snowflake’s managed MCP server exposes the Snowflake tools or Cortex Agent that the client is authorized to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RkmJXutTJOa7YYvEZleFQ.png" /><figcaption><em>External LLM with Snowflake-managed MCP: the AI client connects directly to a governed Snowflake entry point.</em></figcaption></figure><p>Unlike Pattern 2, the application does not decide when to hand off to a Cortex Agent. The AI client connects directly to the governed MCP endpoint and chooses from the tools or agents that Snowflake exposes. MCP is more than a connection method. It is a governed tool surface: administrators decide which tools or agents are exposed, and access to the MCP server does not automatically grant access to every underlying capability. The external client remains responsible for its user experience and any external context it adds.</p><p><strong>Best fit:</strong> Organizations standardizing access to Snowflake across multiple AI clients, where consistent governance matters more than any single client’s implementation.</p><p><strong><em>Example:</em></strong><em> A large enterprise with multiple business units using different AI clients to access the same governed semantic layer through Snowflake-managed MCP. The organization standardizes the MCP entry point, access controls, and operational procedures across teams.</em></p><p><strong>When it breaks:</strong> Client behavior and user experience are owned by the application or AI platform team. MCP endpoint governance and Snowflake access are owned by the data platform team.</p><h3>Pattern 4: External Orchestrator with Cortex REST API</h3><p>An external application owns the orchestration loop. It manages the LLM context, decides when to call Snowflake, invokes the Cortex REST API, and determines how to use the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnS7gO9iXDYp6hTAS-pyEw.png" /><figcaption><em>External orchestrator with Cortex REST API: the application owns context, routing, tool selection, failures, and response handling.</em></figcaption></figure><p>Responsibility shifts to the application owner. The external application is accountable for how the LLM interprets requests, manages context, selects tools, handles failures, and uses the response. Snowflake governs the API request through authentication, roles, and privileges.</p><p>This pattern can add application, context, and network overhead. Measure the actual cost and latency for the workload.</p><p><strong>Best fit:</strong> Teams that need a custom user experience, application-specific routing, or direct control over the request and response lifecycle.</p><p><strong><em>Example:</em></strong><em> A custom customer-facing analytics application or an embedded copilot in a SaaS product uses an external orchestrator to combine product context, customer permissions, and Snowflake data through the Cortex REST API.</em></p><p><strong>When it breaks:</strong> Orchestration, routing, failure handling, and user experience are owned by the application team. Snowflake owns API-side authentication and data access controls.</p><h3>Two Questions to Route, One to Validate</h3><p>The choice usually comes down to two routing questions and one production validation step.</p><h3>1. Where does the orchestration loop run?</h3><ul><li>If Snowflake owns the orchestration loop, use a Cortex Agent.</li><li>If the external application owns the orchestration loop, use the Cortex REST API or another explicitly designed integration.</li><li>If both participate, document the handoff, permissions, and failure boundary.</li></ul><h3>2. How does the client need to connect?</h3><ul><li>Use Snowflake-managed MCP when an external AI client needs a discoverable, governed interface to Snowflake tools or Cortex Agents.</li><li>Use the Cortex REST API when an application needs direct control over the request and response lifecycle.</li></ul><h3>3. What must be validated before production?</h3><p>Confirm the supported client, authentication flow, role mapping, tool exposure, logging, latency, cost, and failure handling before going to production.</p><h3>The Full Stack</h3><p><a href="https://medium.com/@caleb.alexander/snowflake-cortex-mcp-server-architecture-a-technical-deep-dive-8a4264c2bce1">Part I</a> gave you the architecture of Snowflake’s MCP layer.</p><p><a href="https://medium.com/@caleb.alexander/cortex-rest-api-vs-mcp-server-when-to-use-each-when-to-use-both-a172ff91ae1e">Part II</a> gave you the access pattern decision: REST for point integrations, MCP for platforms.</p><p>Part III gives you the accountability boundary: who owns the orchestration loop, and what that means for governance, cost, and operational clarity.</p><p>These three decisions, made deliberately, are the difference between an agent that works in a demo and one that runs in production.</p><p>If you missed Part I or Part II, see the related articles below. The architecture is easier to evaluate when the access path, orchestration owner, and accountability boundary are considered together.</p><ul><li><a href="https://medium.com/@caleb.alexander/snowflake-cortex-mcp-server-architecture-a-technical-deep-dive-8a4264c2bce1">Part I: Snowflake Cortex MCP Server Architecture: A Technical Deep Dive</a></li><li><a href="https://medium.com/@caleb.alexander/cortex-rest-api-vs-mcp-server-when-to-use-each-when-to-use-both-a172ff91ae1e">Part II: Cortex REST API vs. MCP Server: When to Use Each, When to Use Both</a></li></ul><p><em>Questions or pushback? Drop them in the comments. The model above is a starting point, not a verdict. Your production constraints are the real input.</em></p><p><em>This framework is based on field experience and does not represent official Snowflake documentation or product direction. Product names, availability, and capabilities change, so verify implementation details against the current documentation before implementing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3f98068a49f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cortex REST API vs. MCP Server: When to Use Each, When to Use Both]]></title>
            <link>https://medium.com/@caleb.alexander/cortex-rest-api-vs-mcp-server-when-to-use-each-when-to-use-both-a172ff91ae1e?source=rss-11ae3182d233------2</link>
            <guid isPermaLink="false">https://medium.com/p/a172ff91ae1e</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Caleb Alexander]]></dc:creator>
            <pubDate>Thu, 28 May 2026 17:23:46 GMT</pubDate>
            <atom:updated>2026-09-11T10:50:56.133Z</atom:updated>
            <content:encoded><![CDATA[<h4>Clearing up the most common point of confusion in Cortex Agent deployments.</h4><h4><em>This is a Part II of my Snowflake Cortex MCP Series</em></h4><p>Every week, someone asks me some version of the same question:</p><blockquote>“We already have the REST API working — do we need MCP too, or is that just another way to do the same thing?”</blockquote><p>It’s a fair question.</p><p>Both paths can access the same core Cortex services: Cortex Analyst, Cortex Search, Cortex Agents, and SQL execution. The REST API and MCP Server are not two isolated systems with different capabilities. The real decision is about access pattern, governance model, and client type. Pick the wrong one for the wrong situation and you are building technical debt that shows up at the worst possible time.</p><p>The cleaner question is this:<br><strong>Are you building a point integration, or a platform?</strong></p><p>That is the decision. Everything else follows from there.</p><h3>The Mental Model: A Building with Two Ways In</h3><p>Think of Snowflake as a building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMx42VzxpjquKrBhUh7x4w.png" /></figure><p>Inside that building are rooms that do powerful things: Cortex Analyst, Cortex Search, Cortex Agents, and SQL execution. The question is not what is inside — the question is how you control who gets in and what they can do once they are in.</p><p>There are two ways in to the building:</p><ol><li>The REST API is a <strong>keycard</strong>. You have a keycard that opens a specific door. Fast, direct, no overhead. If you know exactly which room you need and the system on the other end is trusted, it works perfectly. There are no session governance layers, no tool-scoped access control, and no structured point-of-access record of which capability was called or what was returned.</li></ol><p>Snowflake does capture REST API usage in account usage views, but that is monitoring after the fact, not governance at the point of access. You just go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nys7cgYckYqIOpOhE6hPtg.png" /><figcaption>The REST API is a <strong>keycard.</strong></figcaption></figure><p>2. The MCP Server is the <strong>security desk in the lobby</strong>. Everyone who enters the building checks in here. The desk validates identity, logs the visit, hands out a badge scoped to the floors the user is authorized for, and routes them to the right elevator. It does not matter if the caller is an internal analyst, an AI assistant, or an external partner — the process is the same and the controls are consistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvXEqLd5rmcHMpYDdysKvA.png" /><figcaption>The MCP Server is the <strong>security desk in the lobby</strong></figcaption></figure><p><strong><em>The keycard and the security desk are not in competition. </em></strong>They exist in the same building at the same time. The keycard is for people who already belong in the building and know exactly where they are going. The security desk is for when you have many different people, with different access levels, coming and going every day — and you need to know exactly who went where.</p><p><em>The managed MCP server is GA.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbxbeVBdCLBG7wK2q2Ah6Q.png" /></figure><h3>When to Use the REST API</h3><p>The REST API is the right choice when you are a developer building a known integration for a known workload and you control both ends of the connection.</p><p>Good fits:</p><ul><li>A backend pipeline that calls Cortex inference on a schedule</li><li>A single trusted service account calling Snowflake for your application</li><li>High-volume batch workloads where latency and throughput are the primary constraints</li><li>Internal tooling where one system is calling one endpoint and that is not going to change</li></ul><p>The signal is simple:<br><strong>One system, one purpose, trusted authentication already in place.</strong></p><p>Snowflake’s REST API also supports <strong>server-sent events (SSE) </strong>for streaming responses. That matters for interactive low-latency use cases where real-time delivery is a requirement and you do not need a managed access layer on top of it.</p><p>What the REST API does not give you is <strong>tool discovery, session management, or centralized access control.</strong> For point integrations, you do not need those things. For platforms, you do.</p><h3>When to USE MCP</h3><p>MCP earns its place the moment your use case stops being a point integration and starts being a platform.</p><p>Good fits:</p><ul><li>AI assistants like Claude, Cursor, or ChatGPT connecting to Snowflake</li><li>Multiple teams sharing access to the same semantic view</li><li>External partners who need scoped, auditable access to specific data</li><li>Any regulated environment where you need a log of who called what tool, and when</li><li>Scenarios where clients need to discover what tools are available before they can call anything</li></ul><p>The signal is this:<br><strong>Multiple clients, varying access levels, or AI tools that need to understand the available capabilities before they can reason about how to use them.</strong></p><p>That last point matters more than most people realize. An AI client cannot walk up to a door and tap a keycard because it doesn’t know which door to go to. It needs to ask what is available and get a structured answer. The REST API does not.</p><p>A few governance specifics are worth knowing in practice:</p><ul><li>MCP provides governed, discoverable access built around <strong>Snowflake RBAC</strong> and <strong>OAuth sessions behavior</strong>.</li><li><strong>USAGE</strong> on the MCP is required, but it does not automatically grant access to underlying tools</li><li>Access to the underlying tools is controlled separately</li><li>• The session defaults to the user’s <strong>DEFAULT_ROLE</strong>. Override with OAUTH_SCOPES_SUPPORTED. Claude ignores this and always uses DEFAULT_ROLE.</li><li><strong>Secondary roles</strong> work via OAUTH_USE_SECONDARY_ROLES = IMPLICIT. Snowflake recommends NONE. In-session switching with USE SECONDARY ROLES is what’s unsupported.</li><li>Clients discover available tools through the MCP endpoint itself, which is why an AI client like Claude can connect cold and immediately understand what capabilities are exposed without custom integration code</li><li>Cortex Analyst over MCP requires semantic views. Semantic models don’t work.</li><li>Expose a Cortex Agent as the only client-facing tool. Keep SYSTEM_EXECUTE_SQL on a separate server, or clients bypass your semantic views and verified queries.</li></ul><h3>When to Use Both</h3><p>This is the standard enterprise pattern, not the exception.</p><p>Most mature Snowflake deployments end up here. Understanding the shape of it early changes how you design from day one.</p><h4>Scenario: The Analyst Platform</h4><p>Your data engineer team calls Cortex directly via the REST API for high-volume inference pipelines.</p><p>Meanwhile, your business analysts connect through Claude Desktop, which talks to a Cortex Agent over MCP. The MCP Server governs their access, enforces role-based controls, and logs every request.</p><p>Same underlying data. Same Snowflake platform. Two access patterns layered appropriately.</p><h4>Scenario: Multi-Team Access</h4><p>Ten teams need natural language access to the same data warehouse.</p><p>Instead of each team building under their own Cortex integration, you expose a Shared MCP Server backed by a governed semantic view. Every team connects through one entry point. Access is scoped at the individual tool level. Cost visibility improves because usage flows through a consistent, observable layer.</p><p>One semantic view. Ten teams. No duplicated integration work.</p><h3>Where MCP is Not the Right Fit</h3><p>MCP is not the better option in every scenario, and that is worth saying clearly because the hype cycle does not always say it.</p><p>Custom Slack and Teams integrations are a useful current example of where this plays out. <a href="https://www.snowflake.com/en/developers/guides/integrate-snowflake-cortex-agents-with-microsoft-teams/">Snowflake has Teams integration docs</a>, and MCP Connectors for external tools, and that picture is evolving. But for custom bots and real-time collaboration surfaces where streaming UX matters and latency is visible to the user, direct REST calls currently give you more control and better behavior.</p><p><em>Update</em>: since August 2026, MCP streams tool responses over SSE, so the streaming gap is closed. MCP still adds state-management complexity, so REST is still simpler for a single-purpose bot. But streaming is no longer the reason.</p><p><em>Note: as of August 20, 2026, the Snowflake-managed MCP server returns tool call responses as a Server-Sent Events stream rather than a single JSON body, so the streaming gap that used to make REST the obvious choice here has closed. Clients need to list both content types in the Accept header. MCP can still add state-management complexity in these environments, so REST remains a reasonable starting point for a simple single-purpose bot, but streaming is no longer the deciding factor.</em></p><p>The same logic holds for any tightly controlled, single-purpose integration where you own both sides, the client is trusted, and there is no governance requirement. MCP in that context is over-engineering.</p><p>MCP earns its complexity cost when you have multiple users, multiple clients, or governance requirements you need to enforce consistently. If those conditions are not present, the REST API is the cleaner answer.</p><h3>The Decision Framework</h3><p>Use <strong>REST</strong> when you are building a point integration for a known workload. One system, one purpose, you own both ends.</p><p>Use <strong>MCP</strong> when you are building a platform that other users, teams, or AI tools will connect to, and governance, discoverability, and audit logging need to be built in from the start.</p><p>Use <strong>BOTH</strong> when you have backend services that need direct, efficient access alongside end users or AI clients that need a governed entry point. This is the standard enterprise pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5ums7-2ITSrfmW9JMoeOw.png" /><figcaption>The Decision Framework</figcaption></figure><h3>The Mistake Worth Avoiding</h3><p>Treating this as an either/or decision and then discovering six months later that a REST-only architecture does not scale to the number of users and tools you now need to support.</p><p>Starting with MCP when you have one backend service is over-engineering. Skipping MCP entirely when you are clearly building toward a shared platform is the kind of decision that creates real work later.</p><p>The right question is not which one you pick. It is which one fits each access pattern in your system — and whether you are building a point integration or a platform that other people will depend on.</p><p>TL;DR</p><p>Caleb, that was too many words — give it to me straight:</p><ul><li><strong>REST API </strong>for direct, trusted, high-throughput integrations where you control both ends</li><li><strong>MCP</strong> when you are building a platform that other users or AI tools will connect to and governance matters</li><li><strong>Most mature deployments use both</strong>, layered for different access patterns on top of the same Snowflake platform.</li></ul><p>I hope this helped — please reach out if you have any questions or comments!</p><p>If you missed Part I, it covers the full MCP Server architecture including the Gateway, Tool Routing, and Cortex Services layers: <a href="https://medium.com/@caleb.alexander/snowflake-cortex-mcp-server-architecture-a-technical-deep-dive-8a4264c2bce1?postPublishedType=repub"><strong>Snowflake Cortex MCP Server Architecture: A Technical Deep Dive</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a172ff91ae1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex MCP Server Architecture: A Technical Deep Dive]]></title>
            <link>https://medium.com/@caleb.alexander/snowflake-cortex-mcp-server-architecture-a-technical-deep-dive-8a4264c2bce1?source=rss-11ae3182d233------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a4264c2bce1</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Caleb Alexander]]></dc:creator>
            <pubDate>Thu, 14 May 2026 19:23:39 GMT</pubDate>
            <atom:updated>2026-05-28T18:09:24.025Z</atom:updated>
            <content:encoded><![CDATA[<h4>This is a Part I of my Snowflake Cortex MCP Series</h4><h3>Why separating security, routing, and execution makes AI access scalable in the enterprise.</h3><p>Last week, a customer asked me: “If both MCP and REST API hit the same Snowflake platform, why do I need the MCP path?” Good question. The answer comes down to whether you want a governed platform that scales, or another integration you will eventually have to rebuild.</p><h3>Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DSk3rhYi9tqV3WzjeXp6A.png" /></figure><h3>Who’s Connecting: The Client Layer</h3><p>Your MCP Server can handle requests from any of these client types:</p><ul><li><strong>AI Assistants</strong>: Claude, ChatGPT, Cursor, and other large language models</li><li><strong>Developer Tools</strong>: IDEs, code editors, and custom AI-integrated applications</li><li><strong>Custom Applications</strong>: Internal tools and purpose-built integrations</li><li><strong>Business Users</strong>: Chat interfaces and no-code platforms</li><li><strong>Mobile Applications</strong>: Native iOS and Android clients</li></ul><p>That flexibility matters because MCP is a protocol, not a one-off proprietary integration.</p><h3>The Nerve Center: MCP Server Architecture</h3><p>Once a client connects, requests flow through three critical layers:</p><h4>1. MCP Gateway</h4><p>I think of the gateway as the security perimeter. The Gateway handles:</p><ul><li><strong>Request Validation</strong>: Ensures incoming calls conform to the MCP spec</li><li><strong>Authentication &amp; Authorization</strong>: Validates OAuth tokens and verifies user permissions</li><li><strong>Rate Limiting</strong>: Protects your Snowflake compute from overload</li><li><strong>Protocol Translation</strong>: Converts MCP calls into internal routing instructions</li><li><strong>Error Handling</strong>: Returns standardized MCP error responses</li><li><strong>Audit Logging</strong>: Records every request for compliance and debugging</li></ul><p>Think of this as your bouncer: nothing gets through without proper credentials and validation.</p><h4>2. Tool Routing</h4><p>Once the Gateway approves a request, Tool Routing takes over:</p><ul><li><strong>Request Mapping</strong>: Translates the client’s intent into the right tool or service</li><li><strong>Tool Discovery</strong>: Tells clients what tools are available (and what each one does)</li><li><strong>Session Management</strong>: Keeps track of ongoing conversations and context</li><li><strong>Access Control</strong>: Enforces RBAC at the individual tool level</li><li><strong>Load Balancing</strong>: Distributes requests across available compute</li><li><strong>Response Formatting</strong>: Ensures responses match the client’s expected format</li></ul><p>This layer is the dispatcher. It knows the available tools, understands the session context, and routes requests to the right destination.</p><h4>3. Cortex Services</h4><p>This is where execution actually happens. The MCP Server exposes these Snowflake capabilities:</p><ul><li><strong>Cortex Analyst</strong>: Text-to-SQL with semantic model awareness</li><li><strong>Cortex Search</strong>: Vector and hybrid search over unstructured data</li><li><strong>Cortex Agent</strong>: Multi-step reasoning and tool chaining</li><li><strong>SQL Execution</strong>: Direct read-only (or scoped write) query execution</li><li><strong>UDFs &amp; Stored Procedures</strong>: Custom functions and business logic</li></ul><p>Each service can be individually governed. For example, a user might be allowed to use Cortex Analyst while being blocked from direct SQL execution.</p><h3>The Foundation: Snowflake Platform</h3><p>All of this sits on top of the full Snowflake platform:</p><ul><li><strong>Data Warehousing</strong>: Your structured data lives here</li><li><strong>Data Lake</strong>: Unstructured and semi-structured data</li><li><strong>Secure Data Sharing</strong>: Zero-copy sharing with partners</li><li><strong>Governance &amp; Security</strong>: RBAC, ABAC, masking, row-level access policies</li><li><strong>Monitoring &amp; Observability</strong>: Query history, usage patterns, cost tracking</li></ul><p>Every tool invocation is still subject to Snowflake’s underlying security and governance model. MCP adds another layer of control on top of that.</p><h3>The Dual-Path Architecture: Protocol vs. Bypass</h3><p>Here’s the critical insight most teams miss:</p><h3>Path 1: The Governed Route</h3><p>When a request comes in, it follows this journey: Clients → MCP Gateway (security checks) → Tool Routing (discovery) → Cortex Services (execution) → Snowflake Platform</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Woeb-RqudhnGnTlO_10dw.png" /></figure><p>This is the <em>governed</em> path. Every request passes through security checks, RBAC enforcement, audit logging, and rate limiting. It’s the right choice for:</p><ul><li>Multi-tenant environments</li><li>Regulated industries (financial services, healthcare)</li><li>Shared platforms where different teams need different access levels</li><li>Any scenario where you need to audit who called what, when</li></ul><h3>Path 2: Direct REST Access</h3><p>Clients -&gt; <strong>Snowflake Platform</strong> (Direct HTTPS/JSON)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x0D7eZiR20Zpg4KbyRt5VA.png" /></figure><p>Some advanced clients can call Snowflake services directly over REST instead of going through the MCP gateway and routing layers. This can be leaner for high-volume inference workloads, but you lose the MCP layer’s discovery, routing, and policy controls. Use this when:</p><ul><li>You need maximum throughput for inference-only workloads</li><li>The client is trusted and fully authenticated at the Snowflake level</li><li>You’re willing to trade MCP-level governance for performance</li></ul><p>Most customers use <strong>Path 1</strong> for AI agents and multi-user scenarios, and <strong>Path 2</strong> for backend services that know exactly what they need.</p><h3>Key Benefits: Why This Architecture Matters</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sh2qKZTdtjDbE88xBlMnfQ.png" /><figcaption>Why This Architecture Matters</figcaption></figure><h3>The Design Philosophy</h3><p>This architecture separates <strong>concerns</strong>:</p><ul><li><strong>Clients</strong> focus on user intent (asking questions, running workflows)</li><li><strong>MCP Gateway</strong> focuses on security (is this request legitimate?)</li><li><strong>Tool Routing</strong> focuses on discovery and orchestration (which tool should handle this?)</li><li><strong>Cortex Services</strong> focus on computation (LLM inference, text-to-SQL, search)</li><li><strong>Snowflake Platform</strong> focuses on data and governance (storage, access control, audit)</li></ul><p>When something goes wrong, you know exactly which layer to debug. When you need to scale, you know which layer to invest in. When you need to add governance, you know exactly where to apply it.</p><p><strong>TLDR:</strong> MCP separates concerns so you can scale, govern, and debug independently. REST can be a better fit for narrow, high-throughput patterns. MCP is the better fit when you need shared governance, discoverability, and orchestration. The choice is really about operating model: platform access for many users and tools, or point integration for a known workload.</p><h3>Real-World Implications</h3><h3>Scenario 1: Multi-Team Platform</h3><p>Your company has 10 teams that need to query the data warehouse using natural language. Instead of ten teams each building their own Cortex integration, you can expose a shared MCP server with a governed Cortex Analyst tool backed by a shared semantic model. Every team connects via MCP. Access is governed at the MCP Server level. Cost visibility improves because usage is centralized around the same governed entry point and semantic layer.</p><p><strong>Result:</strong> One semantic model. Ten teams. Zero reimplementation.</p><h3>Scenario 2: Third-Party Integration</h3><p>A partner needs to query your shared data. You create an MCP Server with read-only access to specific tables via SQL Execution. Rate limiting prevents them from hammering your compute. Audit logs show exactly what they accessed and when. Their access can be revoked centrally without rebuilding the integration.</p><p><strong>Result:</strong> Secure, auditable access. No integration fatigue.</p><h3>Scenario 3: Hybrid Governance</h3><p>Your Data Science team uses the REST API directly for high-volume inference experiments (Path 2: fast, compute-efficient). Your business users access data through an MCP-connected chat interface (Path 1: governed, discoverable). The same underlying Snowflake platform powers both.</p><p><strong>Result:</strong> Different access patterns. Same data. Same governance.</p><h3>What Makes This Different from REST API Alone</h3><p>The REST API gives you <strong>direct access to services</strong>. MCP gives you a <strong>governed access layer</strong> built for many users, many tools, and many clients.</p><p>With REST alone, you’re managing authentication, tool discovery, access control, and rate limiting in your client code or in an API gateway you build yourself. That works for small deployments.</p><p>MCP is especially useful when governance is distributed across teams, tools, and user types, because it gives you one place to manage discovery, routing, and policy enforcement. It’s governance designed for platforms, not point integrations.</p><h3>Getting Started with This Architecture</h3><ol><li><strong>Define your tools</strong>: Which Snowflake capabilities (Cortex Analyst, Search, SQL, UDFs) do you want to expose?</li><li><strong>Set permissions</strong>: Use Snowflake RBAC to grant access at the tool level</li><li><strong>Create the MCP server: </strong>stand up the server layer and connect it to the Snowflake capabilities you want to expose</li><li><strong>Connect clients</strong>: Point any MCP-compatible client at your server</li><li><strong>Monitor and iterate</strong>: Use audit logs and performance metrics to optimize</li></ol><p>The <a href="https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-mcp">Snowflake MCP Server documentation</a> walks through the complete setup.</p><h3>The Bottom Line</h3><p>This architecture is built for <strong>enterprise scale</strong>. The point of this architecture is that security, observability, and governance are part of the design from day one, not something you retrofit later. When you move from experimental AI integrations to shared production access, this is the kind of architecture that scales with you.</p><p>If you liked this article, please check out my Part II article on <a href="https://medium.com/@caleb.alexander/cortex-rest-api-vs-mcp-server-when-to-use-each-when-to-use-both-a172ff91ae1e"><strong>Cortex REST API vs. MCP Server: When to Use Each, When to Use Both</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a4264c2bce1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Gap Between Your Data and Your Team Just Closed]]></title>
            <link>https://medium.com/@caleb.alexander/the-gap-between-your-data-and-your-team-just-closed-21f616f9199a?source=rss-11ae3182d233------2</link>
            <guid isPermaLink="false">https://medium.com/p/21f616f9199a</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Caleb Alexander]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 17:45:24 GMT</pubDate>
            <atom:updated>2026-05-28T18:08:36.992Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>How Snowflake’s AI coding agent turns natural language into semantic layers, live dashboards, and conversational analytics. In minutes, not sprints.</em></strong></p><p>Someone on your team hits an error in a query. They don’t know SQL well enough to fix it, so they screenshot it, paste it into Slack, and wait. A stakeholder asks for a dashboard. A ticket gets filed, a developer picks it up next sprint, and it ships in two weeks. An analyst needs a report refreshed weekly instead of manually every Tuesday, but automating it means learning a pipeline tool nobody has time to onboard.</p><p>Each request is simple. Each one requires a handoff, a ticket, and a wait.</p><p>The gap was never data. It was always access: the distance between the people who have the questions and the tools that can answer them.</p><p>That gap just closed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Uh7Pf_D1wXjTQk-Oktfvg.jpeg" /></figure><h3>What Is Cortex Code?</h3><p>Cortex Code, or <strong>CoCo</strong> for short, is Snowflake’s native AI coding agent. You describe what you want in plain English, and it writes SQL, builds objects, creates applications, debugs errors, and deploys pipelines (all inside your Snowflake environment).</p><p>It comes in two surfaces. The <strong>CLI</strong> runs in your terminal (ideal for automation, scripting, and power-user workflows). The <strong>Snowsight UI</strong> lives as a side panel right inside your browser (no installs, no extensions). Both surfaces share the same core capability: deep awareness of your Snowflake account. CoCo knows your databases, schemas, tables, roles, warehouse configuration, and query history. It doesn’t just suggest code. It executes it. And every action that modifies your environment requires your explicit approval first.</p><p>Your data never leaves Snowflake. Interactions conform to role-based access control. It’s not a prototype. It’s production-ready and available today.</p><p>My colleague <a href="https://medium.com/u/76cddc2c6a10">Tom Smith</a> recorded a <a href="https://www.snowflake.com/webinars/snowflake-cortex-code-setup-and-installation/"><strong>setup walkthrough</strong></a> that gets both surfaces running in about ten minutes. It’s the fastest on-ramp if you want to follow along.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VdWEbqMBifsgw9EavnOFg.jpeg" /></figure><h3>The Terminal: Raw Data to Board Presentation</h3><p>In the <a href="https://www.snowflake.com/thankyou/cortex-code-cli/"><strong>CLI demo</strong></a>, a single terminal session goes from an empty environment to a complete analytics stack in 30 minutes.</p><p>It starts with data loading. CoCo fetches a setup script from GitHub, parses it, and executes the full sequence of CREATE and INSERT statements, asking permission before each DDL. No copy-pasting SQL into a worksheet. One prompt, one conversation.</p><p>From there, it builds a <strong>semantic view</strong>: the layer that maps raw column names like BATTERY_LEVEL_PCT and PASS_FAIL into business language. Once deployed, anyone with the right role can ask questions like <em>“Which region should we prioritize for V2 launch based on customer satisfaction?”</em> and get grounded, accurate SQL results (no query writing required).</p><p>Next, <strong>CoCo builds</strong> a Cortex Agent that combines structured data queries through the semantic view with unstructured document search through Cortex Search. One conversational interface, multiple data sources. <strong>CoCo then registers</strong> this agent in Snowflake Intelligence, where business users interact with it directly (no terminal, no SQL, just a conversation).</p><p>Then comes the part that scales: <strong>custom skills</strong>. CoCo ships with dozens of built-in expert workflows (semantic view optimization, agent creation, cost management, dbt, Streamlit), but you can create your own. In the demo, a pawcore-launch-readiness skill encodes the entire launch assessment workflow: gather requirements, analyze quality metrics, assess sentiment by region, generate a scorecard with a go/no-go recommendation. Any team member runs it next quarter and gets the same rigorous output.</p><p>The session closes with <strong>stakeholder documentation</strong>: an architecture diagram, a data-backed launch report, and a board presentation script. All generated from a single prompt. Raw data to board-ready deliverables. One terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMLhPWcOO67C86V8Hi97EQ.png" /></figure><h3>The Browser: Screenshot, Describe, Deploy</h3><p>The <a href="https://www.snowflake.com/thankyou/cortex-code-cli/"><strong>UI demo</strong></a> proves you don’t need a terminal to build a full analytics stack. Everything happens inside Snowsight (the interface you already log into).</p><p>The headline feature is <strong>screenshot error repair</strong>. A broken query with three errors gets fixed three different ways: highlight a keyword and tell CoCo in plain English what’s wrong; click the Fix button beneath a compiler error and let CoCo diagnose it automatically; or screenshot the entire screen (query and error together), paste it into the CoCo panel, and type “fix this.” That third method catches things no compiler ever will: wrong column names, cosmetic typos, issues that don’t throw errors but produce bad results. It works on worksheets, notebooks, Streamlit tracebacks, even error messages from outside Snowflake.</p><p>From there, a single prompt generates a <strong>Snowflake Notebook</strong>: five cells covering ticket severity by region, customer review patterns, telemetry anomalies, AI-powered sentiment analysis, and a composite readiness score. When one cell returns no results, a screenshot fixes the filter logic. Same pattern, different artifact.</p><p>The notebook findings get operationalized as a <strong>Dynamic Table</strong>: an auto-refreshing pipeline with a target lag. New data lands, the table refreshes. No Airflow, no cron jobs, no orchestration code.</p><p>That Dynamic Table feeds a <strong>Streamlit dashboard</strong> built from a single prompt (color-coded readiness cards, bar charts, metrics tables, risk assessment). Deployed and live. When the CX lead asks for a new feature, CoCo updates the app in a single conversation turn. Compare that to a two-week sprint cycle.</p><p>Finally, a <strong>semantic view and Intelligence agent</strong> give the team a chat-based interface for ad-hoc investigation. The same data now powers four surfaces (notebook, pipeline, dashboard, conversational AI), each built from natural language inside the browser.</p><p>And skills aren’t CLI-only anymore. The Snowsight panel now supports uploading skill files, creating new skills, and invoking them directly with / commands (the same reusable, shareable workflows available in the terminal, now accessible without ever leaving the browser).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHxGVcwNwwiiw0-eTo53vA.jpeg" /></figure><h3>Why This Changes the Conversation</h3><p>The shift isn’t faster SQL. It’s the collapse of the feedback loop between a question and an answer.</p><p>A stakeholder asks for a dashboard. Instead of a ticket, a sprint, and a two-week wait, there’s a prompt and a deployed app. An analyst needs a weekly refresh. Instead of learning an orchestration tool, there’s a Dynamic Table with a target lag. A new hire hits an error. Instead of a Slack thread and a three-hour wait, there’s a screenshot and a fix.</p><p>Skills mean institutional knowledge stops walking out the door when someone changes roles. Semantic views mean business users stop waiting for analysts to translate their questions into SQL. Agents mean the distance between “I have a question about the data” and “here’s the answer” is a single conversation turn.</p><p>This is what it looks like when the tool meets the user where they are: terminal or browser, technical or not.</p><h3>Start Here:</h3><p>Cortex Code is available today. No waitlist, no beta. Open the CoCo panel in Snowsight or run cortex in your terminal.</p><p>Three on-demand sessions walk through everything covered in this article:</p><p><a href="https://www.snowflake.com/webinars/snowflake-cortex-code-setup-and-installation/"><strong>Setup &amp; Install</strong> </a>— Get CoCo running in your terminal and browser in 10 minutes (presented by Tom Smith)</p><p><a href="https://www.snowflake.com/thankyou/cortex-code-cli/"><strong>CLI Deep Dive</strong> </a>— Semantic views, agents, skills, and documentation from the terminal</p><p><a href="https://www.snowflake.com/thankyou/cortex-code-ui_final/"><strong>UI Deep Dive</strong></a> — Screenshot repair, notebooks, Dynamic Tables, Streamlit, and Intelligence agents from the browser</p><p><a href="https://github.com/calebaalexander/HandsOnLabs/tree/main/2-Cortex-Code"><strong>Hands-on labs:</strong></a> Access quickstarts, files, and scripts.</p><p>Screenshot your next error. Describe your next dashboard. See how far one prompt gets you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21f616f9199a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake Cortex AI Best Practices: Part I]]></title>
            <link>https://medium.com/@caleb.alexander/snowflake-cortex-ai-best-practices-part-i-a03608f98cf6?source=rss-11ae3182d233------2</link>
            <guid isPermaLink="false">https://medium.com/p/a03608f98cf6</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[cortex]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Caleb Alexander]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 00:30:57 GMT</pubDate>
            <atom:updated>2026-02-02T00:30:57.334Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Lessons From the Field.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eIBRxYa50Qj9H1XWYKofNw.png" /></figure><p>Snowflake Cortex AI can feel almost magical when it’s working well. An agent answers a complex question across several data sources, explains what it did, and returns results in seconds.</p><p>It can also feel confusing when the same agent picks the wrong tool, misunderstands a question, or runs more compute than you expected.</p><p>As a Solution Engineer at Snowflake, I have seen both sides many times. Across customer projects, the most successful teams are not the ones with the most complicated prompts. They are the ones that apply a small set of practical habits.</p><p>This article shares seven of those habits so you can get to reliable, production ready outcomes faster.</p><h4><strong>1. Start With a Focused Agent</strong></h4><p>A common first attempt is to build a single agent that can answer anything across the business. It has access to sales data, product usage, support tickets, finance, marketing, HR, and more. That usually means dozens of tools behind one chat interface.</p><p>In that setup, a simple question like “How are we doing this quarter?” becomes difficult. Is it a revenue question, a pipeline question, or a support question? With too many options, the agent can easily choose the wrong path.</p><p>A more reliable approach is a <strong>micro agent strategy</strong>. Build several small, focused agents instead of one universal agent. For example:</p><ul><li>Sales pipeline agent with 4 tools</li><li>Customer support agent with 3 tools</li><li>Product analytics agent with 5 tools</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lrvoc-6ZKv2UF6Z_vHcGXA.jpeg" /></figure><p>Each agent understands its domain and has a small, clear toolbox. Tool selection is more straightforward, answers are more consistent, and debugging becomes simpler.</p><h4><strong>2. Treat Tool Descriptions As Part of the Interface</strong></h4><p>Once a semantic view or Cortex Search Service is wired up, it is tempting to drop in a short description and move on. That usually sounds like:</p><pre>name: ConsumptionTool<br><br>description: Gets consumption data from the database</pre><p>This does not tell the agent what data it is allowed to use, or when it is appropriate. A more helpful description removes ambiguity:</p><pre>name: CustomerConsumptionAnalytics<br><br>description:<br>  <br>    Aggregated Snowflake consumption metrics for commercial customers. <br><br>    Data Coverage:<br>        - Daily rollups of credit usage, compute hours, and storage    <br>        - Past 2 years of history        <br>        - Updated nightly at 02:00 EST    <br>        - Excludes trials and internal accounts<br><br>    When to use:<br>        - Questions about customer usage patterns or trends    <br>        - Customer level questions such as &quot;How much did Acme use last quarter?&quot;<br><br>    When not to use:<br>        - Real time usage<br>        - Performance of individual queries</pre><p>With this description, the agent now knows exactly when this tool is appropriate and when it is not. In practice, that means it will stop calling this tool for real time or query level questions and instead use it only for historical, aggregated consumption questions, leading to fewer incorrect tool calls and more complete answers for users.</p><p><strong>Quick win:</strong> For your highest traffic tools, add explicit “When to use” and “When not to use” bullets in description.</p><h4><strong>3. Make the Semantic Layer Speak the Business Language</strong></h4><p>When agents answer incorrectly, many people blame the model. In many cases the real issue is that the semantic layer still looks like the internal warehouse schema.</p><p>If your semantic view has a table with columns called arr_val, hlth_scr and churn_flg_90d, the model had to guess which one represents “customer health” or “churn in the last 90 days”.</p><p>Instead, use clear names and descriptions:</p><pre>tables:<br><br>    - name: customer_metrics    <br>      description: Customer performance and engagement metrics    <br>      columns:<br>        - name: annual_recurring_revenue<br>          description: Total annual contract value<br>        - name: customer_health_score<br>          description: Score from 0 to 100, below 50 is high risk<br>        - name: churned_in_last_90_days    <br>           description: Boolean flag for churn in the last 90 days</pre><p>Now the phrase “high risk customers” naturally maps to customer_health_score &lt; 50.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*sd0imQ53uET9w01rQKoo-Q.jpeg" /></figure><p>You can also use <strong>verified queries</strong> for your highest value questions so Cortex Analyst can return fully deterministic answers instead of generating new SQL each time. Verified queries let you lock in the exact logic for questions that matter and reuse it across teams. For implementation details and examples, see the Cortex Analyst <a href="http://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-analyst/verified-query-repository">documentation</a> on verified queries.</p><p><strong>Quick win: </strong>Identify your five most common, business critical questions and turn each one into a verified query in your semantic view. That way, every seller, analyst, or leader asking those questions get the same trusted answer, rather than slightly different versions of the truth.</p><h4>4. Align Cost and Performance With Real Needs</h4><p>There is always a compute cost with AI workloads. The more helpful way to think about it is whether you are paying for value or waste.</p><p>A Cortex Agent that pulls data from four systems and answers “Which accounts are at risk this quarter?” in a few seconds is replacing hours of manual work. That is often worth the credits. What you want to avoid is over-provisioning or using real time settings when daily freshness is enough.</p><p>A few practical guidelines:</p><ul><li>Start with smaller warehouses such as X-Small and let real workloads tell you if you need to scale up.</li><li>Set AUTO_SUSPEND aggressively so idle warehouses stop quickly.</li><li>Choose TARGET_LAG values that match the business. Many reporting use cases are comfortable with hourly or daily refresh instead of one minute.</li></ul><p>You can monitor Cortex costs with the account usage views. For example:</p><pre>SELECT<br>  service_name,  <br>  usage_date,<br>  credits<br>FROM CORTEX_SEARCH_DAILY_USAGE_HISTORY<br>ORDER BY usage_date DESC;</pre><p><em>Note: For a complete picture of Cortex AI costs, also check CORTEX_ANALYST_USAGE_HISTORY and CORTEX_AGENT_USAGE_HISTORY in SNOWFLAKE.ACCOUNT_USAGE</em></p><p><strong>Quick Win: </strong>Identify your highest cost services and confirm that both warehouse size and freshness values match how often people rely on them. Tightening those two settings alone often recovers a meaningful amount of spend while keeping performance exactly where the business needs it.</p><h4>5. Tune Cortex Search For Precision, Not Just Coverage</h4><p>Cortex Search becomes far more useful when results are precise snippets instead of long, loosely related documents.</p><p>Three small choices have a big impact:</p><ol><li><strong>Chunk size: </strong>Break text into sections of roughly 300 to 400 words. This is usually enough to preserve context while still retrieving the exact part of a document that answers the question.</li><li><strong>Embedding model: </strong>Start with a balanced default such as snowflake-arctic-embed-l-v2.0. Switch only if you have strong reasons for a different language set, context length, or accuracy profile. *</li><li><strong>Ranking signals:</strong> Add simple boosts for attributes like recency or popularity. For example, you might slightly favor documents with more upvotes, or those created within the last week. **</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqi3RzDzuvCakbvRUSNRkA.png" /></figure><p>If your users report that “search brings back random stuff”, these three settings are the first places to look.</p><p><strong>Quick win: </strong>Reindex one search service with 300 to 400 word chunks and a basic ranking policy that boosts recent, highly viewed documents. Compare before and after on a handful of real queries so stakeholders can see how a small configuration change turns noisy, hit-or-miss results into focused answers they can actually act on.</p><p><em>*Please note that the default embedding model is snowflake-arctic-embed-m-v1.5. If you want multilingual support or higher quality, explicitly specify snowflake-arctic-embed-l-v2.0 when creating your Cortex Search Service.</em></p><p><em>**Also note that Cortex Search also supports scoring profiles for advanced ranking customization, including numeric boosts, time decays, and component weight adjustments. See the </em><a href="http://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-search/cortex-search-customize-scoring"><em>Cortex Search documentation</em></a><em> for details.</em></p><h4>6. Build a Golden Test Set with Real Users</h4><p>Most teams test agents with a handful of questions they come up with themselves. Those tests usually pass. Then the agent goes in front of real users and suddenly struggles with questions nobody anticipated.</p><p>To avoid that, build a <strong>golden test set</strong> with the people who will actually use the agent.</p><p>Ask 3 to 5 stakeholders:</p><p>“What are the top 20 questions you need answered every week?”</p><p>Capture their wording exactly. Include:</p><ul><li>Core, happy path questions</li><li>Edge cases with unusual filters</li><li>Ambiguous questions that should trigger clarification</li><li>Clearly out of scope questions that should be declined</li></ul><p>When you evaluate the agent, use a simple Goal, Plan, Action lens:</p><ul><li><strong>Goal</strong> — Did it understand the intent of the question?</li><li><strong>Plan</strong> — Did it pick appropriate tools in a sensible order?</li><li><strong>Action</strong> — Did it run the right queries and present results clearly?</li></ul><p>This helps you see whether you need better instruction, tool descriptions, or data modeling.</p><p><strong>Quick win: </strong>Before you call an agent production ready, confirm that it can handle at least one example of each of these: happy path, ambiguous, out of scope, odd formatting, and multi tool queries.</p><h4>7. Design Roles with Least Privilege</h4><p>Cortex AI is powerful because it can stitch together information across domains. That is also why access control needs careful design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6L3MuW8lmFvkNlz1_hSwg.jpeg" /></figure><p>A useful pattern is a <strong>dedicated role per agent</strong> with only the permission that agent needs.</p><pre>CREATE ROLE cortex_agent_sales;<br><br>GRANT USAGE ON DATABASE sales_db TO ROLE cortex_agent_sales;<br>GRANT USAGE ON SCHEMA sales_analytics TO ROLE cortex_agent_sales;<br>GRANT SELECT ON SEMANTIC VIEW sales_ops TO ROLE cortex_agent_sales;</pre><p>Row access policies and masking policies on the base tables still apply through semantic views, so you can expose a clean, business friendly interface without giving broad access to raw tables.</p><p>It also helps to explicitly state what the agent cannot see or do. For example:</p><ul><li>No access to raw PII such as personal emails and addresses</li><li>No access to legal contracts or pricing approvals</li><li>No permission to update production data</li></ul><p>This keeps expectations clear and gives the agent language to decline inappropriate requests politely.</p><p><strong>Quick win: </strong>Review the role your main agent uses. If it shares a broad role with developers or analysts, create a dedicated, least privilege role instead.</p><h4>Conclusion</h4><p>Snowflake Cortex AI becomes most valuable when it is boring in the best possible way. The agent gives reliable answers, behaves predictably, and fits cleanly into your security and cost model.</p><p>You get there less by clever prompts and more by applying a few steady habits:</p><ul><li>Start with focused agents</li><li>Write clear tool descriptions</li><li>Invest in a business friendly semantic layer</li><li>Align cost and performance with how people work</li><li>Tune Cortex Search for precision</li><li>Test with real questions from real users</li><li>Design roles with least privilege in mind</li></ul><p>If you follow that path, your first agents will not just be interesting demos. They will become trusted parts of how your teams work with data every day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a03608f98cf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>