A sophisticated multi-agent AI system that leverages Groq's LLM models and Tavily search capabilities to provide intelligent financial analysis and responses through a modern web interface.
- Multi-Model Support: Choose from different Groq LLM models including Llama3 variants
- Web Search Integration: Powered by Tavily for real-time information retrieval
- Customizable AI Agents: Define your own system prompts for specialized financial analysis
- Modern Web Interface: Built with Streamlit for an intuitive user experience
- RESTful API: FastAPI backend for seamless integration and scalability
- Real-time Logging: Comprehensive logging system for monitoring and debugging
The project follows a modular architecture with clear separation of concerns:
app/
├── backend/ # FastAPI REST API server
├── frontend/ # Streamlit web interface
├── core/ # AI agent logic and LLM integration
├── config/ # Configuration and environment settings
└── common/ # Shared utilities and logging
This comprehensive README.md includes:
- Project Overview: Clear description of what the project does
- Features: Key capabilities and highlights
- Architecture: Project structure and design
- Technology Stack: All major dependencies and frameworks
- Installation: Step-by-step setup instructions
- Usage: How to run and use the application
- Configuration: Environment variables and settings
- API Documentation: Endpoint details and examples
- Development Guide: How to contribute and extend the project
- Support: Troubleshooting and help resources
The README is now much more informative and professional, providing users and developers with everything they need to understand, install, and use your Multi-AI Finance Agent project.
- Backend: FastAPI, Uvicorn
- Frontend: Streamlit
- AI/LLM: LangChain, Groq API, LangGraph
- Search: Tavily Search API
- Python: 3.8+
- Package Management: uv
- Python 3.8 or higher
- Groq API key
- Tavily API key (optional, for web search functionality)
-
Clone the repository
git clone <repository-url> cd Multi-AI-Finance-Agent
-
Create and activate virtual environment
python -m venv .venv # On Windows .venv\Scripts\activate # On macOS/Linux source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables Create a
.envfile in the project root:GROQ_API_KEY=your_groq_api_key_here TAVILY_API_KEY=your_tavily_api_key_here
The simplest way to run the application:
python -m app.mainThis command will:
- Start the FastAPI backend server on
http://127.0.0.1:9999 - Launch the Streamlit frontend interface
- Automatically open your default web browser
You can also run the services separately:
Backend (FastAPI)
uvicorn app.backend.api:app --host 127.0.0.1 --port 9999Frontend (Streamlit)
streamlit run app/frontend/ui.pyThe system currently supports the following Groq models:
llama3-70b-8192llama-3.3-70b-versatile
| Variable | Description | Required |
|---|---|---|
GROQ_API_KEY |
Your Groq API key for LLM access | Yes |
TAVILY_API_KEY |
Your Tavily API key for web search | No (but required for search functionality) |
The Streamlit interface provides:
- System Prompt Configuration: Define custom AI agent behavior
- Model Selection: Choose from available Groq models
- Web Search Toggle: Enable/disable real-time information retrieval
- Query Input: Large text area for detailed financial questions
- Real-time Responses: Instant AI-generated responses with markdown support
Send queries to the AI agent:
{
"model_name": "llama3-70b-8192",
"system_prompt": "You are a financial analyst expert...",
"messages": ["What are the current market trends?"],
"allow_search": true
}app/main.py: Main entry point and service orchestrationapp/backend/api.py: FastAPI application and endpointsapp/frontend/ui.py: Streamlit user interfaceapp/core/ai_agent.py: AI agent logic and LLM integrationapp/config/settings.py: Configuration managementapp/common/: Shared utilities, logging, and exception handling
- New Models: Add to
ALLOWED_MODEL_NAMESinsettings.py - New Tools: Extend the tools list in
ai_agent.py - New Endpoints: Add routes in
api.py - UI Components: Extend the Streamlit interface in
ui.py
The application includes comprehensive logging:
- Log files are stored in the
logs/directory - Automatic log rotation with date-based naming
- Different log levels for development and production
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the logs in the
logs/directory - Verify your API keys are correctly set
- Ensure all dependencies are installed
- Check the FastAPI docs at
http://127.0.0.1:9999/docs
- Additional LLM providers (OpenAI, Anthropic, etc.)
- Advanced financial analysis tools
- Real-time market data integration
- Multi-user support and authentication
- API rate limiting and usage analytics
- Docker containerization
- Kubernetes deployment support
Built with ❤️ using FastAPI, Streamlit, and LangChain