╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ 🤖 AI AGENTS DEMO - PROGRESSIVE AI INTEGRATION IN .NET ║ ║ ║ ║ Presented at: Cyber RGV - October 8, 2025 ║ ║ By: Josh Morales (SelAromDotNet) ║ ║ ║ ║ 📚 Complete Presentation Resources: ║ ║ https://link.content360.io/dotnet2025oct ║ ║ ║ ║ 💬 Join Rio Grande Valley .NET User Group: ║ ║ https://rgvdevs.net ║ ║ Collaborate, learn, and join more sessions like this! ║ ║ ║ ╚══════════════════════════════════════════════════════════════════════════════╝
# AI Agents Demo - Progressive AI Integration in .NET
A comprehensive demonstration showcasing the evolution of AI integration patterns in .NET, from raw HTTP API calls to sophisticated stateful agents.
## 🎯 What You'll Learn
This repository demonstrates five progressive approaches to integrating AI into .NET applications:
1. **Demo 1: Direct API Calls** — The "Hard Way" - Raw HTTP requests to AI providers
2. **Demo 2: Semantic Kernel** — Provider abstraction and prompt orchestration
3. **Demo 3: Extensions.AI with DI** — Configuration-driven provider switching
4. **Demo 4: AutoGen** — Tool-enabled collaboration with function calling
5. **Demo 5: Agent Framework** — Stateful agents with persistent memory and tools
## 🚀 Quick Start
### Prerequisites
- .NET 8.0 SDK or later
- OpenAI API Key
- (Optional) Google Gemini API Key (used in Demo 1, simulated in Demo 3)
### Setup
1. Clone the repository
```bash
git clone https://github.com/selaromdotnet/dotnet-ai-demo.git
cd AIAgentsDemo
-
Configure API keys in each demo project
# Copy the example config and edit it (do not check into source control!) cp appsettings.example.json appsettings.json # Windows: copy appsettings.example.json appsettings.json
-
Run any demo
dotnet run --project src/Demo1.DirectAPI dotnet run --project src/Demo2.SemanticKernel dotnet run --project src/Demo3.ExtensionsAI dotnet run --project src/Demo4.AutoGen dotnet run --project src/Demo5.AgentFramework
Location: src/Demo1.DirectAPI/
- Raw HTTP requests to OpenAI and Gemini using
HttpClient - Provider-specific JSON structures and authentication
- Pain Point: Each provider requires custom code
- Limitation: Doesn't scale—manual work for every new provider
Location: src/Demo2.SemanticKernel/
- Uses Microsoft Semantic Kernel for provider abstraction
- Creates reusable prompt functions and orchestration
- Two-step AI workflow: analysis → response generation
- Limitation: Provider choice configured in code (requires rebuild)
Location: src/Demo3.ExtensionsAI/
- Dependency Injection with
Microsoft.Extensions.AI - Configuration-driven provider selection via
appsettings.json - Runtime provider switching without code changes
- A/B testing, cost optimization, disaster recovery patterns
- Limitation: AI hallucinates data it cannot access
Location: src/Demo4.AutoGen/
- Agent with C# tool/function calling via AutoGen
- Real data access eliminates hallucinations
- Function middleware for tool registration
- Limitation: Stateless by default—no conversation memory
Location: src/Demo5.AgentFramework/
- Stateful agents with
AgentThreadfor persistent memory - Multi-turn conversations with context retention
- Auto tool invocation with dependency injection
- Thread serialization for conversation persistence
- Strongly-typed function returns for reliable AI parsing
- Achievement: Production-ready pattern addressing all prior limitations
- ✨ Colored console output for better visualization
- 🔧 Standalone projects—run any demo independently
- ⚙️ Consistent
appsettings.jsonschema across demos - 📖 Educational narratives highlighting tradeoffs and limitations
- 🚀 Progressive complexity from basics to production patterns
- Microsoft.SemanticKernel 1.65.0 (Demos 2, 3, 5)
- Microsoft.SemanticKernel.Connectors.OpenAI 1.65.0 (Demos 2, 3, 5)
- Microsoft.Extensions.Configuration 8.0.x (All demos)
- Microsoft.Extensions.Hosting 8.0.1 (Demo 3)
- Microsoft.Extensions.AI 9.0.0-preview.9.24507.7 (Demo 3)
- Microsoft.Extensions.AI.OpenAI 9.0.0-preview.9.24507.7 (Demo 3)
- AutoGen 0.2.3 (Demo 4)
- AutoGen.OpenAI 0.2.3 (Demo 4)
- Microsoft.Agents.AI (Demo 5)
Contributions welcome! Please open a Pull Request with your improvements.
MIT License
If you find this helpful, please give it a star on GitHub!
Happy Learning! 🎉
From the Rio Grande Valley .NET Community