Investment Agent
AI-Powered Stock Analysis with Semantic Kernel & Prompty AI POC
๐ Project Overview
A comprehensive .NET 10 Aspire application demonstrating how to build intelligent investment analysis systems using Microsoft's Semantic Kernel and Prompty. This project showcases:
- Stock Data Integration - Real-time stock market data via REST APIs
- AI Analysis - LLM-powered investment insights and recommendations
- Prompty Integration - Modern prompt management and orchestration
- MCP Server - Model Context Protocol for AI tool integration
- Complete Architecture - AppHost, API, Web, and Worker services
- Storage Emulation - Local Azure Storage emulation for development
๐ฏ Key Features
-
๐
Real-time Stock Data - Fetch and analyze current stock market data
-
๐ค
AI-Powered Analysis - Semantic Kernel for intelligent investment recommendations
-
๐
Prompty Files - Declarative prompt management with YAML configuration
-
โ๏ธ
Background Processing - Worker Service for async analysis tasks
-
๐
Web Dashboard - Interactive Blazor UI for viewing analysis results
-
๐
MCP Integration - AI tool support for Claude and other LLMs
-
๐พ
Local Storage Emulation - Azure Storage emulator for development
-
๐งช
Comprehensive Testing - Unit and integration tests included
๐๏ธ Architecture
Project Structure
Built as a complete .NET Aspire solution with multiple services:
Aspire orchestration and service coordination
REST API with stock data and analysis endpoints
Interactive Blazor Web App dashboard
Background processing with queue integration
Model Context Protocol server for LLM integration
Stock market data integration layer
Data Flow
- Data Ingestion โ Fetch stock data from external APIs
- Processing โ Analyze with Semantic Kernel and Prompty
- Storage โ Persist results to Azure Storage
- Presentation โ Display via Blazor dashboard and REST API
- AI Integration โ Expose capabilities via MCP for LLM tools
API Endpoints
GET /api/stocks- List available stocksGET /api/stocks/{symbol}- Get stock details and analysisPOST /api/analysis- Request AI analysis of stocksGET /api/analysis/{id}- Retrieve analysis resultsWebSocket endpoints- Real-time updates for stock data
๐ก Technology Stack
.NET Stack
.NET 10 ASP.NET Core Blazor Web App Minimal APIs
AI & LLM
Semantic Kernel Prompty Azure OpenAI MCP Protocol
Cloud & Data
.NET Aspire Azure Storage Queue Services Service Bus
Testing & Tools
.NET Testing xUnit Integration Tests Storage Emulator
๐ Implementation Highlights
Prompty Integration
- Declarative prompt files with
.promptyextension - YAML-based configuration for models and parameters
- Seamless integration with Semantic Kernel
- Environment variable support for API keys and endpoints
- Sample prompts included for stock analysis workflows
Semantic Kernel Usage
- Multiple model support (Azure OpenAI, local models)
- Function composition for complex analysis pipelines
- Plugin architecture for extending capabilities
- Context management for conversation continuity
- Built-in error handling and retries
Aspire Orchestration
- Service discovery for inter-service communication
- Local storage emulation setup
- Health checks and diagnostics
- Environment configuration management
- Ready for cloud deployment
Background Processing
- Worker Service for async analysis tasks
- Queue-based task processing
- Distributed processing patterns
- Long-running operation support
MCP Server Implementation
- Complete MCP protocol support
- Tool definitions for AI use
- Integration with Claude and ChatGPT
- Natural language command support
- Real-time data access from LLM context
๐ Real-World Use Cases
Portofolio Analysis
AI-powered analysis of investment portofolios with personalized recommendations
Market Sentiment
Analyze market trends and sentiment using real-time stock data
Risk Assessment
LLM-based risk evaluation of investments and trading strategies
AI Assistant
Natural language interface to investment data via Claude or ChatGPT
๐ What This Project Demonstrates
This Investment Agent is a professional portofolio piece showcasing:
- โ Modern .NET Development - .NET 10, Aspire, latest frameworks
- โ AI Integration - Semantic Kernel, Prompty, Azure OpenAI
- โ Full-Stack Architecture - Backend, Frontend, Services
- โ Real-World Integration - Stock APIs, market data
- โ LLM Integration - MCP server for AI tool use
- โ Cloud-Native Patterns - Aspire, storage, queues
- โ Production Patterns - Testing, error handling, monitoring
- โ Async Processing - Worker services, background jobs