Skip to main content

Slack Bot for Snowflake Cortex Agents

Business users wanted to use the AI assistant without logging into Snowflake. Slack was where they already worked.

0extra logins for users
Everyconversation logged
PDFfor long answers
HOW THE PIECES CONNECT

A Python Slack bot on Snowpark Container Services that brings Snowflake Cortex Agent answers into Slack threads, with every conversation logged.

  1. 01

    Question in Slack

  2. 02

    Call the Cortex Agent

  3. 03

    Format tables or PDF

  4. 04

    Log the conversation

Conceptual workflow for this use case. Not a screenshot or a claim about measured results.

Generative AI Solutions

Marketing & Advertising

The full story

We built a Slack bot in Python and deployed it as a container on Snowpark Container Services. The bot calls the Cortex Agent through Snowflake’s agent API and keeps the context of each conversation thread. It formats tables for Slack and can send a long answer back as a PDF.

A scheduled pipeline logs every conversation into Snowflake tables for review and tracking.

Users now get the same governed answers in Slack, and the code, data and model calls all stay inside Snowflake.

The assistant was useful, but only inside a tool most business users never opened.

01

Business users did not want to log into Snowflake to ask a question.

02

Slack was where they already worked.

03

Answers had to stay as governed as they were inside Snowflake.

How we structured the engagement

Bring the agent to Slack without moving anything out of Snowflake.

  1. Phase 01

    Bot service

    Built the Slack bot in Python and deployed it as a container on Snowpark Container Services.

  2. Phase 02

    Agent connection

    Called the Cortex Agent through Snowflake’s agent API and kept context per Slack thread.

  3. Phase 03

    Slack-ready output

    Formatted tables for Slack and returned long answers as PDF files.

  4. Phase 04

    Conversation logging

    Added a scheduled pipeline that logs every conversation into Snowflake tables for review and tracking.

What we built, component by component

  1. 01

    Slack bot container

    Python service running on Snowpark Container Services.

  2. 02

    Cortex Agent API

    The bot calls the same Cortex Agent users reach inside Snowflake.

  3. 03

    Thread context

    Keeps the context of each Slack conversation thread.

  4. 04

    Output formatting

    Slack-formatted tables, and PDF for long answers.

  5. 05

    Conversation log pipeline

    Scheduled pipeline that writes every conversation to Snowflake tables.

A user writes in Slack. The bot on Snowpark Container Services sends the message with its thread context to the Cortex Agent through Snowflake’s agent API, formats the answer for Slack (or as a PDF when long) and replies in the thread. A scheduled pipeline copies the conversation into Snowflake tables.

Slack bot container
Cortex Agent API
Thread context
Output formatting
Conversation log pipeline

The trade-offs we made and why

Decision 01Lead trade-off

Host the bot on Snowpark Container Services

Running the bot inside Snowflake keeps the code, data and model calls in one governed place instead of an outside server.

Decision 02

Reuse the existing Cortex Agent

Calling the same agent through Snowflake’s agent API means Slack users get the same governed answers as users inside Snowflake.

What changed for the client

0

extra logins for users

Business users ask in Slack without logging into Snowflake.

Every

conversation logged

A scheduled pipeline logs every conversation into Snowflake tables for review and tracking.

PDF

for long answers

Long answers are sent back as a PDF; tables are formatted for Slack.

The tools behind the system

Built with a deliberate stack chosen for production reliability and operational velocity.

5 componentsProduction-grade
PythonSlack APISnowpark Container ServicesSnowflake Cortex AgentsSnowflake Tasks

Similar delivery work usually starts in these service areas

If you are exploring a similar product, workflow, or implementation challenge, these are the service tracks that usually fit best.

Where this project sits in the bigger market picture

AI for campaign activation, performance analysis, testing, and marketing data.

Talk to the team that built this.

Tell us where your project stands. In a free 30-minute consultation we map what carries over from this build, what is different for you, and what a first milestone would cost.

FREE 30-MINUTE CONSULTATION

Bring the problem.
Leave with a plan.

A reply within one business day.
A written plan and a fixed quote.
100% of the code and IP is yours.
If AI is the wrong tool, we will say so.

Book your free consultation