Skip to content

breezy89757/agent-plaza

Repository files navigation

Agent Plaza - 多人即時互動 AI 遊樂場 (Playground)

English | 繁體中文


English

Agent Plaza is a multi-user collaborative AI playground built on .NET 10.0, ASP.NET Core SignalR, and Microsoft's official Microsoft.Extensions.AI (MEAI) standard.

Unlike traditional single-user chatbots, Agent Plaza focuses on "interaction and collaboration", allowing multiple friends to join the same chat session via secure tokenized URLs to collaborate, play games, and converse with custom AI agents in real time.

📸 UI Preview

Agent Plaza Home

Browse, sort, and import custom AI agents: Agent Plaza Home

Real-time Collaborative Chat Room (Interactive Session)

Join and play a game of Blackjack with friends and the AI dealer: Interactive Session

✨ Core Features

  • 🎮 Multi-User Real-time Collaboration (SignalR) Using SignalR, multiple participants can join the same room instantly. The AI detects all active participants and handles group context seamlessly.
  • 🔌 Microsoft.Extensions.AI (MEAI) Integration Aligned with Microsoft's unified AI abstraction interface (IChatClient), allowing developers to switch backend LLM providers (e.g., OpenAI, Azure OpenAI, Ollama, LiteLLM) and providing a solid foundation for tool calling.
  • 📄 File Context Upload text files (.txt, .md, .json, .csv, etc.) when creating an Agent. The content is automatically injected as context, serving as a lightweight knowledge base without complex RAG setups.
  • 📥 One-click Import/Export (JSON) Export any custom Agent (name, description, system prompts, file context) to a standard JSON file. Other users can import and replicate it instantly.
  • 🔌 Example Interactive Agents (Testing & Demo) Includes built-in test agents (Blackjack Dealer, TRPG Dungeon Master, Truth or Dare Host) designed specifically to demonstrate multi-user SignalR streaming coordination.
  • 📊 Popularity Stats & Sorting Tracks total conversation count and tokens used for each agent, supporting sorting by creation time, chats, and token consumption.

🛠️ Tech Stack

  • Frontend: Blazor Server (Interactive Server Mode) + Vanilla CSS / Bootstrap Icons
  • Backend: .NET 10.0 (C# 12+)
  • AI Infrastructure: Microsoft.Extensions.AI + LiteLLM / Azure OpenAI
  • Real-time Comm: ASP.NET Core SignalR
  • Database: MongoDB (with automatic fallback to In-Memory mode for zero-configuration startup)

🚀 Quick Start

1. Prerequisites

  • .NET 10.0 SDK
  • MongoDB (Optional, falls back to In-Memory database automatically)
  • LiteLLM or OpenAI / Azure OpenAI API Key

2. Configuration

Configure your AI endpoint and API Key in appsettings.json:

{
  "LiteLLM": {
    "BaseUrl": "http://your-litellm-host:4000",
    "ApiKey": "sk-YOUR_API_KEY_HERE",
    "Models": [
      "gpt-5.4-mini"
    ]
  }
}

3. Run the App

# Restore dependencies
dotnet restore

# Run the app
dotnet run

Open http://localhost:5288 in your browser to start playing!


繁體中文

Agent Plaza 是一個基於 .NET 10.0ASP.NET Core SignalR 以及微軟官方 Microsoft.Extensions.AI (MEAI) 標準構建的 多人即時協作 AI 互動遊樂場 (Playground)

不同於傳統單人使用的 AI 聊天機器人,Agent Plaza 專注於**「互動與協作」**,允許多個好友同時加入同一個對話室,與自訂的 AI 代理人進行即時的群聊與遊戲互動。

✨ 核心特色

  • 🎮 多人即時協作對話 (SignalR) 利用 ASP.NET Core SignalR 技術,多人可以透過安全編碼的專屬 URL 即時加入同一個聊天室,AI 能辨識聊天室中的所有在線玩家並進行精確的群體互動。
  • 🔌 Microsoft.Extensions.AI (MEAI) 標準整合 專案底層完全對齊微軟最新推出的 AI 統一抽象介面(IChatClient),支援靈活切換後端 AI 提供商(如 OpenAI、Azure OpenAI、Ollama 等),並為未來的工具調用 (Tool Calling) 提供了完美的擴充基礎。
  • 📄 檔案上下文 (File Context) 支援在建立 Agent 時上傳文字檔案(.txt, .md, .json, .csv 等)。檔案內容將自動載入為 AI 的專屬知識庫/參考文檔,不需複雜的 RAG 即可實現自訂脈絡對話。
  • 📥 一鍵匯入與匯出 (JSON) 支援將自訂 Agent 的名稱、描述、系統指令與檔案上下文打包為標準 JSON 格式匯出。其他玩家只需在首頁點擊「匯入」,即可瞬間在自己的廣場上複製一個完全相同的 Agent。
  • 🔌 示例互動 Agent (供測試與示範) 專案附帶了幾款用於演示多人互動情境的示例 Agent(如 21點莊家、TRPG 遊戲主持、真心話大冒險),可用於快速測試多人聊天室的即時響應與協作功能。
  • 📊 熱度排行與統計 即時記錄每個 Agent 被使用的總對話次數與消耗的 Token 數量,並支援依時間、對話數、Token 量進行排序與篩選。

🛠️ 技術棧

  • 前端 / 網頁 UI:Blazor Server (Interactive Server Mode) + Vanilla CSS / Bootstrap Icons
  • 後端框架:.NET 10.0 (C# 12+)
  • AI 基礎設施Microsoft.Extensions.AI + LiteLLM / Azure OpenAI
  • 即時通訊:ASP.NET Core SignalR
  • 持久化儲存:MongoDB (亦支援自動降級為 In-Memory 模式運行,開箱即用)

🚀 快速開始

1. 系統需求

  • .NET 10.0 SDK
  • MongoDB (選用,若未偵測到將自動使用 In-Memory 記憶體資料庫)
  • LiteLLM 或 Azure OpenAI API Key

2. 配置設定

在專案根目錄的 appsettings.json 中配置您的 AI 終端節點與 API Key:

{
  "LiteLLM": {
    "BaseUrl": "http://your-litellm-host:4000",
    "ApiKey": "sk-YOUR_API_KEY_HERE",
    "Models": [
      "gpt-5.4-mini"
    ]
  }
}

3. 運行專案

在專案目錄下執行以下指令:

# 還原套件
dotnet restore

# 啟動應用程式
dotnet run

啟動後,使用瀏覽器造訪 http://localhost:5288 即可開始遊玩!


📂 專案結構 (Project Structure)


📄 授權協議 (License)

Copyright (c) 2026 breezy89757. Licensed under the MIT License.

About

Multi-user collaborative AI playground built on .NET 10.0, SignalR, and Microsoft.Extensions.AI.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors