Overview

Multi-Agent Chat is a cross-platform Flutter application that creates a collaborative AI discussion environment. Instead of interacting with a single AI model, users configure multiple AI agents with distinct personalities and expertise, then watch them debate and collaborate on topics in real-time.

The project explores pluralistic AI reasoning — the idea that diverse perspectives from agents with different personas produce richer, more balanced insights than any single model could provide.

Key Features

Multi-Agent Discussion System

Two discussion modes power the collaborative experience:

  • Sequential Mode: Agents respond one by one (1–5 rounds), with later agents seeing all previous responses and building upon them
  • Concurrent Mode: All selected agents respond simultaneously for rapid collection of diverse perspectives
  • Conclusion Phase: After sequential debates, each agent gives a final stance, followed by a neutral Moderator synthesizing all views

Smart Agent Configuration

  • Multi-Provider Support: Integrates with Kimi, DeepSeek, Qwen, and Doubao
  • Preset Templates: 5 professionally designed agent personas — Rational Analyst, Creative Pioneer, Critic, Pragmatist, and Humanist
  • Custom Personalities: Users can create agents with custom prompts and behaviors
  • Independent API Keys: Each agent uses its own key for privacy and flexibility

Collaborative Groups

  • 6-Digit Invite Codes for easy sharing
  • Real-Time Synchronization via Firestore — all members see updates within milliseconds
  • Role-Based Permissions: Group leaders manage agents and settings
  • Multi-Session Support: Multiple discussion threads per group with persistent history

Advanced Interactions

  • @Mention System: @AgentName triggers specific responses; @UserName injects user context
  • Streaming Output: Real-time character-by-character rendering
  • Auto-Summarization: After 10+ messages, automatic context compression kicks in

Tech Stack

LayerTechnology
FrontendFlutter 3.10+ / Dart
State ManagementProvider (5 ChangeNotifiers)
BackendFirebase (Auth + Firestore)
LLM IntegrationSSE streaming to 4 providers
UI FrameworkMaterial 3 with dark/light themes
i18nCustom LocaleService (CN/EN)
ExportMarkdown file export

Architecture Highlights

Unified SSE Engine — A single _callLLMStream() method handles all 4 LLM providers through OpenAI-compatible endpoints, with minimal branching for provider-specific quirks.

Sliding Window Context — Smart context management keeps the last 6 messages + session summary to prevent token overflow while maintaining conversation coherence.

Firestore Data Model — Flat collection structure:

groups/        → Group metadata and member management
agents/        → Individual agent configurations with API keys
sessions/      → Discussion threads with auto-generated summaries
messages/      → Rich message history with reply relationships

Real-Time Sync — Multiple Firestore snapshot listeners ensure millisecond-level synchronization across all group members.

Cross-Platform

Runs on Web, iOS, Android, macOS, Linux, and Windows with responsive layouts optimized for each form factor. Material 3 design language with adaptive UI components.

AI-Assisted Development

This project was built using 4 different AI development tools — Gemini Deep Research, Antigravity, Kiro, and Claude Code — serving as a practical exploration of effective human-AI collaboration patterns in software engineering.

Source Code

Available on GitHub.

在线体验 →