TaskAgent - AI Task Management Platform
Production-ready AI agent platform with .NET 10, Next.js 16, Microsoft Agent Framework, Azure OpenAI, AG-UI protocol with SSE streaming, dual-database architecture, 225+ tests, and enterprise-grade observability with OpenTelemetry + Serilog.
Overview
Enterprise-grade AI-powered task management platform built with .NET 10 and Microsoft Agent Framework. Implements autonomous AI agents with Azure OpenAI GPT-4o-mini, featuring Clean Architecture across 4 layers, AG-UI protocol with Server-Sent Events (SSE) for real-time streaming, production observability with .NET Aspire + Application Insights + Serilog, and Azure OpenAI built-in content filtering. Includes modern Next.js 16 frontend with ChatGPT-inspired UI and dark theme support, dual-database persistence (SQL Server + PostgreSQL), comprehensive testing infrastructure (225+ tests with xUnit, Vitest, and Playwright), and 5-part C# Corner article series (6k+ views).
Technologies & Tools
Live Demo

Animated demo showing the application in action
Architecture & System Design

.NET Aspire Dashboard overview with OpenTelemetry traces and service health monitoring

System architecture: Next.js frontend, .NET 10 backend, dual-database (SQL Server + PostgreSQL), Azure OpenAI

Clean Architecture with strict dependency flow: Domain → Application → Infrastructure → WebApi

AG-UI protocol with custom SSE events for real-time streaming and progressive rendering
Application Screenshots

ChatGPT-inspired chat interface with real-time SSE streaming, conversation sidebar, and AI suggestions

AG-UI SSE events in browser DevTools: real-time streaming with STEP_STARTED, STATUS_UPDATE, TOOL_CALL events

Azure OpenAI content filtering with ChatGPT-like blocked message UX
Key Features
- 1Autonomous AI agents with Microsoft Agent Framework and 6 function tools (Create, List, Update, Delete, GetDetails, GetSummary)
- 2AG-UI Protocol implementation with custom SSE streaming: STEP_STARTED, STATUS_UPDATE, TEXT_MESSAGE_CONTENT, TOOL_CALL events
- 3Dynamic status messaging via FunctionDescriptionProvider - auto-generated from [Description] attributes for multi-agent scalability
- 4Clean Architecture: Domain (NO dependencies) → Application → Infrastructure → WebApi with strict dependency flow
- 5Production-grade observability: .NET Aspire Dashboard (dev) + Application Insights (prod) with OpenTelemetry + Serilog centralized logging
- 6Custom telemetry: AgentMetrics (counters, histograms) + AgentActivitySource (distributed tracing) for AI operations
Challenges & Solutions
AG-UI Protocol Implementation with Custom SSE Streaming
Challenge: Standard REST APIs cannot provide real-time feedback during AI processing. Users needed ChatGPT-like progressive rendering with step lifecycle events (STEP_STARTED/STEP_FINISHED), dynamic status messages, and seamless thread state persistence. The AG-UI standard /agui endpoint was too rigid for custom event types.
Solution: Implemented custom AG-UI endpoint POST /api/agent/chat with Server-Sent Events (SSE) streaming. Created SseStreamingService with 10 event types: STEP_STARTED, STATUS_UPDATE, STEP_FINISHED, TEXT_MESSAGE_START/CONTENT/END, TOOL_CALL_START/RESULT, CONTENT_FILTER, THREAD_STATE. Built FunctionDescriptionProvider to auto-generate status messages from [Description] attributes (e.g., "Creates a new task..." → "Creating task..."). Frontend receives serializedState after each response for PostgreSQL persistence. Result: Real-time ChatGPT-like UX with <50ms latency per chunk, multi-agent ready architecture.
Production-Grade Observability with Centralized Logging
Challenge: AI agent systems require visibility into model performance, function calling patterns, and error tracking across distributed services. Traditional logging was insufficient for debugging complex AI interactions, token usage, and response latencies in production. Needed hybrid solution for local development (real-time) and cloud production (long-term retention) with centralized logging.
Solution: Implemented hybrid observability architecture with .NET Aspire 13.0 + OpenTelemetry + Serilog. Created custom instrumentation: AgentMetrics (counters for requests/errors, histogram for response duration) and AgentActivitySource (distributed tracing with thread.id, function.name, message.length tags). Serilog with console, file, and OpenTelemetry sinks for centralized logging. Environment-aware telemetry exports to OTLP → Aspire Dashboard (dev) or Azure Monitor → Application Insights (prod). Result: Real-time debugging in Aspire Dashboard with live traces/metrics, structured logs with correlation IDs.
Content Safety Migration from Custom SDK to Built-in Filtering
Challenge: Initial implementation used custom Azure.AI.ContentSafety SDK with 2-layer defense (Prompt Shield + Content Moderation), adding ~500 lines of code, extra Azure resource costs, and maintenance overhead. Azure OpenAI's built-in content filtering already covered hate/violence/sexual/self-harm detection and jailbreak prevention.
Solution: Migrated to Azure OpenAI built-in content filtering, removing custom middleware. Created CONTENT_FILTER SSE event to handle HTTP 400 with code: "content_filter" gracefully. Implemented ChatGPT-like UX where blocked messages appear as assistant responses (not error toasts), preserving thread continuity. Key insight: blocked content is NEVER persisted in database (security measure). Result: Removed ~500 lines of code, eliminated separate Content Safety resource costs, simpler configuration, same protection level.
Project Information
Timeline
Started: Aug 2024
Ongoing
Role
Full Stack Developer
Project Metrics
4
Architecture Layers
6
AI Functions
5
Article Series
225+
Total Tests
2
Databases
131
Backend Tests