Bruin AI Step 4 of 5
Cloud AI Agent
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.
Deploy the analyst
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 enhanceacross 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.mdfile in the project root with pretext, context, rules, and instructions. - Require
bruin queryfor all data access, and use--dry-runwhile 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.
More guides
Capstone: add returns to the pipeline
Extend the project, prove the result, and assess the finished pipeline.
Describe the model in its asset definition
Keep the metric definition, owners, limits, and checked examples next to the SQL.
Load and profile the source data
Load local commerce data and check its shape before modeling it.