Slack Bot for Snowflake Cortex Agents
Business users wanted to use the AI assistant without logging into Snowflake. Slack was where they already worked.
A Python Slack bot on Snowpark Container Services that brings Snowflake Cortex Agent answers into Slack threads, with every conversation logged.
- 01
Question in Slack
- 02
Call the Cortex Agent
- 03
Format tables or PDF
- 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.
Business users did not want to log into Snowflake to ask a question.
Slack was where they already worked.
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.
- 01Phase 01
Bot service
Built the Slack bot in Python and deployed it as a container on Snowpark Container Services.
- 02Phase 02
Agent connection
Called the Cortex Agent through Snowflake’s agent API and kept context per Slack thread.
- 03Phase 03
Slack-ready output
Formatted tables for Slack and returned long answers as PDF files.
- 04Phase 04
Conversation logging
Added a scheduled pipeline that logs every conversation into Snowflake tables for review and tracking.
What we built, component by component
- 01
Slack bot container
Python service running on Snowpark Container Services.
- 02
Cortex Agent API
The bot calls the same Cortex Agent users reach inside Snowflake.
- 03
Thread context
Keeps the context of each Slack conversation thread.
- 04
Output formatting
Slack-formatted tables, and PDF for long answers.
- 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.
The trade-offs we made and why
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.
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
extra logins for users
Business users ask in Slack without logging into Snowflake.
conversation logged
A scheduled pipeline logs every conversation into Snowflake tables for review and tracking.
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.
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.
