Skip to content

A multi-agent AI system for web search and financial data analysis using the phi library. Features dedicated agents for web queries and financial insights, accessible via a web playground or script.

Notifications You must be signed in to change notification settings

Adonpm/Financial-Agentic-AI-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Financial Agentic AI App πŸ€–πŸ’°

Deploy to Render Docker FastAPI Python

A sophisticated multi-agent AI system that combines web search capabilities with comprehensive financial analysis. Built using FastAPI and the Phi framework, this application leverages multiple AI agents to provide intelligent financial insights and research.

πŸš€ Live Demo

Application URL: [https://financial-agentic-ai-app.onrender.com/]

✨ Features

πŸ” Multi-Agent Architecture

  • Web Search Agent: Powered by DuckDuckGo for real-time web information
  • Financial Analysis Agent: Advanced financial data analysis using YFinance
  • Multi-Agent Orchestration: Combines both agents for comprehensive responses

πŸ“Š Financial Capabilities

  • Real-time stock prices and market data
  • Analyst recommendations and ratings
  • Company fundamentals analysis
  • Latest financial news and updates
  • Tabular data presentation for better readability

🌐 Web Interface

  • Clean, responsive UI built with HTML/CSS/JavaScript
  • Real-time query processing
  • Markdown-formatted responses
  • Mobile-friendly design

πŸ—οΈ Architecture

Financial-Agentic-AI-App/
β”œβ”€β”€ app.py                 # Main FastAPI application
β”œβ”€β”€ playground.py          # Alternative Phi playground interface
β”œβ”€β”€ Dockerfile             # Docker containerization
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ .env                   # Environment variables (not tracked)
β”œβ”€β”€ templates/
β”‚   └── index.html         # Frontend template
β”œβ”€β”€ static/css/
β”‚   └── styles.css         # Application styling
└── .github/
    └── workflows/
        └── deploy.yml     # CI/CD pipeline

🐳 Docker Support

Build and Run Locally

# Build the Docker image
docker build -t financial-ai-app .

# Run the container
docker run -p 7860:7860 --env-file .env financial-ai-app

πŸš€ Deployment

Render Deployment

This application is configured for automatic deployment on Render with:

  • Automatic builds from GitHub
  • Environment variable management
  • Health checks and monitoring
  • SSL certificate provisioning

CI/CD Pipeline

  • Continuous Integration: Automated testing and linting
  • Continuous Deployment: Auto-deploy to Render on main branch updates
  • Docker Integration: Containerized deployment for consistency

βš™οΈ Installation & Setup

Prerequisites

  • Python 3.9+
  • Docker (optional)
  • Git

Local Development

  1. Clone the repository

    git clone https://github.com/Adonpm/Financial-Agentic-AI-App.git
    cd Financial-Agentic-AI-App
  2. Set up virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    cp .env.example .env
    # Edit .env with your API keys
  5. Run the application

    python app.py
  6. Access the application

    • Open your browser to http://localhost:7860

Environment Variables

Create a .env file with the following variables:

GROQ_API_KEY=your_groq_api_key_here
PHI_API_KEY=your_phi_api_key_here 

πŸ”§ API Endpoints

Main Endpoints

  • GET / - Home page with web interface
  • POST /query - Submit queries to the multi-agent system

API Usage Example

import requests

response = requests.post("http://localhost:7860/query", 
                        json={"query": "What's the current stock price of AAPL?"})
print(response.json())

πŸ€– Agent Capabilities

Web Search Agent

  • Real-time web information retrieval
  • Source attribution and verification
  • DuckDuckGo integration for privacy-focused search

Financial Analysis Agent

  • Stock Data: Real-time prices, historical data, technical indicators
  • Fundamentals: P/E ratios, market cap, financial statements
  • News: Company-specific news and market updates
  • Recommendations: Analyst ratings and price targets

Multi-Agent Coordination

  • Intelligent query routing
  • Cross-agent information synthesis
  • Comprehensive response generation

πŸ› οΈ Technology Stack

  • Backend: FastAPI, Python 3.9+
  • AI Framework: Phi (Multi-agent orchestration)
  • LLM: Groq (Llama 3.3 70B)
  • Financial Data: YFinance API
  • Web Search: DuckDuckGo API
  • Frontend: HTML5, CSS3, JavaScript
  • Containerization: Docker
  • Deployment: Render
  • CI/CD: GitHub Actions

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Add tests for new features
  • Update documentation as needed
  • Ensure Docker builds successfully

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support & Issues

  • Issues: GitHub Issues
  • Documentation: This README and inline code comments
  • Community: Feel free to reach out for questions or suggestions

πŸ™ Acknowledgments

πŸ“Š Project Status

  • βœ… Core functionality implemented
  • βœ… Docker containerization complete
  • βœ… CI/CD pipeline configured
  • βœ… Production deployment on Render
  • πŸ”„ Ongoing improvements and feature additions

Built with ❀️ by Adonpm

For the latest updates and announcements, please star ⭐ this repository!

About

A multi-agent AI system for web search and financial data analysis using the phi library. Features dedicated agents for web queries and financial insights, accessible via a web playground or script.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •