BugLens is a comprehensive tool for analyzing Slack channel conversations and generating detailed Root Cause Analysis (RCA) and QA learnings using AWS Bedrock AI models.
This tool fetches messages from Slack channels (including threads and file attachments), optionally enriches them with JIRA issue details, and uses AWS Bedrock's AI models to generate structured analysis reports focused on technical learnings and improvements.
- Complete Message Extraction: Fetches all messages from Slack channels including:
- Regular messages and replies
- Thread conversations
- File attachments (with content download)
- Message attachments and blocks
- JIRA Integration: Automatically fetches and includes JIRA issue details for linked tickets
- AI-Powered Analysis: Uses AWS Bedrock models to generate structured RCA and QA learnings
- Chunked Processing: Handles large message volumes by processing in manageable chunks
- Multi-level Summarization: Applies hierarchical summarization for comprehensive analysis
runner.py (CLI entry point)
↓
processor.py (Main orchestrator)
↓
slack_scanner.py (Slack API client)
↓
bedrock_client.py (AI analysis)
↓
jira_client.py (JIRA integration)
- Clone the repository:
git clone <repository-url>
cd BugLens- Install dependencies:
pip install -r requirements.txt- Configure AWS credentials for Bedrock access:
aws configurepython runner.py \
--channel "channel-name" \
--bedrock-model-id "anthropic.claude-3-sonnet-20240229-v1:0" \
--slack-token "xoxb-your-slack-bot-token"python runner.py \
--channel "channel-name" \
--bedrock-model-id "anthropic.claude-3-sonnet-20240229-v1:0" \
--slack-token "xoxb-your-slack-bot-token" \
--jira-user "[email protected]" \
--jira-token "your-jira-api-token" \
--jira-server "https://yourcompany.atlassian.net"--channel(required): Slack channel name (e.g., "bug-101")--bedrock-model-id(required): AWS Bedrock model ID--slack-token(required): Slack Bot Token (starts with "xoxb-")--jira-user(optional): JIRA username/email for authentication--jira-token(optional): JIRA API token--jira-server(optional): JIRA server URL
- Create a Slack App at https://api.slack.com/apps
- Add the following OAuth scopes:
channels:historychannels:readfiles:readgroups:historygroups:readim:historyim:readmpim:historympim:read
- Install the app to your workspace
- Copy the Bot User OAuth Token
- Generate an API token at https://id.atlassian.com/manage-profile/security/api-tokens
- Use your JIRA email and the API token for authentication
- Ensure your AWS account has access to Bedrock
- Request access to the desired model (e.g., Claude 3 Sonnet)
- Configure AWS credentials using
aws configureor environment variables
The tool generates structured Markdown reports with three main sections:
- Detailed technical analysis of issues
- Contributing factors and cascading effects
- Missing safeguards and context
- Actionable technical improvements
- Numbered list of specific action items
- QA-specific learnings and improvements
- Concrete action items for testing processes
- Fetches messages in batches of 200
- Processes threads recursively
- Downloads and includes file attachments
- Filters out system messages (joins/leaves)
- Removes user mentions for cleaner analysis
- Chunks messages into manageable sizes (300K characters by default)
- Applies multi-level summarization for large datasets
- Uses specialized prompts for technical analysis
- Handles context length limitations through hierarchical reduction
- Graceful handling of archived channels
- Timeout protection for file downloads
- Retry logic for API failures
- Comprehensive logging throughout the process
slack-sdk: Slack API clientlangchain-aws: AWS Bedrock integrationlangchain-core: Core LangChain functionalityboto3: AWS SDKjira: JIRA API clientrequests: HTTP client for file downloads
- Requires appropriate Slack permissions
- AWS Bedrock model access and costs apply
- File download timeouts may occur for large files
- Archived channels are automatically skipped
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request