💡 Inspiration

Investment and corporate strategy teams make high-stakes, multi-million dollar decisions inside fast-moving Slack threads—often in a matter of minutes. While internal consensus and bullish enthusiasm compound quickly within a group, the critical evidence that should challenge it remains scattered across SEC filing footnotes, valuation metrics, growth databases, and disconnected research systems.

This creates a dangerous executive blind spot: an investment committee's internal sentiment can remain strongly bullish while liquidity pressures, litigation exposures, regulatory disclosures, or volatility patterns tell a completely different story.

The Problem: Investment committees need real-time access to contradictory evidence at the exact moment of deliberation, not hours later after a separate, manual research sprint.

AlphaChannel was built to bridge this gap directly where the decision-making already happens. We turned Slack into a stateful, institutional risk console that autonomously gathers live evidence, enforces compliant governance, and surfaces inconvenient truths before a financial commitment is finalized.

🛠️ What It Does

AlphaChannel is an intelligent Slack agent that balances internal team conviction with live market data and regulatory disclosures, routing all high-stakes decisions through robust human approval gates.

Core Capabilities:

  • Institutional Research: Ask complex, open-ended questions like "Check if ServiceNow is a risky buy right now" to trigger a deep-dive analysis synthesizing live SEC EDGAR filings, Yahoo Finance fundamentals, and structured risk assessments.
  • Fact-Checking: Instantly verify conversational financial claims (e.g., "Amazon revenue is $180B for Q1 2026") against official SEC filings and market data in real time, inline.
  • Portfolio Governance: Maintain a persistent paper portfolio with full audit trails, continuously monitoring sector concentration and concentration risk.
  • Consequential Approval (HITL): High-stakes actions (like trade executions) are immediately paused at interactive Slack Block Kit checkpoints, requiring explicit manager sign-off before any state mutation occurs.
  • Risk Alerting: Actively monitor portfolio exposure to volatility, correlation, sector concentration, and liquidity thresholds.
  • Multi-Turn Continuity: Maintain thread memory and conversation state across multiple turns, allowing Gemini to reason iteratively.

Skills-Based Analytics:

  • Portfolio Analyzer: Computes real-time asset allocation, diversification scoring (Herfindahl-Hirschman Index), and sector weighting.
  • Risk Manager: Runs multi-factor risk assessments, generating volatility-weighted portfolio beta, concentration, and liquidity scoring.
  • Compliance Archiving: Automatically logs and archives all system events to dedicated audit channels with complete provenance tracking.

🏗️ How We Built It

AlphaChannel leverages a multi-agent harness powered by the Slack Agent Builder framework, coordinated by a central reasoning engine and a secure governance layer.

Architecture Layers:

  • Slack Integration (Socket Mode + Bolt):

    • Real-time Socket Mode listeners for ultra-low-latency interactions.
    • Slack Real-Time Search API integration to retrieve workspace-grounded messages, files, and contextual background.
    • Dynamic Block Kit rendering for interactive compliance approval cards and structured data blocks.
  • AI Reasoning (Google Gemini Flash):

    • Intent classification with confidence thresholding (default 0.70).
    • Goal-oriented planning that evaluates thread history, workspace perception, and active tool schemas.
    • Iterative observation loops: tool execution outputs are fed back to Gemini for the next reasoning turn.
    • Strict structured output contracts utilizing Pydantic validation for risk and action synthesis.
  • Model Context Protocol (MCP) Integration:

    • Persistent MCP transports for real-time Yahoo Finance fundamentals and volatility data.
    • SEC EDGAR filing retrieval with EdgarTools and official SEC failovers.
    • AlphaChannel-native MCP server exposing local portfolio, risk calculation, and governance tools.
  • Data & Governance Layer:

    • SQLite persistence layer managing active cash and equity positions.
    • Unalterable Audit Trail: Every single transaction or state change is permanently logged to an archive channel with UTC timestamps, user IDs, action types, and unique cryptographic event IDs.

🚧 Challenges We Ran Into

1. Coordinating MCP Tool Timeouts Across Multiple Providers

  • Challenge: Managing the intersection of Slack Socket Mode responsiveness, Gemini reasoning deadlines, and external provider latency was incredibly difficult. SEC queries can take up to 30s, Yahoo Finance 12-20s, and overall MCP tools 35s. A single blocked call would freeze the entire Slack thread.
  • Solution: We implemented daemon workers with background threading to keep Socket Mode active, enforced strict bounded deadlines on all external API requests, and built MCP tool execution policies that fail gracefully on timeouts.

2. Autonomous Tool Selection vs. Hard Governance Compliance

  • Challenge: LLMs naturally want to execute every tool they think might be relevant. However, in institutional finance, certain actions must never execute autonomously. We had to strictly isolate read-only research tools from state-mutating portfolio transactions.
  • Solution: We built an Action Policy Gate. Read-only tools (SEC, Yahoo Finance) execute autonomously, while consequential trade tools (Buy/Sell/Trim) are instantly intercepted, paused, and routed to Slack Block Kit approval cards.

3. Resolving Ambiguity in Workspace Context

  • Challenge: Conversation history is messy. Extracting coherent investment claims, company names, and reasoning context from raw Slack threads required parsing natural language and resolving ambiguous ticker references.
  • Solution: We engineered an InternalWorkspacePerception pre-processing layer that filters relevant thread messages, passing them to a targeted Gemini task designed to resolve named entities to verified tickers before calling market data tools.

4. Preventing Concurrent Portfolio Mutations

  • Challenge: Multiple users executing transactions across concurrent Slack threads could lead to race conditions in the portfolio state.
  • Solution: We implemented thread-keyed state management, mutex-style locking on SQLite portfolio mutations, and unique event IDs for pending approvals to guarantee strict transaction serialization.

🏆 Accomplishments That We're Proud Of

  • True Agent Autonomy: Gemini autonomously classifies intent, resolves entities, selects tools, and reasons over results. This is a dynamic, self-directed agent, not a hardcoded command-to-script switchboard.
  • Governed Autonomy: We successfully implemented a split-governance model. Research tools run freely, while financial commitments are securely blocked until human manager sign-off is captured.
  • Stateful Workspace Perception: Thread memory is fully stateful. AlphaChannel reads Slack Real-Time Search results to ground its reasoning in the team's actual conversation context.
  • Sophisticated Risk Scoring: Our Risk Manager and Portfolio Analyzer skills don't just hand-wave risk; they compute real mathematical metrics like the Herfindahl-Hirschman Index (HHI), volatility-weighted portfolio beta, and sector correlation.
  • Bulletproof Audit Compliance: Every buy, sell, hedge, or trim generates an immutable audit record containing precise event provenance and automatic redaction of secrets.

🏫 What We Learned

  1. LLM Tool Selection is Highly Effective: Providing Gemini with clean MCP schemas and allowing it to determine execution order proved far more robust than designing rigid, hardcoded state graphs.
  2. Strict Deadlines Keep Chat Snappy: Bounded timeouts are non-negotiable for conversational interfaces. Designing graceful fallback paths for slow-responding APIs is vital for user retention.
  3. Human-in-the-Loop Builds Trust: Restricting an agent's autonomy with interactive checkpoints does not ruin the experience—it actually increases institutional trust and user confidence.
  4. Automatic Audits Save Pipelines: Building audit logging, encryption, and automated credential-redaction directly into the system architecture from day one is far more effective than trying to retrofit compliance later.

🔮 What's Next for AlphaChannel

  • Live Brokerage Integration: Bridge the current paper portfolio with institutional execution platforms using strict position limits, api-key rotation, and circuit breakers.
  • Natural Language Portfolio Rebalancing: Allow users to dictate high-level strategies (e.g., "Reduce tech concentration below 30% and optimize for tax efficiency") and have the agent generate a sequenced rebalancing proposal.
  • Multi-Asset Class Risk Engines: Expand beyond equities into bonds, options, futures, and commodities to support complex institutional hedging strategies.
  • Real-time Regulatory Watch: Build background listeners that monitor live SEC rule changes, compliance bulletins, and legislative updates, instantly alerting the investment committee when a portfolio position is impacted.

Built With:

  • Gemini Flash (Primary Reasoning & Planning Engine)
  • Model Context Protocol (MCP) (Yahoo Finance & SEC EDGAR Nodes)
  • Python 3.12 & Slack Bolt (Socket Mode Agent Architecture)
  • SQLite (Persistent Portfolio & Audit Ledger)

Built With

Share this project:

Updates