100+ AI Agents, Agent Skills and RAG Apps - Free and Open Source.
Refactor AI Investment Agent to utilize AgentOS framework, update README for new features and usage instructions, and remove Streamlit dependency from the main application logic.
Shubhamsabooa1030c00e7c2
diff --git a/advanced_ai_agents/single_agent_apps/ai_investment_agent/README.md b/advanced_ai_agents/single_agent_apps/ai_investment_agent/README.mdindex c390cf46..c0ecffc9 100644--- a/advanced_ai_agents/single_agent_apps/ai_investment_agent/README.md+++ b/advanced_ai_agents/single_agent_apps/ai_investment_agent/README.md@@ -3,12 +3,13 @@### π FREE Step-by-Step Tutorial**π [Click here to follow our complete step-by-step tutorial](https://www.theunwindai.com/p/build-ai-investment-agent-with-gpt-4o) and learn how to build this from scratch with detailed code walkthroughs, explanations, and best practices.**-This Streamlit app is an AI-powered investment agent built with Agno's AI Agent framework that compares the performance of two stocks and generates detailed reports. By using GPT-4o with Yahoo Finance data, this app provides valuable insights to help you make informed investment decisions.+This AI-powered investment agent is built with Agno's AgentOS framework that analyzes stocks and generates detailed investment reports. By using GPT-5.2 with Yahoo Finance data, this app provides valuable insights to help you make informed investment decisions.### Features- Compare the performance of two stocks- Retrieve comprehensive company information- Get the latest company news and analyst recommendations+- Beautiful web UI powered by AgentOS### How to get Started?@@ -25,21 +26,24 @@ pip install -r requirements.txt```3. Get your OpenAI API Key-- Sign up for an [OpenAI account](https://platform.openai.com/) (or the LLM provider of your choice) and obtain your API key.+- Sign up for an [OpenAI account](https://platform.openai.com/) and obtain your API key.+- Export your API key:+```bash+export OPENAI_API_KEY="your-api-key-here"+```-4. Run the Streamlit App+4. Run the AgentOS App```bash-streamlit run investment_agent.py+python investment_agent.py```-### How it Works?--- Upon running the app, you will be prompted to enter your OpenAI API key. This key is used to authenticate and access the OpenAI language model.-- Once you provide a valid API key, an instance of the Assistant class is created. This assistant utilizes the GPT-4o language model from OpenAI and the YFinanceTools for accessing stock data.-- Enter the stock symbols of the two companies you want to compare in the provided text input fields.-- The assistant will perform the following steps:- - Retrieve real-time stock prices and historical data using YFinanceTools- - Fetch the latest company news and analyst recommendations- - Gather comprehensive company information- - Generate a detailed comparison report using the GPT-4 language model-- The generated report will be displayed in the app, providing you with valuable insights and analysis to guide your investment decisions.+5. Open your web browser and navigate to the URL provided in the console output to interact with the AI investment agent through the playground interface.++6. Connecting Your AgentOS++To manage, monitor, and interact with your financial agent through the AgentOS Control Plane (from your browser), you need to connect your running AgentOS instance:++**Step-by-step guide:**++- Visit the official documentation: [Connecting Your OS](https://docs.agno.com/agent-os/connecting-your-os)+- Follow the steps in the guide to register your local AgentOS and establish the connection.\ No newline at end of filediff --git a/advanced_ai_agents/single_agent_apps/ai_investment_agent/investment_agent.py b/advanced_ai_agents/single_agent_apps/ai_investment_agent/investment_agent.pyindex 5e11ef90..8b53337a 100644--- a/advanced_ai_agents/single_agent_apps/ai_investment_agent/investment_agent.py+++ b/advanced_ai_agents/single_agent_apps/ai_investment_agent/investment_agent.py@@ -1,35 +1,27 @@-import streamlit as st+# import necessary python librariesfrom agno.agent import Agent-from agno.run.agent import RunOutputfrom agno.models.openai import OpenAIChatfrom agno.tools.yfinance import YFinanceTools+from agno.os import AgentOS-st.title("AI Investment Agent ππ€")-st.caption("This app allows you to compare the performance of two stocks and generate detailed reports.")+# create the AI investment agent+agent = Agent(+ name="AI Investment Agent",+ model=OpenAIChat(id="gpt-5.2-2025-12-11"),+ tools=[YFinanceTools()],+ description="You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",+ instructions=[+ "Format your response using markdown and use tables to display data where possible.",+ "When comparing stocks, provide detailed analysis including price trends, fundamentals, and analyst recommendations.",+ "Always provide actionable insights for investors."+ ],+ debug_mode=True,+ markdown=True,+)-openai_api_key = st.text_input("OpenAI API Key", type="password")+# UI for investment agent using AgentOS+agent_os = AgentOS(agents=[agent])+app = agent_os.get_app()-if openai_api_key:- assistant = Agent(- model=OpenAIChat(id="gpt-4o", api_key=openai_api_key),- tools=[- YFinanceTools(stock_price=True, analyst_recommendations=True, stock_fundamentals=True)- ],- debug_mode=True,- description="You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",- instructions=[- "Format your response using markdown and use tables to display data where possible."- ],- )-- col1, col2 = st.columns(2)- with col1:- stock1 = st.text_input("Enter first stock symbol (e.g. AAPL)")- with col2:- stock2 = st.text_input("Enter second stock symbol (e.g. MSFT)")-- if stock1 and stock2:- with st.spinner(f"Analyzing {stock1} and {stock2}..."):- query = f"Compare both the stocks - {stock1} and {stock2} and make a detailed report for an investment trying to invest and compare these stocks"- response: RunOutput = assistant.run(query, stream=False)- st.markdown(response.content)+if __name__ == "__main__":+ agent_os.serve(app="investment_agent:app", reload=True)diff --git a/advanced_ai_agents/single_agent_apps/ai_investment_agent/requirements.txt b/advanced_ai_agents/single_agent_apps/ai_investment_agent/requirements.txtindex 67cd7298..baf75187 100644--- a/advanced_ai_agents/single_agent_apps/ai_investment_agent/requirements.txt+++ b/advanced_ai_agents/single_agent_apps/ai_investment_agent/requirements.txt@@ -1,4 +1,3 @@-streamlitagno>=2.2.10openai-yfinance+yfinance\ No newline at end of filediff --git a/starter_ai_agents/xai_finance_agent/README.md b/starter_ai_agents/xai_finance_agent/README.mdindex 8eff17ee..c9491028 100644--- a/starter_ai_agents/xai_finance_agent/README.md+++ b/starter_ai_agents/xai_finance_agent/README.md@@ -4,7 +4,7 @@ This application creates a financial analysis agent powered by xAI's Grok model,### Features-- Powered by xAI's Grok-beta model+- Powered by xAI's Grok-4 Fast model- Real-time stock data analysis via YFinance- Web search capabilities through DuckDuckGo- Formatted output with tables for financial data@@ -39,3 +39,12 @@ python xai_finance_agent.py```5. Open your web browser and navigate to the URL provided in the console output to interact with the AI financial agent through the playground interface.++6. Connecting Your AgentOS++To manage, monitor, and interact with your financial agent through the AgentOS Control Plane (from your browser), you need to connect your running AgentOS instance:++**Step-by-step guide:**++- Visit the official documentation: [Connecting Your OS](https://docs.agno.com/agent-os/connecting-your-os)+- Follow the steps in the guide to register your local AgentOS and establish the connection.\ No newline at end of filediff --git a/starter_ai_agents/xai_finance_agent/requirements.txt b/starter_ai_agents/xai_finance_agent/requirements.txtindex 67caae90..aa90d518 100644--- a/starter_ai_agents/xai_finance_agent/requirements.txt+++ b/starter_ai_agents/xai_finance_agent/requirements.txt@@ -1,5 +1,3 @@agno>=2.2.10duckduckgo-search-yfinance-fastapi[standard]-openai\ No newline at end of file+yfinance\ No newline at end of filediff --git a/starter_ai_agents/xai_finance_agent/xai_finance_agent.py b/starter_ai_agents/xai_finance_agent/xai_finance_agent.pyindex 7c8579e3..6e137428 100644--- a/starter_ai_agents/xai_finance_agent/xai_finance_agent.py+++ b/starter_ai_agents/xai_finance_agent/xai_finance_agent.py@@ -8,8 +8,8 @@ from agno.os import AgentOS# create the AI finance agentagent = Agent(name="xAI Finance Agent",- model = xAI(id="grok-beta"),- tools=[DuckDuckGoTools(), YFinanceTools(stock_price=True, analyst_recommendations=True, stock_fundamentals=True)],+ model = xAI(id="grok-4-1-fast"),+ tools=[DuckDuckGoTools(), YFinanceTools()],instructions = ["Always use tables to display financial/numerical data. For text data use bullet points and small paragrpahs."],debug_mode = True,markdown = True,