Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– BusinessAgent

Business Multi-Agent Orchestrator β€” frysda

Python FastAPI LangChain OpenAI Azure Teams

REST API + Microsoft Teams Bot powered by a supervisor-style multi-agent LLM orchestrator.
Automates backlog engineering, architecture diagrams, BPMN processes, documents, presentations, web research, and data visualization β€” all from a single conversational interface.


πŸ“ Architecture Overview

╔══════════════════════════════════════════════════════════════════════════╗
β•‘                         ENTRY POINTS                                     β•‘
β•‘                                                                          β•‘
β•‘   πŸ‘₯ Microsoft Teams          🌐 External App / Swagger UI              β•‘
β•‘   (group chat or DM)          (REST client, automation, testing)         β•‘
β•‘          β”‚                                  β”‚                            β•‘
β•‘          β–Ό                                  β–Ό                            β•‘
β•‘   Azure Bot Service              X-API-Key header                        β•‘
β•‘   (JWT validation)                                                       β•‘
β•‘          β”‚                                  β”‚                            β•‘
β•‘          β–Ό                                  β–Ό                            β•‘
β•‘   POST /api/messages             POST /api/v1/chat                       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
                          β”‚                β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β–Ό
╔══════════════════════════════════════════════════════════════════════════╗
β•‘                    🧠  CHIEF ARCHITECT β€” frysda                          β•‘ 
β•‘                    (LangGraph ReAct Supervisor)                          β•‘
β•‘                                                                          β•‘
β•‘   β”Œβ”€ Knowledge Base Search (BEFORE every response) ──────────────────┐   β•‘
β•‘   β”‚  Reads prior domain context, decisions, terminology               β”‚  β•‘
β•‘   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β•‘
β•‘                                                                          β•‘
β•‘   EXECUTION MODES (auto-detected from intent):                           β•‘
β•‘   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β•‘
β•‘   β”‚  MODE 1 β”‚ User Story Engineering  β†’  JIRA + DOCS                 β”‚   β•‘
β•‘   β”‚  MODE 2 β”‚ Heuristic Audit         β†’  JIRA + MIRO + SLIDES        β”‚   β•‘
║   │  MODE 3 │ Discovery & Architecture→  WEB + PROCESS + ARCHITECT   │   ║
β•‘   β”‚  MODE 4 β”‚ Mass Change Management  β†’  JIRA + DOCS + PROCESS       β”‚   β•‘
β•‘   β”‚  MODE 5 β”‚ Ad-hoc Orchestration    β†’  Intelligent routing         β”‚   β•‘
β•‘   β”‚  MODE 6 β”‚ Data Visualization      β†’  CHARTS + WEB/JIRA           β”‚   β•‘
β•‘   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
          β”‚          β”‚         β”‚        β”‚         β”‚       β”‚       β”‚       β”‚
          β–Ό          β–Ό         β–Ό        β–Ό         β–Ό       β–Ό       β–Ό       β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”
     β”‚  JIRA  β”‚ β”‚  DOCS  β”‚ β”‚SLIDE β”‚ β”‚ARCHI β”‚ β”‚PROCE β”‚ β”‚WEB β”‚ β”‚MIROβ”‚ β”‚CHART β”‚
     β”‚ Agent  β”‚ β”‚ Agent  β”‚ β”‚ Agentβ”‚ β”‚ TECT β”‚ β”‚  SS  β”‚ β”‚Agt β”‚ β”‚Agt β”‚ β”‚ Agentβ”‚
     β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”˜ β””β”€β”€β”¬β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜
         β”‚          β”‚         β”‚        β”‚         β”‚        β”‚      β”‚      β”‚
         β–Ό          β–Ό         β–Ό        β–Ό         β–Ό        β–Ό      β–Ό      β–Ό
     Atlassian   Word/PDF  PowerPoint Draw.io  Camunda  Tavily  Miro   PNG
      Jira API   .docx     .pptx      .drawio  BPMN     Search  Board  Chart
                                                                          β”‚
                                                                          β–Ό
╔══════════════════════════════════════════════════════════════════════════╗
β•‘                    πŸ“š  KNOWLEDGE BASE (Auto-Learn)                       β•‘
β•‘   After EVERY interaction: extracts & persists domain decisions,         β•‘
β•‘   user preferences, project terminology β†’ business_output/knowledge_base β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ€– Specialist Agents

# Agent Capabilities Output
1 🎫 JIRA Create/update issues, User Stories, sprints, backlog engineering Atlassian Jira
2 πŸ“„ DOCS Word documents, PDF, structured reports .docx / .pdf
3 πŸ“Š SLIDES PowerPoint presentations, executive decks .pptx
4 πŸ—οΈ ARCHITECT Architecture diagrams (hexagonal, C4, layered, cloud) .drawio
5 πŸ”„ PROCESS BPMN process models, swimlanes, Camunda deployment .bpmn
6 🌐 WEB Web research, URL extraction, Tavily search Markdown text
7 🧩 MIRO Brainstorming boards, sticky notes, mind maps Miro board
8 πŸ“ˆ CHARTS Bar, line, pie, scatter charts, data visualization .png

