|
| 1 | + |
| 2 | + |
| 3 | +# System Architecture |
| 4 | + |
| 5 | + |
| 6 | +This document outlines the architecture for the Microsoft AI Agentic Workshop platform. The architecture is modular and designed to support a wide variety of agent design patterns, allowing you to focus on agent implementation and experimentation without changing the core infrastructure. |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## High-Level Overview |
| 11 | + |
| 12 | +The system comprises **four primary layers**: |
| 13 | + |
| 14 | +1. **Front End**: User-facing chat interface. |
| 15 | +2. **Backend**: Orchestrates conversation flow, session state, and acts as a bridge between the front end and agent logic. |
| 16 | +3. **Agent Service Layer**: Loads, instantiates, and operates agent implementations (e.g., single-agent, multi-agent, multi-domain patterns). |
| 17 | +4. **Model Context Protocol (MCP) API Server**: Exposes structured business operations and tools via API endpoints for agent use. |
| 18 | + |
| 19 | +Supporting databases include: |
| 20 | + |
| 21 | +- **SQL Database**: Contains core business/transactional data (customers, subscriptions, invoices, etc.). |
| 22 | +- **Vector Database**: Enables semantic (embedding-based) retrieval over internal knowledge/documents. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Component Breakdown |
| 27 | + |
| 28 | +### 1. Frontend |
| 29 | + |
| 30 | +- **Technology**: Streamlit (Python) |
| 31 | +- **Functionality**: |
| 32 | + - Presents an interactive chat interface. |
| 33 | + - Maintains a unique, persistent session for each user. |
| 34 | + - Displays real-time chat history. |
| 35 | + - Communicates with the backend using HTTP endpoints for prompt submission, response retrieval, and session management (reset/new conversations). |
| 36 | + |
| 37 | +### 2. Backend |
| 38 | + |
| 39 | +- **Technology**: FastAPI (asynchronous Python) |
| 40 | +- **Responsibilities**: |
| 41 | + - Exposes HTTP API endpoints for frontend communication. |
| 42 | + - Manages sessions and conversation history in memory. |
| 43 | + - Connects inbound user requests with the appropriate agent instance in the Agent Service layer. |
| 44 | + - Forwards tool/API calls requested by agents to the MCP API server. |
| 45 | +- **Endpoints**: |
| 46 | + - `/chat`: Processes chat requests and returns agent responses. |
| 47 | + - `/reset_session`: Clears session memory and context state. |
| 48 | + - `/history/{session_id}`: Fetches conversation history. |
| 49 | +- **Session Store**: Tracks session state and chat history (in-memory; pluggable for persistent storage). |
| 50 | + |
| 51 | +### 3. Agent Service Layer |
| 52 | + |
| 53 | +- **Design**: Pluggable and modular—enables selecting and loading different agent design patterns: |
| 54 | + - **Intelligent Single Agent**: One agent using tools to handle requests end-to-end. |
| 55 | + - **Multi-Domain Agent**: Coordinator agent routes requests to specialist agents (e.g., CRM, Billing, Security). |
| 56 | + - **Collaborative Multi-Agent System**: Planning/analysis agent orchestrates multiple domain experts. |
| 57 | +- **Capabilities**: |
| 58 | + - Tool usage via structured API calls to MCP endpoints. |
| 59 | + - Augmented responses using Retrieval-Augmented Generation (RAG) with the vector knowledge base. |
| 60 | + - Maintains both short-term (session) and, optionally, shared or long-term memory for multi-step reasoning. |
| 61 | +- **Implementation**: |
| 62 | + - Built using Semantic Kernel, autogen, or Azure Agent-Service frameworks for agent planning, orchestration, and tool connectivity. |
| 63 | + - Easily configured and swapped by changing agent module imports and startup parameters. |
| 64 | + |
| 65 | +### 4. Model Context Protocol (MCP) API Server |
| 66 | + |
| 67 | +- **Technology**: FastAPI/asyncio, JSON schema validation with Pydantic. |
| 68 | +- **Purpose**: Simulates realistic enterprise APIs, exposing business and operational data through agent-friendly, structured APIs. |
| 69 | +- **Key Endpoint Categories**: |
| 70 | + - Customer/account lookup |
| 71 | + - Subscription, invoice, and payment management |
| 72 | + - Data usage reporting |
| 73 | + - Product and promotion queries |
| 74 | + - Support ticket management |
| 75 | + - Security log review and account unlock |
| 76 | + - Semantic search over the knowledge base |
| 77 | +- **Endpoint Examples**: |
| 78 | + - `get_all_customers`, `get_customer_detail` |
| 79 | + - `get_subscription_detail`, `get_invoice_payments`, `pay_invoice` |
| 80 | + - `get_data_usage`, `get_promotions`, `get_eligible_promotions` |
| 81 | + - `search_knowledge_base` |
| 82 | + - `get_security_logs`, `unlock_account` |
| 83 | + - `get_customer_orders`, `get_support_tickets`, `create_support_ticket` |
| 84 | + - `get_products`, `get_product_detail`, `update_subscription` |
| 85 | + - `get_billing_summary` |
| 86 | +- **Characteristics**: |
| 87 | + - Pydantic-model-validated requests and responses for reliable tool invocation. |
| 88 | + - Serves as the central integration point for all structured data and knowledge base access. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Databases |
| 93 | + |
| 94 | +- **SQL Database**: Stores structured business data, such as customer profiles, subscriptions, invoices, and order histories. |
| 95 | +- **Vector Database**: Stores embedding-based representations of knowledge documents and internal policies, enabling fast and relevant retrieval during RAG operations by agents. |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## Summary |
| 100 | + |
| 101 | +This four-layer architecture ensures clear separation of concerns across user interaction, backend orchestration, agent intelligence, and enterprise data access. The platform makes it easy to experiment with a wide range of agent frameworks and design patterns, supporting robust, enterprise-grade agentic solutions without the need to modify underlying infrastructure. |
0 commit comments