A comprehensive Natural Language Cross-Platform Data Query System for wealth portfolio management, specifically designed for high net worth individuals including film stars and sports personalities with 100+ crore investments.
- Natural Language Processing: Query complex portfolio data using plain English
- Multi-Database Integration: Seamlessly connects MongoDB (client profiles) and MySQL (transactions)
- AI-Powered Analytics: LangChain-powered RAG system for intelligent responses
- Real-time Visualizations: Interactive charts and graphs using Chart.js
- Modern UI: Beautiful, responsive interface built with React and Tailwind CSS
- "What are the top five portfolios of our wealth members?"
- "Give me the breakup of portfolio values per relationship manager."
- "Tell me the top relationship managers in my firm"
- "Which clients are the highest holders of [specific stock]?"
- Risk distribution analysis across portfolios
- Portfolio concentration and diversification metrics
- FastAPI: High-performance API framework
- LangChain: RAG implementation with Cohere integration
- MongoDB: Client profiles and portfolio holdings
- MySQL: Transaction data and trading history
- ChromaDB: Vector database for domain knowledge
- Authentication: JWT-based security system
- React 18: Modern component-based UI
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Chart.js: Interactive data visualizations
- Axios: API communication
- React Router: Navigation and routing
// clients collection
{
client_id: "CL001",
name: "Client Name",
type: "Film Star" | "Sports Personality",
risk_appetite: "Conservative" | "Moderate" | "Aggressive",
total_portfolio_value: 15000000000, // 150 crores
relationship_manager_id: "RM001",
// ... other fields
}
// portfolio_holdings collection
{
client_id: "CL001",
stock_symbol: "RELIANCE",
stock_name: "Reliance Industries",
quantity: 50000,
current_value: 120000000,
// ... other fields
}-- transactions table
CREATE TABLE transactions (
id INT PRIMARY KEY AUTO_INCREMENT,
client_id VARCHAR(50) NOT NULL,
transaction_type VARCHAR(20) NOT NULL, -- BUY/SELL
stock_symbol VARCHAR(20) NOT NULL,
quantity INT NOT NULL,
price DECIMAL(10,2) NOT NULL,
total_amount DECIMAL(15,2) NOT NULL,
transaction_date DATETIME NOT NULL,
relationship_manager_id VARCHAR(20) NOT NULL
);- Python 3.8+
- Node.js 16+
- MongoDB
- MySQL
- Cohere API Key
# Navigate to backend directory
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
# Setup environment variables
cp .env.example .env
# Edit .env with your database URLs and Cohere API key
# Run the application
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm start# MongoDB (using Docker)
docker run -d -p 27017:27017 --name mongodb mongo:latest
# MySQL (using Docker)
docker run -d -p 3306:3306 --name mysql \
-e MYSQL_ROOT_PASSWORD=password \
-e MYSQL_DATABASE=wealth_transactions \
mysql:8.0The system includes a simple authentication system with three demo roles:
- admin/admin123: Full access to all features
- manager/manager123: Portfolio management access
- analyst/analyst123: Read-only analytics access
- Track and analyze 100+ crore portfolios for celebrities
- Monitor risk distribution across client segments
- Relationship manager performance tracking
- Asset allocation optimization
- Portfolio concentration analysis
- Risk appetite alignment checking
- Diversification metrics
- Regulatory compliance monitoring
- Top performing portfolios identification
- Client segmentation by investment patterns
- Historical performance tracking
- Custom reporting and insights
- Domain-specific knowledge base in ChromaDB
- Contextual query understanding
- Multi-source data fusion
- Intelligent response generation
- Real-time portfolio charts
- Risk distribution visualizations
- Performance trend analysis
- Interactive dashboards
- Complex query parsing
- Intent recognition
- Context-aware responses
- Conversational memory
- Async database connections
- Connection pooling
- Efficient query patterns
- Caching strategies
- JWT authentication
- CORS protection
- Input validation
- SQL injection prevention
- Microservices architecture
- Database abstraction layers
- Horizontal scaling support
- Load balancing ready
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test# Backend
cd backend
docker build -t wealth-portfolio-backend .
# Frontend
cd frontend
npm run build- Enhanced context management
- Improved scalability
- Better multi-modal support
- Advanced reasoning capabilities
- Real-time market data integration
- Automated portfolio rebalancing
- Advanced risk modeling
- Mobile application
- API rate limiting
- Advanced caching
- Multi-tenant support
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with โค๏ธ for the wealth management industry