πŸ” Detailed Flow β€” Local Testing

Developer Machine
─────────────────────────────────────────────────────────────────────────

  Terminal 1: API Server                Terminal 2: Dev UI (optional)
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ python api_server.py        β”‚       β”‚ python dev_ui/server.py     β”‚
  β”‚                             β”‚       β”‚                             β”‚
  β”‚ βœ… Startup events:         β”‚       β”‚ βœ… Mock Teams-like UI       β”‚
  β”‚  Β· load .env                β”‚       β”‚  Β· Simulates group chat     β”‚
  β”‚  Β· init GPT-4o via OpenAI   β”‚       β”‚  Β· @frysda mention support  β”‚
  β”‚  Β· create orchestrator      β”‚       β”‚  Β· Knowledge base viewer    β”‚
  β”‚  Β· register 8 agents        β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  β”‚  Β· init Bot adapter (Teams) β”‚                      β”‚ HTTP
  β”‚                             β”‚                      β–Ό
  β”‚ πŸ“‘ Listening on :8000       β”‚            http://localhost:8080
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚  http://localhost:8000/docs        β”‚  ← Swagger UI
     β”‚  http://localhost:8000/health      β”‚  ← Health probe
     β”‚  http://localhost:8000/api/v1/chat β”‚  ← Orchestrator entry
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ─┐
     β”‚  POST /api/v1/chat                                              β”‚
     β”‚                                                                 β”‚
     β”‚  Request body:                                                  β”‚
     β”‚  {                                                              β”‚
     β”‚    "conversation_id": "session-01",                             β”‚
     β”‚    "message": "Crie um diagrama de arquitetura hexagonal",      β”‚
     β”‚    "user_name": "Nilton"                                        β”‚
     β”‚  }                                                              β”‚
     β”‚                                                                 β”‚
     β”‚  Headers: X-API-Key: <your-api-key>   (optional locally)        β”‚
     └─────────┬───────────────────────────────────────────────────── β”€β”˜
               β”‚
               β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ ┐
     β”‚              🧠 ChiefArchitect.invoke()                          β”‚
     β”‚                                                                  β”‚
     β”‚  1. search_knowledge_base("arquitetura hexagonal")               β”‚
     β”‚     β†’ retrieves prior project context (if any)                   β”‚
     β”‚                                                                  β”‚
     β”‚  2. Analyzes intent β†’ MODE 3 (Discovery & Architecture)          β”‚
     β”‚     Presents execution plan to user                              β”‚
     β”‚                                                                  β”‚
     β”‚  3. Delegates:                                                   β”‚
     β”‚     Β· delegate_to_web     β†’ researches hexagonal architecture    β”‚
     β”‚     Β· delegate_to_architect β†’ generates .drawio file             β”‚
     β”‚                                                                  β”‚
     β”‚  4. Composes final response                                      β”‚
     β”‚                                                                  β”‚
     β”‚  5. _auto_learn() β†’ extracts & saves domain knowledge            β”‚
     β”‚     β†’ business_output/knowledge_base/<hash>.txt                  β”‚
     └─────────┬──────────────────────────────────────────────────────  β”˜
               β”‚
               β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚  Response JSON:                                                 β”‚
     β”‚  {                                                              β”‚
     β”‚    "response": "## Diagrama Gerado\n...",                       β”‚
     β”‚    "conversation_id": "session-01",                             β”‚
     β”‚    "files": ["diagrams/order_management_hexagonal.drawio"]      β”‚
     β”‚  }                                                              β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

☁️ Detailed Flow β€” Microsoft Teams (Azure Production)

Microsoft Teams
─────────────────────────────────────────────────────────────────────────

  πŸ‘€ User types in Teams group:
     "@frysda crie uma User Story para o mΓ³dulo de pagamentos"
               β”‚
               β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                    Microsoft Teams Client                          β”‚
  β”‚  Detects @frysda mention β†’ routes to registered bot                β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚  Teams internal routing
                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                    Azure Bot Service                               β”‚
  β”‚                                                                    β”‚
  β”‚  Β· Validates bot registration (TEAMS_APP_ID)                       β”‚
  β”‚  Β· Signs request with JWT (RS256)                                  β”‚
  β”‚  Β· Delivers Activity payload to Messaging Endpoint:                β”‚
  β”‚    POST https://<app>.azurecontainerapps.io/api/messages           β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚  HTTPS POST (JWT signed)
                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚               Azure Container App β€” api_server.py                  β”‚
  β”‚                         Port 8000                                  β”‚
  β”‚                                                                    β”‚
  β”‚  POST /api/messages                                                β”‚
  β”‚    ↓                                                               β”‚
  β”‚  BotFrameworkAdapter.process_activity()                            β”‚
  β”‚    Β· Validates JWT signature against Microsoft JWKS                β”‚
  β”‚    Β· Deserializes Teams Activity object                            β”‚
  β”‚    ↓                                                               β”‚
  β”‚  BusinessBot.on_message_activity()                                 β”‚
  β”‚    Β· Extracts: conversation_id, user_text, user_name               β”‚
  β”‚    Β· Sends typing indicator back to Teams                          β”‚
  β”‚    Β· Loads conversation history (CosmosDB or in-memory)            β”‚
  β”‚    ↓                                                               β”‚
  β”‚  _orchestrator.invoke(user_text, chat_history=history)             β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚              🧠 ChiefArchitect β€” same as local flow                β”‚
  β”‚                                                                    β”‚
  β”‚  1. search_knowledge_base(user_text)                               β”‚
  β”‚  2. Intent classification β†’ MODE 1 (User Story Engineering)        β”‚
  β”‚  3. Presents execution plan                                        β”‚
  β”‚  4. delegate_to_jira:                                              β”‚
  β”‚     Β· Principal BA agent drafts complete User Story                β”‚
  β”‚     Β· Validates acceptance criteria, BDD scenarios                 β”‚
  β”‚     Β· Creates issue in Atlassian Jira via API                      β”‚
  β”‚  5. _auto_learn() β†’ persists domain knowledge                      β”‚
  β”‚     (Azure File Share: /app/business_output/knowledge_base/)       β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚              BusinessBot.on_message_activity()                     β”‚
  β”‚                                                                    β”‚
  β”‚  Β· Appends HumanMessage + AIMessage to history                     β”‚
  β”‚  Β· Saves updated history to CosmosDB (or in-memory)                β”‚
  β”‚  Β· turn_context.send_activity(MessageFactory.text(response))       β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚  Bot Framework reply
                           β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚                    Azure Bot Service                               β”‚
  β”‚  Routes response back to originating Teams conversation            β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
  πŸ‘₯ All group members see frysda's response in Teams chat
     with formatted Markdown, tables, and action items

🌐 API Reference

Method Endpoint Auth Description
GET /health β€” Azure liveness / readiness probe
POST /api/messages Bot Framework JWT Microsoft Teams webhook β€” only used by Azure Bot Service
POST /api/v1/chat X-API-Key Send a message to the orchestrator
DELETE /api/v1/conversations/{id} X-API-Key Clear conversation history for a session
POST /api/v1/ingest X-API-Key Ingest a URL into the knowledge base
GET /api/v1/files/charts/{filename} X-API-Key Download a generated PNG chart
GET /api/v1/files/bpmn/{filename} X-API-Key Download a generated BPMN file
GET /api/v1/files/diagrams/{filename} X-API-Key Download a generated Draw.io diagram

Interactive docs: /docs (Swagger UI) Β· /redoc (ReDoc)

Chat Request / Response

// POST /api/v1/chat
{
  "conversation_id": "session-42",       // any string β€” groups messages into a session
  "message": "Crie um BPMN de aprovaΓ§Γ£o de escopo",
  "user_name": "Nilton"                  // optional β€” used in Teams group mode
}

// 200 OK
{
  "response": "## Processo Gerado\n\nO BPMN foi criado em...",
  "conversation_id": "session-42"
}

πŸ“š Knowledge Base β€” Persistent Memory

The orchestrator automatically learns from every interaction:

User message + Agent response
          β”‚
          β–Ό
    _auto_learn()
          β”‚
    GPT-4o extracts:
    Β· Domain decisions made
    Β· User preferences
    Β· Project terminology
    Β· Recurring patterns
          β”‚
          β–Ό
    add_knowledge_entry()
          β”‚
    business_output/knowledge_base/<hash>.txt
          β”‚
          β–Ό
    Available on next startup via search_knowledge_base()

Local: stored at ./business_output/knowledge_base/
Azure: persisted on Azure File Share mounted at /app/business_output/knowledge_base/


πŸš€ Quick Start β€” Local

# 1. Clone & install
git clone https://github.com/filhormnilton/BusinessAgent
cd BusinessAgent
pip install -r requirements.txt

# 2. Configure
cp .env.example .env
# Edit .env β€” minimum required: OPENAI_API_KEY

# 3a. Start API server + Swagger
python api_server.py
# β†’ http://localhost:8000/docs

# 3b. Start Dev UI (Teams simulator)
python dev_ui/server.py
# β†’ http://localhost:8080

