A modern web application for financial insights powered by AI agents. Smart Assist provides an intuitive chat interface to analyze portfolios, calculate returns, assess risk, and get expert financial advice.
Smart Assist is a full-stack application that combines:
- Frontend: React + TypeScript chat interface
- Backend: FastAPI REST API with WebSocket support
- Agent System: Multi-agent analysis engine
- Database: MSSQL for financial data storage
# 1. Start Backend
cd backend
pip install -r requirements.txt
python main.py
# 2. Start Frontend (new terminal)
cd frontend
npm install
npm run dev
# 3. Open browser
# Navigate to: http://localhost:3000Smart_assitant/
├── backend/ # FastAPI Backend
│ ├── main.py # API application
│ ├── requirements.txt # Python dependencies
│ ├── .env.example # Environment template
│ └── README.md # Backend documentation
│
├── frontend/ # React Frontend
│ ├── src/
│ │ ├── App.tsx # Main component
│ │ ├── App.css # Styles
│ │ └── main.tsx # Entry point
│ ├── package.json # Node dependencies
│ ├── vite.config.ts # Vite configuration
│ └── README.md # Frontend documentation
│
├── financial-insights-agents/ # Agent System
│ ├── agents/ # AI agents
│ ├── mcp_servers/ # MCP servers
│ ├── core/ # Core utilities
│ ├── database/ # Database schemas
│ └── README.md # Agent documentation
│
└── docs/ # Documentation
├── azure-deployment-guide.md # Azure setup
└── local-development.md # Local dev guide
- Real-time messaging with AI agents
- Session management
- Message history
- Beautiful, responsive UI
- Mobile-friendly design
- REST endpoints for chat
- WebSocket support for streaming
- Session persistence
- Health monitoring
- CORS enabled
- SQL Agent: Natural language to SQL queries
- Data Analyst Agent: Statistical analysis
- Domain Expert Agent: Domain insights
- Multi-agent orchestration
- Portfolio performance tracking
- Risk assessment
- Return calculations
- Market comparisons
- Sector analysis
- Local Development Guide - Setup and run locally
- Backend README - Backend API documentation
- Frontend README - Frontend documentation
- Azure Deployment Guide - Complete Azure setup
- Prerequisites and requirements
- Step-by-step deployment
- Debugging and troubleshooting
- Cost optimization
- Security best practices
- Analysis Agents - Agent architecture
- React 18 - UI library
- TypeScript - Type safety
- Vite - Build tool
- Axios - HTTP client
- Lucide React - Icons
- FastAPI - Modern Python web framework
- Uvicorn - ASGI server
- WebSockets - Real-time communication
- Pydantic - Data validation
- Microsoft Agent Framework - Agent orchestration
- Claude via Azure AI Foundry - LLM
- MSSQL - Database
- MCP - Model Context Protocol
- Azure App Service - Backend hosting
- Azure Static Web Apps - Frontend hosting
- Azure SQL Database - Data storage
- Azure AI Foundry - AI/ML services
- Application Insights - Monitoring
┌─────────────────────────────────────────────────────────┐
│ User Browser │
│ (React Frontend) │
└─────────────────┬───────────────────────────────────────┘
│ HTTP/WebSocket
▼
┌─────────────────────────────────────────────────────────┐
│ FastAPI Backend │
│ (REST API + WebSocket) │
└─────────────────┬───────────────────────────────────────┘
│
┌─────────┴──────────┬────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ SQL Agent │ │Data Analyst │ │Domain Expert │
│ │ │ Agent │ │ Agent │
└──────┬───────┘ └──────┬───────┘ └──────────────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ MSSQL Database │
│ (Financial Data Storage) │
└──────────────────────────────────┘
GET /- Root endpoint with API infoGET /health- Health checkPOST /api/chat- Send chat messageGET /api/sessions- List all sessionsGET /api/sessions/{id}- Get session historyDELETE /api/sessions/{id}- Delete session
WS /ws/chat/{session_id}- Real-time chat
API documentation available at: http://localhost:8000/docs
Ask Smart Assist questions like:
- "What is my portfolio's total return over the last year?"
- "Calculate the Sharpe ratio for my holdings vs S&P 500"
- "Show me the top 5 performing stocks in my portfolio"
- "What is my portfolio's risk exposure by sector?"
- "Compare my returns against market benchmarks"
- Python 3.11+
- Node.js 18+
- Git
- Azure Account (for deployment)
- MSSQL Server (for full agent functionality)
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your settings
# Run server
python main.pyBackend runs at: http://localhost:8000
cd frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env (default points to localhost:8000)
# Run development server
npm run devFrontend runs at: http://localhost:3000
For full agent functionality with real financial data:
# Using Docker
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong@Password" \
-p 1433:1433 --name mssql-server \
-d mcr.microsoft.com/mssql/server:2022-latest
# Create database and load schema
cd financial-insights-agents/database/sample_schema
sqlcmd -S localhost -U sa -P YourPassword -i create_tables.sql
sqlcmd -S localhost -U sa -P YourPassword -i seed_data.sqlComplete deployment instructions available in Azure Deployment Guide
Quick overview:
- Create Azure resources (App Service, Static Web App, SQL Database)
- Deploy backend to App Service
- Deploy frontend to Static Web Apps
- Configure environment variables
- Set up monitoring
# Test backend
curl http://localhost:8000/health
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello"}'
# Test frontend
# Open browser: http://localhost:3000Create backend/.env:
API_HOST=0.0.0.0
API_PORT=8000
ENVIRONMENT=development
DEBUG=true
# Optional: Database
MSSQL_SERVER=localhost
MSSQL_DATABASE=financial_insights_db
MSSQL_USERNAME=sa
MSSQL_PASSWORD=YourPassword
# Optional: Azure AI
AZURE_AI_PROJECT_CONNECTION_STRING=your-connection-string
AZURE_OPENAI_ENDPOINT=your-endpointCreate frontend/.env:
VITE_API_URL=http://localhost:8000cd backend
source venv/bin/activate
python main.py # Auto-reload enabledEdit files in backend/ - server auto-restarts
cd frontend
npm run dev # Hot reload enabledEdit files in frontend/src/ - browser auto-updates
# Backend
cd backend
black . # Format
flake8 . # Lint
mypy . # Type check
# Frontend
cd frontend
npm run lint # ESLint
npm run build # Type check- Check logs in console
- Use Swagger UI:
http://localhost:8000/docs - Enable debug mode in
.env
- Open browser DevTools (F12)
- Check Console tab for errors
- Check Network tab for API calls
- Use React DevTools extension
See Local Development Guide for solutions to:
- Port conflicts
- CORS errors
- Module not found
- Database connection issues
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Use type hints (Python) and TypeScript
- Add tests for new features
- Update documentation
- Follow existing code style
- Keep commits atomic
- Never commit
.envfiles - Use strong passwords
- Enable HTTPS in production
- Implement authentication
- Regular dependency updates
- Follow security best practices
- Backend uses async/await for concurrency
- Frontend implements lazy loading
- Database uses connection pooling
- Caching for frequently accessed data
- Optimized bundle size
- Backend logs to console
- Frontend uses browser console
- API docs at
/docs
- Application Insights for telemetry
- Azure Monitor for infrastructure
- Custom logging
- Performance metrics
- Error tracking
- ✅ Chat interface
- ✅ Session management
- ✅ REST API
- ✅ WebSocket support
- ✅ Basic agent responses
- 🚧 Full agent integration
- 🚧 Authentication
- 🚧 User profiles
- 🚧 Chart visualizations
- 🚧 Export functionality
- 🚧 Advanced analytics
- 📋 Real-time collaboration
- 📋 Mobile apps
- 📋 Voice interface
- 📋 Custom dashboards
- 📋 Advanced reporting
- Check documentation
- Review issues
- Read code comments
- Test with example queries
MIT License - See LICENSE file for details
- Microsoft Agent Framework
- Anthropic Claude
- FastAPI framework
- React community
- Azure services
Version: 1.0.0 Status: Active Development Last Updated: December 2025
Built with ❤️ for financial insights