Multi-Agent AI System with Phidata & Groq
A sophisticated multi-agent AI system that combines web search and financial analysis capabilities using the Phidata framework and Groq's high-performance language models.
🎯 Project Overview
This project demonstrates the implementation of specialized AI agents that work both independently and collaboratively to provide comprehensive information retrieval and financial analysis. Built with modern agentic AI principles, it showcases:
- Modular Agent Architecture: Separate agents for distinct tasks (web search, financial analysis)
- Multi-Agent Collaboration: Coordinated team of agents working together
- High-Performance Inference: Powered by Groq's LPU technology for ultra-low latency
- Interactive Playground: Local dashboard for testing and visualization
🏗️ Architecture
Agents
Web Search Agent
- Searches the web using DuckDuckGo
- Provides sourced information with citations
- Optimized for real-time information retrieval
Financial AI Agent
- Analyzes stock market data using YFinance
- Provides analyst recommendations and company fundamentals
- Retrieves latest company news and financial metrics
- Presents data in structured table formats
Multi AI Agent (Team Orchestrator)
- Coordinates both specialized agents
- Delegates tasks to appropriate agents
- Synthesizes responses from multiple sources
🚀 Features
- Dual Operation Modes:
financial_agent.py: CLI-based multi-agent systemplayground.py: Interactive web-based playground
- Real-time Processing: Leverages Groq's
llama-3.3-70b-versatilemodel for minimal latency - Tool Integration: DuckDuckGo for web search, YFinance for financial data
- Transparent Operations: Shows tool calls and reasoning process
- Markdown Formatting: Clean, readable output
📋 Prerequisites
- Python 3.8+
- Groq API Key
- Phidata API Key (for Playground features)
- OpenAI API Key (optional, for compatibility)
🛠️ Installation
Clone the repository
git clone https://github.com/Paruchuri-Rajesh/Finance_Analyst.git cd Finance_AnalystInstall dependencies
pip install -r requirements.txtSet up environment variables
Create a .env file in the project root:
GROQ_API_KEY=your_groq_api_key_here
PHI_API_KEY=your_phi_api_key_here
OPENAI_API_KEY=your_openai_api_key_here # Optional
💻 Usage
Option 1: CLI Multi-Agent System
Run the financial agent directly from the command line:
python financial_agent.py
This will execute a predefined query: "Summarize analyst recommendations and share the latest news for Apple Inc."
To customize the query, modify the last line in financial_agent.py:
multi_ai_agent.print_response("Your custom query here", stream=True)
Option 2: Interactive Playground
Launch the Phidata Playground dashboard:
python playground.py
Then open your browser to http://localhost:7777 to interact with the agents through a user-friendly interface.
Playground Features:
- Select individual agents or use both simultaneously
- Test queries in real-time
- View tool calls and agent reasoning
- Compare agent responses
📁 Project Structure
.
├── financial_agent.py # CLI-based multi-agent system
├── playground.py # Interactive playground dashboard
├── requirements.txt # Project dependencies
├── .env # Environment variables (create this)
└── README.md # Project documentation
🔧 Configuration
Agent Customization
Each agent can be customized by modifying its parameters:
agent = Agent(
name="Your Agent Name",
role="Agent's role description",
model=Groq(id="llama-3.3-70b-versatile"), # Change model
tools=[YourTools()], # Add/remove tools
instructions=["Custom instructions"], # Modify behavior
show_tool_calls=True, # Debug mode
markdown=True # Output format
)
Available Groq Models
llama-3.3-70b-versatile- Best balance of speed and capability (default)llama-3.1-8b-instant- Ultra-fast for simple queriesmixtral-8x7b-32768- Large context window
📊 Example Queries
Try these queries with the multi-agent system:
Financial Analysis:
- "What is the current stock price and P/E ratio for Tesla?"
- "Compare analyst recommendations for Apple and Microsoft"
- "Show me the latest news and fundamentals for NVIDIA"
Web Search:
- "What are the latest AI developments in 2026?"
- "Search for recent news about quantum computing"
Combined (Multi-Agent):
- "Summarize analyst recommendations and recent news for Amazon"
- "Find the stock price and latest developments for Google"
🔍 How It Works
- Query Reception: User submits a query via CLI or Playground
- Agent Selection: The multi-agent orchestrator determines which specialized agent(s) to use
- Tool Execution: Agents use their tools (DuckDuckGo, YFinance) to gather information
- LLM Processing: Groq's high-speed models process and synthesize the information
- Response Generation: Formatted response with sources and data tables
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Phidata - Agent orchestration framework
- Groq - High-performance LLM inference
- YFinance - Financial data provider
- DuckDuckGo - Privacy-focused web search
📧 Contact
For questions or feedback, please open an issue on GitHub.
Built using Phidata and Groq
Log in or sign up for Devpost to join the conversation.