How brainydaps/barbara works
Project Type & Purpose
• Barbara is a multi-platform mobile/desktop client built with .NET MAUI (Shell + TabBar) using the MVVM pattern.
• It provides three chat “agents” (Analyst, JournalHistorian, Psychologist) backed by Azure AI Agent Services via a semantic kernel.
• Purpose: present a unified XAML UI, route user messages to the appropriate AI agent, display replies in chat bubbles.
File Structure
• Top-level:
• Barbara.sln / Barbara.csproj – MAUI app entry point
• MauiProgram.cs – DI container & platform setup
• Presentation Layer:
• AppShell.xaml / AppShell.xaml.cs – defines Shell + TabBar with three tabs
• Views/ (AnalystPage, JournalHistorianPage, PsychologistPage) – XAML UI pages
• Controls/MessageView.xaml(.cs) – reusable chat bubble control
• Resources/Styles, Fonts, Images – UI assets
• ViewModel Layer (MVVM):
• ViewModels/BaseViewModel.cs – common ObservableCollection<MessageItem>, InputText
• ViewModels/*ViewModel.cs – one per tab; call BotService
• Domain Model & Converters:
• Models/MessageItem.cs – chat message data structure
• Service Layer:
• Services/KernelSetup.cs – initializes AIProjectClient & AgentsClient from connection string
• Services/BotService.cs – routes message to the correct agent, polls for reply
• Platform Projects:
• Platforms/{Android, iOS, MacCatalyst, Tizen, Windows} – platform-specific bootstrap and manifests
README for Architecture Insights
• Technologies: .NET MAUI, MVVM, Azure AI Foundry, DI container.
a. Main Components
• Presentation (Shell + TabBar, Views, Controls)
• ViewModel Layer (BaseViewModel + per-tab ViewModels)
• Service Layer (BotService, KernelSetup)
• AI Layer (AIProjectClient, AgentsClient, individual Agent instances)
• External Systems (Azure AI Agent Services in AI Foundry)
b. Relationships & Data Flow
1. User taps a tab → AppShell navigates to View
2. User enters text → Bound InputText in ViewModel
3. ViewModel calls BotService.SendToAgentAsync
4. BotService uses AgentsClient (provided by KernelSetup) to invoke correct Agent
5. Agent runs in Azure, returns reply over HTTP/JSON
6. BotService aggregates reply → returns to ViewModel → updates ObservableCollection
7. View updates via data binding → MessageView renders bubble
c. Architectural Patterns
• MVVM: clear separation of View / ViewModel / Model
• Shell TabBar: high-level navigation container
• Dependency Injection: all services & view-models registered in MauiProgram
• Semantic Kernel Agents: pluggable AI backends
d. Key Technologies
• .NET MAUI + XAML for UI
• Microsoft.Extensions.DependencyInjection
• Azure.AI.AgentServices (AIProjectClient / AgentsClient)
• Semantic Kernel
• CollectionView & DataTemplates for message list
Detail, Not Complexity
• Every major folder/component from the file tree.
• Both in-process components (XAML UI, ViewModels, Services) and out-of-process services (Azure AI).
• Avoid clustering too much into “Misc”: show individual agents (AnalystAgent, JournalHistorianAgent, PsychologistAgent) as distinct nodes.