Merged
Conversation
- add a new endpoint that recieves a company name - uses 3 agents the first agent being DuckDuckGo that searches the web for market news - a yahoo finances tool that searches Yahoo finance for information - an agent that manages the above 2 agents that summarizes the information - support http streaming to respond back with summary
…h task It did not make sense to use one model for 4 agents. We use the smaller models for the web search, the medium one for fetching financial info from yahoo, and the Grok 4 model for reasoning. The coordinator also uses a medium sized model as it's not doing the thinking.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces an agentic workflow for investment analysis by adding a new FastAPI endpoint that leverages multiple specialized AI agents to provide comprehensive stock analysis. The system uses three coordinated agents (market research, financial data, and investment analysis) that work together to generate detailed investment recommendations with streaming HTTP responses.
- Implements a multi-agent AI system using the
agnoframework with xAI models for different agent roles - Adds streaming investment analysis endpoint that accepts stock ticker symbols as input
- Integrates web search capabilities via DuckDuckGo and financial data retrieval through YFinance APIs
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds dependencies for AI agents, financial data, and web search functionality |
| app/utils.py | Introduces environment variable validation utility for secure API key management |
| app/services/ai_investment.py | Core implementation of the multi-agent investment analysis system |
| app/main.py | Adds new streaming endpoint for investment analysis with async support |
| .env.example | Provides template for required environment variables and xAI model configuration |
Comments suppressed due to low confidence (1)
app/services/ai_investment.py:27
- The noqa comment should be placed at the end of the actual long line that triggers E501, not on a separate comment line. Move the noqa comment to the end of the f-string line above.
"Keep tool calls simple and avoid complex JSON structures",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Output
curl -N "http://localhost:8000/investment-analysis?company_name=TSLA"
A search on Nvdia
cmd line execution path for TSMC
Result on TSMC stock after using 4 different models based on the role of the agent
The results on NVDA after switching the models out
When you turn on show_tool_calls=True.
An example with GOOGL (Alphabet)
META recommendations
Cost split
