How azure-samples/azure-ai-agent-service-enterprise-demo works
Project Type & Purpose
• This is a demo sample showcasing how to build a streaming enterprise agent using the Azure AI Agent Service.
• Its primary goal is to demonstrate programmatically creating or reusing agents with real-time response streaming, document retrieval from enterprise data (e.g., HR policies), and the integration of external services such as Bing Search, OpenWeather, and Azure Logic Apps for tools like email sending.
• It also includes an interactive Gradio UI to display streaming agent responses.
File Structure
• Top-level files and directories provide insight into both configuration and functionality:
• .env.example, requirements.txt: Environment setup and dependency management.
• enterprise-functions.py: Likely contains custom Python functions (e.g., weather fetching, stock lookup) that extend agent capabilities.
• enterprise-streaming-agent.ipynb: A Jupyter Notebook that serves as the interactive demonstration and toolset integration example (setting up the agent, connecting to Azure AI Foundry, and launching the Gradio UI).
• Directory "enterprise-data": Contains HR and policy documents that are ingested into a vector store, enabling retrieval-augmented generation (RAG).
• Azure Logic App ARM template file (send_email_logic_app.json): Provides deployment instructions and configuration for sending email via Logic Apps.
• Various GitHub configuration files, LICENSE, CHANGELOG, CONTRIBUTING, etc., are standard for an open-source demo/repository.
Main Components & Their Relationships
a. User/Client Interface:
• Gradio-based Chat UI (from the notebook) that users interact with to send queries to the agent.
b. Streaming Enterprise Agent:
• The core service built on the Azure AI Agent Service that processes user queries.
• It is responsible for integrating local enterprise data (HR/policy documents) and performing real-time, streaming responses.
c. Data and Document Management:
• Enterprise Data Store: Represent the "enterprise-data" folder containing HR and company policy documents.
• Vector Store: Automatically created or reused (leveraging Azure AI Search) for embedding documents for RAG.
d. External Integrations/Tools:
• Azure AI Foundry: The connection hub where the agent is created or reused.
• External API Services:
• Bing Search: Integrated as a tool to pull in real-time external data, if configured.
• OpenWeather API: Used in custom Python functions (e.g., fetch_weather) for additional tool functionality.
• Custom Python Functions: Exposed through functions in enterprise_functions.py, such as weather queries or stock price lookups.
• Azure Logic Apps: Shown as an external service for sending emails, integrated via a provided ARM template and configured via environment variables.
e. Configuration and Environment:
• .env file: Acts as the central configuration point for API keys, connection strings, and service parameters.
• The README guides proper setup, ensuring that all environmental connections (Azure AI Foundry, Azure AI Search, Bing, etc.) are active.
Architectural Patterns & Design Principles
• Layered / Modular Architecture: Clear separation between the presentation layer (Gradio UI), the business logic (streaming agent and tool orchestration), and infrastructure (external APIs and vector storage).
• Integration Pattern: Use of a ToolSet design where multiple external tools (Bing, file search, custom Python functions, and Logic Apps) are registered and managed.
• Streaming & Real-Time Data Flow: Emphasize the asynchronous, streaming interactions from agent to UI.
Final Advice
• Be as detailed as possible: Enumerate every core element even if it seems small (like custom Python functions) to ensure complete clarity.
• Keep the layout logical and intuitive – group related components (backend logic, external integrations, UI) to reflect the layered architecture.
• Verification: Cross-check details against the README (e.g., integration with Azure AI Foundry, Bing, and OpenWeather) and file structure to ensure that every feature and component is captured.