- Overview
- Live demo
- Features
- Architecture
- Installation
- Usage
- API Endpoints
- Technologies Used
- Deployment
- Troubleshooting
- Contributing
ConsultAI Chat is a professional financial assistant web application designed to provide accurate, interactive, and real-time financial insights to users. The platform integrates advanced AI-powered natural language processing with data retrieval and visualization to deliver a seamless user experience. This repository contains the source code, technical documentation, and deployment details.
Access the Live Deployed Application
You can explore the deployed ConsultAI Chat application here:
👉 ConsultAI Chat Live Web Page
- Natural Language Query Processing:
- Extracts financial entities (e.g., company tickers) and identifies user intent using AI models.
- Dynamic API Integration:
- Integrates with multiple financial APIs to retrieve real-time data:
- Alpha Vantage: News sentiment, income statements, balance sheets, insider transactions.
- Yahoo Finance: Stock prices, historical trends, and analyst recommendations.
- Integrates with multiple financial APIs to retrieve real-time data:
- Retrieval-Augmented Generation (RAG):
- Dynamically selects APIs based on user queries to provide relevant and customized responses.
- Interactive Data Visualization:
- Displays financial data through user-friendly charts, graphs, and tables.
- Custom Insights:
- Combines raw data with AI-generated natural language summaries for actionable insights.
- Built with React Native and TypeScript.
- Deployed on GitHub Pages for lightweight hosting.
- Developed using Flask.
- Hosted on Heroku to manage real-time API requests and data processing.
- Alpha Vantage:
- News sentiment, financial statements, insider transactions.
- Yahoo Finance:
- Real-time stock prices, historical data, and analyst recommendations.
- Powered by OpenAI GPT models for natural language understanding and response generation.
- Python 3.8+
- Node.js 16+
- npm
- Git
git clone https://github.com/your-repo-name/consultai-chat.git
cd consultai-chat
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
-
Create a
.env
file with the following:ALPHAVANTAGE_API_KEY=your_alpha_vantage_key OPENAI_API_KEY=your_openai_key
-
-
Run the Flask server:
python app.py
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
- Open the application in your browser at
http://localhost:3000
. - Enter natural language queries, such as:
- “What are the latest insider trades for AAPL?”
- “Show me Tesla’s financial metrics for Q3 2023.”
- Review results:
- AI-generated summaries
- Interactive financial visualizations
/api/chat
: Processes user queries and retrieves financial insights./analyze
: Generates detailed financial analysis./stock/<ticker>
: Fetches stock-specific data.
Request:
GET /stock/AAPL
Response:
{
"price": {
"current": 172.34,
"change": "+1.23%",
"high": 173.45,
"low": 170.98
},
"news_sentiment": [
{
"source": "Motley Fool",
"title": "Why Apple Stock is a Buy in 2024",
"sentiment": "Positive"
}
]
}
- Alpha Vantage:
NEWS_SENTIMENT
: Retrieves news sentiment analysis for companiesINCOME_STATEMENT
: Provides income statements.BALANCE_SHEET
: Fetches balance sheet data.
- Yahoo Finance:
yf_price
: Real-time stock prices.yf_stock_graph
: Historical price trends and visualizations.
- Frontend:
- React Native
- TypeScript
- JavaScript
- Backend:
- Flask
- Python
- APIs:
- Alpha Vantage
- Yahoo Finance
- AI Models:
- OpenAI GPT (gpt-4, gpt-3.5-turbo)
-
GitHub Pages:
-
Run the following to deploy:
npm run deploy
-
-
Heroku:
-
Configured with a Procfile:
web: gunicorn app:app
- Environment variables managed through Heroku Config Vars.
-
- API Key Errors:
- Ensure API keys are correctly set up in the
.env
file.
- Ensure API keys are correctly set up in the
- CORS Issues:
- Verify the frontend and backend URLs are consistent with Flask CORS settings.
- Deployment Failures:
- Double-check dependencies and Heroku configurations
We welcome contributions! Follow these steps to contribute:
-
Fork this repository.
-
Create a new branch:
git checkout -b feature-name
-
Commit changes and push to your branch.
-
Open and pull request for review.
Thank you for using ConsultAI Chat!