Deploy an AI Analyst to Bruin Cloud & Slack

Build a stock market AI analyst in Bruin Cloud and connect it to a Slack AI agent so your team can query data from any channel.

Overview

Goal — Build a stock market AI analyst in Bruin Cloud and connect it to a Slack AI agent.

Audience — Data professionals who want to deploy an AI analyst to Bruin Cloud and make it available in Slack.

Prerequisites

  • Bruin CLI installed and authenticated
  • Claude Code available for pipeline generation and bruin ai enhance
  • A Bruin Cloud account with access to Team settings and Projects
  • A Git repo containing your Bruin project
  • Slack workspace with bot credentials and channel access

Steps

1) Initialise the Bruin project

  • Run bruin init empty <pipeline-name>. If the current folder is already git-initialised, this creates <pipeline-name> unless you pass --in-place.
  • If the current folder is not a git repo, Bruin creates a bruin/ folder first and then creates the project and pipeline inside it.
  • For more context, see Bruin project docs and video walkthrough.

2) Build the pipeline

  • Use Claude to extract stock data from Yahoo Finance and Wikipedia.
  • Build assets that clean and join the data.

3) Enhance metadata

  • Run bruin ai enhance across the assets.
  • See AI enhance command for flag options.
  • Confirm descriptions, column metadata, quality checks, and lineage look correct.

4) Add the repo to Bruin Cloud

  • Go to Bruin Cloud, open Team settings, then Projects.
  • Add the repo to the workspace.
  • Enable the pipeline and run it.
  • Confirm backfill runs and daily schedule work as expected.

5) Create the AI agent in Bruin Cloud

  • Go to Agents and create a new agent.
  • Select the repo and pipeline.
  • Add Slack credentials.
  • Name the agent and select the target Slack channel.

6) Add agent instructions

  • Create an AGENTS.md file in the project root with pretext, context, rules, and instructions.
  • Require bruin query for all data access, and use --dry-run while testing.

7) Test in Bruin Cloud UI

  • Ask a few questions to verify the agent can query the data.
  • Confirm it can self-correct when the first query is not correct.

8) Test in Slack

  • Mention the agent in a Slack channel.
  • Ask a stock market question.
  • Open the generated SQL to validate the logic.
  • Request a PDF report and confirm it is generated.

Sample prompts

  • "Which companies had their free cash flow margin improve in the past 4 quarters but saw their stock price decrease more than 10% during the same period?"
  • "Summarize the top 10 tickers by revenue growth and generate a PDF report."