MyAIBOX

May 29, 2026 · View on GitHub

Python FastAPI React TypeScript AWS Gemini

MyAIBOX (AI百宝箱) is a comprehensive Gen-AI application suite built with FastAPI and React. It provides access to various AI capabilities including AI Agent, multimodal chat, text processing, summarization, image/document recognition, and image creation.

Overview

The application integrates multiple GenAI models (Bedrock, Gemini, OpenAI), with secure authentication via Amazon Cognito and session management backed by DynamoDB. It features a modular architecture with a React frontend communicating via AG-UI Protocol (SSE streaming).

🎉 What's New in v3.7

  • Voice input (Asking): speak your question — live transcription via AWS Transcribe streaming, with optional auto-send
  • Research-style Asking: questions and follow-ups stack as a scrollable thread (numbered Q/A blocks with collapsible reasoning), plus a resizable rail that indexes every question for quick navigation

v3.6

  • Models enable/disable: toggle individual models off in Settings → Models without deleting them
  • Per-agent inference parameters: temperature / top_p / max_tokens configured in Agents settings are now actually applied
  • Tool progress hints: long-running tools (e.g. file_write) no longer make the UI look frozen
  • MCP health check: cached agent providers verify MCP sessions and rebuild on dead connections

v3.5

  • Unified Chat Module: Assistant + Persona merged into a single /chat/:agentId route; each agent = system prompt + tools + params + skills
  • Strands-native Skills: Agents can load Anthropic-style skills via the AgentSkills plugin (requires strands-agents>=1.39)
  • Per-agent Workspace: Each agent gets its own isolated workspace at storage/workspace/<username>/<agent_id>/
  • Configurable Agents: Users can override model, parameters, tools, and skills per agent (persisted in DynamoDB)
  • Breaking: /assistant and /persona routes now redirect to /chat/assistant; /api/assistant/* and /api/persona/* endpoints replaced by /api/chat/*

v3.2

  • Agent Session Cache: Per-session Strands Agent caching with 2h TTL, hot-swap model, persistent MCP connections
  • Multimodal Chat: File attachments and image display in Agent conversations
  • Image Editing: Edit images with text instructions (Gemini, Nova Canvas, Stability AI)
  • Shared SSE Parser: Unified readSSE() with proper line buffering, fixing stream truncation across modules
  • CLI Tools: my-aibox build (with auto version sync) and my-aibox check (ruff linting)

v3.0

  • React Frontend: Full migration from Gradio to React + AG-UI Protocol with SSE streaming
  • Generative UI: Dual-track streaming (CoT reasoning + tool use UI)
  • Model & MCP Management: In-app model registry and MCP server configuration

v2.x

  • Multi-provider Agent: Bedrock, Gemini, and OpenAI models via Strands SDK

Features

  • Chat 💬 — Unified conversational AI: pick an agent (Assistant, Q&A persona, etc.), each with its own tools, skills, system prompt, and workspace
  • Text 📝 — Proofreading, rewriting, reduction, expansion, multi-language support
  • Summary 📰 — Document and text summarization
  • Asking 🧠 — Research-style deep Q&A: voice or text input, follow-up threads, per-question reasoning
  • Vision 👀 — Image analysis, document understanding (PDF), multi-model support
  • Draw 🎨 — AI image generation and editing with prompt optimization, style/ratio/seed options
  • Settings ⚙️ — Account management, module configuration, model registry, MCP server management

Supported input formats: jpg/jpeg, png, gif, webp, pdf, csv, doc/docx, xls/xlsx, txt, md, mp4, webm, mov

Screenshots

Multimodal Chatbot

my-aibox

Vision Recognition

my-aibox

Generate and Edit

my-aibox

Settings

my-aibox

Project Structure

my-aibox/
├── app.py                        # FastAPI + uvicorn entry point
├── backend/                      # Backend Python modules
│   ├── api/                          # REST + SSE endpoints (chat, text, summary, asking, vision, draw, settings, upload)
│   ├── core/                         # Config, service layer, DynamoDB sessions
│   ├── common/                       # Auth, logger, CLI, provider cache, async stream
│   ├── genai/                        # LLM providers (Bedrock/Gemini/OpenAI), agents, tools
│   ├── utils/                        # AWS + Bedrock helpers
│   └── tests/                        # pytest unit + integration
├── frontend/                     # React SPA (Vite + TypeScript)
│   ├── src/                          # components / pages / api / styles
│   └── assets/                       # UI static assets (avatars, icons)
├── storage/                      # Runtime data (gitignored)
│   ├── uploads/                      # User-uploaded files
│   └── generated/                    # Generated images / videos
├── logs/                         # Application logs (gitignored)
├── deploy/                       # Deployment artifacts
│   ├── my-aibox.service              # systemd user unit template
│   ├── build-push.sh                 # build & push multi-arch image to ECR
│   └── full-stack/                   # Dockerfile + EKS reference (examples/)
├── docs/                         # README screenshots, etc.
├── pyproject.toml
└── README.md

Tool & Skill System

TypeConfigurationExamples
Strands ToolsPer-agent togglecalculator, current_time, file_write
MCP ToolsSettings → MCP Serverexa-server, core-mcp-server
Legacy ToolsPer-agent toggleget_weather, search_wikipedia
SkillsPer-agent toggle (from ~/.agents/skills/)Anthropic-style skills loaded via Strands AgentSkills plugin

MCP server types: HTTP, stdio, SSE.

Setup

  1. Install dependencies:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
  1. Configure environment:
aws configure
cp .env.example .env
# Edit .env: AWS region, Cognito, DynamoDB, API keys
  1. Build frontend:
my-aibox build
  1. Run:
uv run python app.py

Routes

PathDescription
/React SPA (default → /chat/assistant)
/loginLogin page
/chat/:agentIdChat with the selected agent (e.g. /chat/assistant, /chat/family_doctor)
/text, /summary, /asking, /vision, /drawTool modules
/settings/session, /settings/modules, /settings/models, /settings/mcpSettings pages
/api/*Backend API

Deployment

Local / EC2

my-aibox install            # set up the systemd user service (one-time)
my-aibox run                # run in the foreground (skips systemd)
my-aibox start|stop|restart # manage the systemd user service
my-aibox status             # show service status
my-aibox logs [-f]          # tail journalctl logs
my-aibox build              # build frontend (syncs version)
my-aibox check              # lint (ruff) + run unit tests
my-aibox test               # run pytest (default: tests/unit)
                            # use `my-aibox test -m integration` for real-service tests

Container / EKS

The image in deploy/full-stack/Dockerfile is thin: it ships uv + git only, and the start script git pull the latest code at pod startup. So most code changes do not require a rebuild — just kubectl rollout restart.

deploy/build-push.sh           # build & push multi-arch (amd64 + arm64) to ECR
kubectl rollout restart deployment my-aibox   # roll pods, picks up latest commit + uv sync

deploy/full-stack/examples/ contains reference IAM role/policy and a k8s manifest with our values baked in — copy them as a starting point, do not kubectl apply directly.

License

MIT License - see LICENSE file for details