Skip to content

Conversation

@boffti
Copy link

@boffti boffti commented Nov 6, 2025

Overview

This PR demonstrates a pattern for streaming real-time AI agent activity to Slack's assistant status interface, implemented using Google's Agent Development Kit (ADK) with OpenAI models. This is primarily for informational and discussion purposes to share the approach with the community.

Note: I understand this diverges from the project's current direction and may not be merged. The goal is to share the real-time status update pattern and provide an alternative implementation for those interested in Google ADK.

What Changed

Core Implementation

  • ai/llm_caller.py: Refactored to emit status events alongside content events from the LLM
  • listeners/assistant/message.py: Captures status events and streams them to assistant_threads_setStatus
  • Migrated from OpenAI to Google ADK (example implementation - the pattern works with any LLM framework)

Supporting Files

  • ai/agents.py: Example multi-agent system (coordinator + specialized agents)
  • ai/tools.py: Example tools for agents
  • docs/MIGRATION_GUIDE.md: Migration guide
  • requirements.txt: Updated dependencies

Key Features

Real-Time Agent Activity Status Updates

The Problem:
The Slack AI example showed generic status messages like "is thinking..." that don't reflect what's actually happening. Users have no visibility into tool calls, agent reasoning, or processing steps.

This Solution:
Stream real-time updates about what the AI is actually doing directly to Slack's assistant status interface.

How It Works (listeners/assistant/message.py:71-77):

  1. The LLM caller emits two types of events:

    • status events: What the AI is doing (tool calls, agent delegations, processing steps)
    • content events: The actual response text
  2. Status events are captured and streamed to assistant_threads_setStatus:

if event["type"] == "status":
    client.assistant_threads_setStatus(
        channel_id=channel_id,
        thread_ts=thread_ts,
        status="is working...",
        loading_messages=[event["text"]],  # Real activity status!
    )
  1. Users see dynamic, specific updates:
    • "Analyzing request and selecting appropriate agent..."
    • "Delegating to MathAgent..."
    • "Calling calculate_expression tool..."
    • "Formatting final response..."

Why This Matters:

  • Transparency: Users understand what's happening, not just that "something" is happening
  • Trust: Seeing the reasoning process builds confidence in AI responses
  • Debugging: Developers can see agent flow and tool execution in real-time
  • Better UX: Reduces perceived wait time by showing progress

Pattern Applicability:
This pattern works with any LLM framework - you just need to:

  1. Emit status events from your LLM caller
  2. Stream them to assistant_threads_setStatus with the loading_messages parameter
  3. Continue streaming content separately via chat_stream

Additional Notes

  • The ADK multi-agent implementation is provided as a working example - the real-time status pattern can be adapted to any LLM framework
  • All existing Slack features (streaming, feedback blocks, suggested prompts) continue to work
  • Comprehensive documentation included in docs/MIGRATION_GUIDE.md

Requirements

  • I have ensured the changes I am contributing align with existing patterns and have tested and linted my code
  • I've read and agree to the Code of Conduct

Discussion Points

I'd love to hear thoughts.

Thank you for considering this contribution!

@salesforce-cla
Copy link

salesforce-cla bot commented Nov 6, 2025

Thanks for the contribution! Before we can merge this, we need @boffti to sign the Salesforce Inc. Contributor License Agreement.

- Implemented hierarchical multi-agent architecture using Google ADK
- Created CoordinatorAgent, MathAgent, TextAgent, and InfoAgent
- Added specialized tools for each agent type
- Updated streaming response handling for ADK integration
- Added comprehensive documentation and migration guide

feat: migrate from openai to google adk multi-agent system

- Replace OpenAI integration with Google ADK multi-agent architecture
- Add specialized agents: MathAgent, TextAgent, InfoAgent, and CoordinatorAgent
- Implement custom tools for calculations, text processing, and information retrieval
- Add real-time status updates showing agent activity and tool usage
- Update streaming implementation to work with ADK event system
- Add comprehensive documentation including migration guide and status implementation guide

BREAKING CHANGE: Requires Google ADK authentication instead of OpenAI API key. Update environment variables to use GOOGLE_APPLICATION_CREDENTIALS or GOOGLE_API_KEY.

chore(git): ignore .vscode directory and update assistant status text

Updated .gitignore to exclude .vscode settings directory. Also refined the
assistant's loading status message from "is working..." to "is thinking..."
to better reflect the AI processing state and added clarifying comments
about the UI elements being updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant