How microsoft/botbuilder-dotnet works
Project Type & Purpose
• This is a mono-repo containing a suite of .NET libraries that together form the Microsoft Bot Framework SDK.
• It is not a single runnable application but rather a set of NuGet-packaged components (core SDK, adapters, AI recognizers, integrations, parsers, generators, etc.) designed for building conversational bots.
• The README confirms the purpose: model conversation, connect to channels, use LUIS/QnA services, store state in Azure, generate language with LG, run tests, and publish packages.
High-Level File Structure
• Top‐level:
– Microsoft.Bot.Builder.sln (solution)
– Directory.Build.props, global.json, build scripts, CI/CD pipeline YAML under /build & /.github/workflows
– /libraries – each subfolder is one packaged library (e.g., Adapters.Facebook, AI.LUIS, Dialogs.Adaptive, Integration.AspNet.Core, LanguageGeneration, Parsers.LU, TemplateManager, etc.)
– /tests – parallel test projects exercising each library and sample/test bots
– /generators – code templates for bot projects
– /FunctionalTests – end-to-end tests using real channels/services
Key Components
• Core SDK (Microsoft.Bot.Builder)
• Adapters layer (Facebook, Slack, Twilio, Webex, TestAdapter)
• Connector & Streaming layer (Microsoft.Bot.Connector & Microsoft.Bot.Streaming)
• Dialog system (Microsoft.Bot.Builder.Dialogs and Dialogs.Adaptive, Dialogs.Declarative, Dialogs.Debugging, Dialogs.Testing)
• AI Recognizers (LUIS, QnA Maker, Orchestrator)
• Language Generation (LG – Microsoft.Bot.Builder.LanguageGeneration)
• Template Manager (Microsoft.Bot.Builder.TemplateManager)
• Parsers (Microsoft.Bot.Builder.Parsers.LU)
• Integrations (ApplicationInsights, AspNet.Core, AspNet.WebApi, Azure Storage & Blobs, Queues)
• BotState & Storage (in-memory, Azure Blob/Cosmos/Queue storage)
• External cloud services: Azure Bot Service, LUIS endpoint, QnA Maker service, Application Insights, Azure Blob/CosmosDB
• CI/CD pipelines and package feeds (Azure Artifacts, MyGet)
Relationships & Interactions
• A Bot App → uses the BotFrameworkAdapter (in Integration.AspNet.Core/WebApi)
• Adapter → routes incoming HTTP/streaming requests to BotAdapter core → fires TurnContext → Bot logic (Dialogs)
• Dialogs read/write BotState → pass through Storage implementations (Memory, Azure Blobs/Queues, Cosmos)
• Dialogs can call Recognizers → HTTP calls to LUIS, QnA Maker, Orchestrator
• Responses pass through LanguageGeneration to produce rich messages
• Adapters serialize Activity objects via Connector/Streaming libraries
• Telemetry middleware sends events to ApplicationInsights
• CI/CD build scripts assemble outputs and publish NuGet packages
Architectural Patterns & Principles
• Modular, package-per-concern design (“libraries” directory)
• Dependency Injection / BotComponent registration for extensibility
• Adapter pattern for channel abstraction
• Decorator/Middleware pattern for Turn pipeline (logging, telemetry, storage)
• Declarative configuration and templates for bots and dialogs
• Separation of concerns: core, dialogs, AI, adapters, storage, integrations
Essential Elements to Capture
• Clear component names matching folder or package names
• A note on CI/CD and package publishing pipelines for completeness
• Keep it detailed but readable: group dozens of low-level test projects under “/tests” aggregate
• Top: Bot Application (developer’s code)
• Next: Integration layer (HTTP/Streaming Adapters)
• Core: Microsoft.Bot.Builder + Dialog modules + Middleware
• AI: Recognizers calling LUIS/QnA/Orchestrator
• Storage: BotState with Memory or Azure stores
• Generation: LG & TemplateManager
• Underpinning: Connector/Streaming, Parsers.LU
• Side: CI/CD pipeline, package outputs
• Clouds: Azure services, MyGet/Azure Artifacts feeds