Docker

docker compose up --build
# β†’ http://localhost:8000

βš™οΈ Environment Variables

cp .env.example .env
Variable Required Description
OPENAI_API_KEY βœ… OpenAI API key (GPT-4o)
TEAMS_APP_ID Teams only Azure Bot App ID
TEAMS_APP_PASSWORD Teams only Azure Bot client secret
API_KEY Recommended REST API auth key (X-API-Key header)
JIRA_SERVER Jira features Jira instance URL
JIRA_USER Jira features Jira user email
JIRA_API_TOKEN Jira features Jira API token
JIRA_PROJECT_KEY Jira features Default project key(s), comma-separated
MIRO_ACCESS_TOKEN Miro features Miro OAuth token
MIRO_BOARD_ID Miro features Target Miro board ID
TAVILY_API_KEY Web search Tavily search API key
CAMUNDA_REST_URL BPMN deploy Camunda engine REST URL
COSMOS_ENDPOINT Recommended CosmosDB for persistent chat history
COSMOS_KEY Recommended CosmosDB primary key
BUSINESS_OUTPUT_DIR Optional Output directory (default: ./business_output)

☁️ Azure Deployment

Prerequisites

Resource Purpose
Azure Container Registry (ACR) Docker image storage
Azure Container App Runs the API server
Azure Bot Service Teams channel integration
Azure File Share Persistent business_output/
Azure CosmosDB (optional) Persistent conversation history

GitHub Actions (CI/CD)

The workflow at .github/workflows/deploy.yml is triggered manually until Azure secrets are configured.

Required GitHub Secrets:

AZURE_CREDENTIALS          β†’ Service principal JSON
REGISTRY_LOGIN_SERVER      β†’ e.g. businessagentregistry.azurecr.io
REGISTRY_USERNAME          β†’ ACR admin username
REGISTRY_PASSWORD          β†’ ACR admin password
AZURE_RESOURCE_GROUP       β†’ Resource group name
CONTAINER_APP_NAME         β†’ Container App name

Deploy:

GitHub β†’ Actions β†’ Build & Deploy to Azure Container Apps β†’ Run workflow

Messaging Endpoint (Azure Bot)

After deploy, set in Azure Bot Resource β†’ Settings β†’ Messaging endpoint:

https://<your-app>.azurecontainerapps.io/api/messages

πŸ“ Project Structure

BusinessAgent/
β”œβ”€β”€ api_server.py              ← Production entrypoint (FastAPI + Teams webhook)
β”œβ”€β”€ business_main.py           ← Local CLI for testing (not used in Azure)
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml         ← CI/CD to Azure Container Apps
└── Business/
    β”œβ”€β”€ config.py              ← Centralized configuration (env vars)
    β”œβ”€β”€ agents/
    β”‚   β”œβ”€β”€ base.py
    β”‚   β”œβ”€β”€ jira_agent.py
    β”‚   β”œβ”€β”€ docs_agent.py
    β”‚   β”œβ”€β”€ slides_agent.py
    β”‚   β”œβ”€β”€ architect_agent.py
    β”‚   β”œβ”€β”€ process_agent.py
    β”‚   β”œβ”€β”€ web_agent.py
    β”‚   β”œβ”€β”€ miro_agent.py
    β”‚   └── charts_agent.py
    β”œβ”€β”€ mcp/
    β”‚   β”œβ”€β”€ api_jira.py
    β”‚   β”œβ”€β”€ api_knowledge_base.py
    β”‚   β”œβ”€β”€ api_drawio.py
    β”‚   β”œβ”€β”€ api_powerpoint.py
    β”‚   β”œβ”€β”€ api_miro.py
    β”‚   β”œβ”€β”€ api_web.py
    β”‚   β”œβ”€β”€ api_charts.py
    β”‚   └── api_office_pdf.py
    β”œβ”€β”€ orchestrator/
    β”‚   └── chief_architect.py ← LangGraph supervisor (frysda persona)
    └── teams_bot/
        β”œβ”€β”€ bot.py             ← BusinessBot activity handler
        └── history_store.py   ← In-memory or CosmosDB history

frysda Β· Chief Business Architect Β· Powered by GPT-4o + LangGraph

Azure Deployment

  1. Push to main branch on GitHub
  2. Configure secrets in GitHub β†’ Settings β†’ Secrets and variables β†’ Actions
  3. Run the workflow manually: Actions β†’ Build & Deploy to Azure Container Apps β†’ Run workflow
  4. Get the Container App URL from Azure Portal
  5. Set in Azure Bot β†’ Configuration β†’ Messaging endpoint: https://<app-url>/api/messages
  6. Connect to Microsoft Teams channel in Azure Bot β†’ Channels

About

AI multi-agent for business

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages