An intelligent trading assistant powered by LangChain & LangGraph that integrates with OpenBB and Yahoo Finance for real-time market data. Supports multiple LLM providers: OpenAI, Google Gemini, Anthropic Claude, Perplexity, OpenRouter, and Ollama.
- 🤖 Multi-LLM Support: Choose between OpenAI, Google Gemini, Anthropic Claude, Perplexity, OpenRouter, or Ollama
- � Multi-Agent System: Separate data retrieval from analysis for better performance and clarity
- 📊 Real-time Market Data: Access stock quotes, historical data, news, and company profiles via OpenBB Tools (using Yahoo FInance & OECD as two main sources)
- 📈 Economic Indicators: Fetch GDP, CPI, and other economic data
- 💬 Conversational Interface: Natural language queries for financial data
- 🌟 Commodity Mapping: Automatic symbol resolution (Gold→XAU, Silver→XAG, etc.)
In order to install the application, first make sure you have git, conda installed.
Then, clone the source code from GitHub onto your local machine and navigate into the Trading-Assistant directory. Finally, use the provided environment.yaml file to create the conda environment.
git clone https://github.com/samarthiith/Trading-Assistant
cd Trading-Assistantconda env create -f envs/environment.yaml
conda activate tradingCopy the example environment file and add your API keys:
cp credentials/.env.example credentials/.envEdit .env and add your API keys:
- OpenAI: https://platform.openai.com/api-keys
- Google Gemini: https://makersuite.google.com/app/apikey
- Anthropic Claude: https://platform.claude.com/docs/en/api/admin/api_keys/retrieve
- Perplexity: https://www.perplexity.ai/settings/api
- OpenRouter: https://openrouter.ai/keys
Note: Ollama runs locally and doesn't require an API key.
Select the LLM model that you would like to us in the config.yaml.
Run the agent:
python agent_system.pyYou'll be prompted to choose between:
- Two-Agent System: Separate data retrieval and analysis
Example interaction with Two-Agent System:
🤖 Initializing Agent System with gemini...
✅ Agent System ready!
📡 Data Agent: Fetches market data
📊 Analysis Agent: Provides insights
You: What's the gold price trend?
[Agent processes with two-phase approach: data → analysis]
You: Get me the latest news about Tesla
[Agent retrieves TSLA news then analyzes sentiment]To run the Streamlit dashboard:
streamlit run dashboard.pyThe dashboard will open in your browser at http://localhost:8501. The app will enable you to interact in the chatbox.
In the sidebar, you can switch between:
- Two-Agent System: Separate data fetching and analysis
Modern architecture separating concerns:
graph TD
A[User Query] --> B[Orchestrator]
B --> C[Data Agent]
C -->|retrieves data via tools| D[Analysis Agent]
D -->|analyzes data| E[Combined Response]
Benefits:
- Clear separation between data and analysis
- Specialized prompts for each task
- Better debugging and transparency
- More accurate commodity symbol mapping
See MULTI-AGENT_SYSTEM.md for detailed documentation.
AGPLv3 License