How It Works

Understanding Buddy's architecture and workflow

Core Architecture

Architecture Diagram: Client → Adapter (Teams/Webchat) → Core Agent (LLM) → MCP Servers → Tools

1. Chat Interface Layer

Users interact via Teams Bot, web chat, or custom channels. Each channel is adapted to communicate with the core agent.

2. Core Agent

LLM-powered orchestration layer that understands user intent, manages conversation context, and decides which tools to invoke.

3. Tool Orchestration (MCP)

Model Context Protocol standardizes tool discovery and composition. Each tool is a specialized service handling specific workflows.

4. Persistent Memory

PostgreSQL stores conversation threads per user, enabling context-aware responses across sessions and multi-turn conversations.

Workflow Example: Complaint Filing

Step 1: User Input

"I want to file a complaint about billing"

Step 2: Intent Recognition

Core agent recognizes complaint filing intent, looks up conversation context

Step 3: Tool Invocation

Agent invokes complaint-form tool with gathered context and requirements

Step 4: Execution & Storage

Tool processes complaint, stores in database, returns reference number

Step 5: Response

Agent delivers natural-language response with confirmation and next steps

Technology Stack

Frontend

  • • Microsoft Teams Bot Framework
  • • Direct Line Protocol
  • • Web Chat SDK

Core Platform

  • • Fastify (HTTP server)
  • • Mastra (Agent framework)
  • • Azure OpenAI (LLM)
  • • Model Context Protocol (Tool standard)

Infrastructure

  • • Azure Container Apps
  • • Azure Container Registry
  • • PostgreSQL (managed)
  • • Azure VNet (private networking)