How yeyu2/youtube_demos works
1. This repository is a collection of mostly independent AI demo applications, not a single unified product. The top-level structure groups experiments by capability: realtime multimodal chat, agent orchestration, RAG, workflow building, mobile clients, browser extensions, and document-generation pipelines.
2. The dominant architecture pattern is “client UI + thin backend + model/service providers.” In many demos, the browser or mobile app captures audio, video, screen, or text input, sends it to a Python or Node backend, and receives streamed model output back. WebSocket-based realtime streaming is especially common.
3. The realtime multimodal family is the largest subsystem cluster. Folders like gemini20-realtime, gemini20-screen, gemini20-voicetext, gemini20-canvas, gemini20-longmem, ADK-live-demo, adk-gemini3, Livekit-dev, and gemini_api_update_042025 all follow a similar flow: frontend audio/video/screen capture, backend session coordination, model inference via Gemini Live or similar APIs, and streamed audio/text responses. Browser-side PCM/audio worklets and audio players are a recurring implementation detail.
4. These realtime demos usually separate responsibilities into three layers: presentation UI, media transport, and AI orchestration. The UI handles controls and display; transport code manages WebSocket or realtime session state; backend agent code transforms user signals into model requests and post-processes responses. Some projects also include special-purpose processors for audio encoding/decoding or screen-share frames.
5. The agent-orchestration demos form another major subsystem. CrewAI, AutoGen_API, AgentKit, Swarm_adv, context-aware, adk-graph, and parts of adk-rag all focus on multi-agent coordination, tool calling, planning, and delegation. Their architecture usually centers on an orchestrator or supervisor agent that routes work to specialist agents and tools, then merges results for the user.
6. In these agent demos, the important boundary is between orchestration logic and tool implementations. Tool modules encapsulate search, retrieval, browsing, file access, graph access, or structured output generation, while agent files define behavior, roles, and handoff logic. This separation is visible across projects such as CrewAI/crewai_orche.py, AutoGen_API/autogen_api.py, and adk-rag/custom-rag-streaming-ws/rag_agent/orchestrator.py.
7. The workflow-builder subsystem is the clearest full-stack app in the repo. Workflow-builder/simple-ai-workflow is a Next.js/TypeScript application with API routes, a visual workflow editor, node definitions, validation, execution logic, and reusable UI components. Its architecture is centered on workflow definitions flowing from the editor into a runtime executor, with model/tool selection abstracted behind shared library modules.
8. The RAG-focused projects share a retrieval pipeline architecture: document ingestion, indexing, query-time retrieval, and answer generation. Examples include adk-rag/custom-rag-streaming-ws, auto-rag-optimizer, Swarm_adv, and Workflow-builder/simple-ai-workflow/lib/tools/* for external search sources. The key boundary is between data preparation/indexing and retrieval-time orchestration.
9. auto-rag-optimizer is a more research-oriented pipeline than the interactive demos. It combines an evaluator, orchestrator, RAG pipeline, experiment runner, and visualizer to systematically improve retrieval settings. That makes it a closed-loop optimization system: run experiments, score results, store the best config, and inspect outputs via generated artifacts and charts.
10. Several projects are output-generation pipelines rather than conversational apps. Storybook-Gen is structured around orchestration, image generation, PDF building, schema checking, and cost tracking; Genai-processors contains utilities for generating blog images or podcast-like outputs from source material. These projects emphasize staged content transformation rather than live interaction.
11. There is a strong provider abstraction layer across the repo, but it is not centralized in one shared package. Different demos target Gemini/Gemini Live, OpenAI, AutoGen, CrewAI, ADK, Fireworks, OpenRouter, local Llama/Gemma/Phi models, Whisper, Kokoro, and LiveKit. In the architecture diagram, these should be shown as external model/service dependencies behind each demo’s backend, not as a common platform service.
12. Platform-specific client implementations are also important boundaries. gemini20-android and gemini20-android-serverless are Android frontends paired with backend entrypoints; GeminiChrome is a browser extension with content scripts, background logic, and a side panel; CrewAI_Panel_Update, CrewAI_Taipy, CrewAI_Streamlit.py, and AutoGen_API/react_mini_app are alternate UI shells for similar agent capabilities. These are interchangeable presentation layers over different backend logic.
13. The repository contains some memory- and context-aware variants that add stateful conversation behavior. gemini20-longmem includes a React/Vite frontend with WebSocket handling and screen-share support, while context-aware/context_demo and parts of adk-graph focus on maintaining and querying context over time. In diagram terms, these introduce a state or memory service between the user session and the model call path.
14. Overall, the architecture to diagram is a set of repeated reference implementations: input-capture clients, transport/session layers, orchestration or retrieval logic, and external AI/model services. The repo’s real “system boundary” is the pattern library of demos themselves, not a shared runtime or monolithic backend.
Main entry points: executor.ts Workflow runtime · main2.py Session backend · index.html Realtime UIs · crewai_orche.py Agent supervisor
Components 22
Realtime multimodal
Browser, mobile, and desktop demos for live audio/video/screen sessions
- Realtime UIs · Browser and desktop frontends that capture mic, screen, and chat input
gemini20-realtime/index.html - Session backend · Coordinates live sessions and streams model responses
gemini20-realtime/main2.py - Audio worklets · PCM capture/playback and browser audio processing
gemini20-realtime/pcm-processor.js - Screen share demo · Realtime screen-capture variant with backend coordination
gemini20-screen/main.py - Long memory app · React/Vite client with websocket, chat, and screen-share memory flow
gemini20-longmem/Frontend/src/App.tsx - Memory backend · Backend entrypoint for longer-lived session state and responses
gemini20-longmem/main-longmem.py - ADK live demo · Streaming demo with specialist agents and browser audio UI
ADK-live-demo/adk-streaming-ws/app/main.py
Agent orchestration
Multi-agent demos, tool calling, and supervisor patterns
- Agent supervisor · Representative multi-agent control flow across CrewAI, AutoGen, and ADK demos
CrewAI/crewai_orche.py - Tools layer · Search, retrieval, file, and structured-output tools used by agent demos
CrewAI/crewai_tools.py - Context agent · Maintains conversation context over time with helper tools
context-aware/context_demo/agent.py
Retrieval apps
RAG pipelines, context stores, and retrieval optimization
- RAG orchestrator · Routes retrieval requests and streams answers in the ADK RAG demo
adk-rag/custom-rag-streaming-ws/rag_agent/orchestrator.py - File search · Upload, index, and search files for query-time retrieval
adk-rag/custom-rag-streaming-ws/rag_agent/file_search_tool.py - RAG optimizer · Closed-loop evaluator, runner, and visualizer for tuning retrieval settings
auto-rag-optimizer/orchestrator.py
Workflow builder
Visual workflow editor and execution runtime
- Workflow app · Visual workflow editor, chat UI, and workflow pages
Workflow-builder/simple-ai-workflow/app/page.tsx - Workflow runtime · Validates and executes workflow graphs and messages
Workflow-builder/simple-ai-workflow/lib/workflow/executor.ts - Search tools · External search and knowledge tools used by workflows
Workflow-builder/simple-ai-workflow/lib/tools/index.ts
Content pipelines
Document, story, and media generation pipelines
- Story pipeline · Orchestrates storybook creation, image generation, PDF building, and cost tracking
Storybook-Gen/src/orchestrator.py - Media generators · Blog-image and podcast-style generators from source material
Genai-processors/blog_image_generator.py
Platform clients
Mobile, browser-extension, and alternate UI shells
- Android client · Android Gemini Live demo paired with a mobile backend entrypoint
gemini20-android/Android/GeminiLiveDemo/app/src/main/java/com/example/geminilivedemo/MainActivity.kt - Mobile backend · Backend entrypoint used by the Android live demo
gemini20-android/Backend/main_for_mobile.py - Chrome extension · Content script, background, and sidepanel for Gemini Live in-browser
GeminiChrome/background.js
Other components
- Model services · Gemini, OpenAI, ADK, CrewAI, LiveKit, OpenRouter, Fireworks, Whisper, Kokoro, and local models
Connections 23
- Realtime UIs → Audio worklets: captures audio · Browser UI uses PCM worklets and players for mic and speaker streaming
- Realtime UIs → Session backend: streams session · Frontend sends live media and receives streamed responses
- Session backend → Model services: calls models · Session orchestration delegates inference to external AI providers
- Screen share demo → Session backend: shares transport · Screen-demo variant follows the same live session pattern
- Long memory app → Memory backend: websocket · Stateful client connects to long-memory backend over realtime transport
- Memory backend → Model services: model calls · Backend forwards prompts, memory, and screen-share context to providers
- ADK live demo → Model services: agent runtime · Live demo is driven by ADK-based agent orchestration
- RAG orchestrator → File search: retrieves docs · Query-time retrieval is handled by file upload and search tools
- RAG orchestrator → Model services: generates answers · Orchestrator combines retrieved context with model responses
- RAG optimizer → Model services: evaluates RAG · Optimizer runs experiments against model-backed retrieval configurations
- RAG optimizer → File search: benchmarks retrieval · Experiment loop scores retrieval settings and stores best config
- Workflow app → Workflow runtime: executes graphs · Editor-defined workflows flow into the runtime executor
- Workflow runtime → Search tools: invokes tools · Workflow nodes call external search and knowledge adapters
- Workflow runtime → Model services: LLM steps · Workflow execution can route steps through model providers
- Agent supervisor → Tools layer: delegates work · Supervisor agents hand tasks to specialized tools
- Agent supervisor → Model services: multi-agent calls · CrewAI, AutoGen, and related demos use provider-backed agents
- Context agent → Model services: contextual chat · Context-aware demos maintain state around provider calls
- Android client → Mobile backend: api calls · Android frontend relies on a backend entrypoint for orchestration
- Mobile backend → Model services: live inference · Mobile backend bridges the app to model providers
- Chrome extension → Model services: sidepanel chat · Extension UI talks to live model/session services
- Story pipeline → Media generators: creates assets · Storybook pipeline stages content through image and PDF generation
- Story pipeline → Model services: orchestrates generation · Pipeline uses model providers for planning and narrative generation
- Media generators → Model services: source transforms · Generators depend on providers for image and text synthesis