100+ AI Agents, Agent Skills and RAG Apps - Free and Open Source.
refactor: Enhance AI agents with ExaTools integration and update requirements
Shubhamsaboob687794a5278
diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/competitor_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/competitor_agent_team.pyindex 10932def..20b13ba7 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/competitor_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/competitor_agent_team.py@@ -1,6 +1,7 @@import streamlit as st-# from exa_py import Exafrom agno.agent import Agent+from agno.run.agent import RunOutput+from agno.tools.exa import ExaToolsfrom agno.tools.firecrawl import FirecrawlToolsfrom agno.models.openai import OpenAIChatfrom agno.tools.duckduckgo import DuckDuckGoTools@@ -66,10 +67,6 @@ if "openai_api_key" in st.session_state and "firecrawl_api_key" in st.session_stif (search_engine == "Perplexity AI - Sonar Pro" and "perplexity_api_key" in st.session_state) or \(search_engine == "Exa AI" and "exa_api_key" in st.session_state):- # Initialize Exa only if selected- if search_engine == "Exa AI":- exa = Exa(api_key=st.session_state.exa_api_key)-firecrawl_tools = FirecrawlTools(api_key=st.session_state.firecrawl_api_key,scrape=False,@@ -77,23 +74,42 @@ if "openai_api_key" in st.session_state and "firecrawl_api_key" in st.session_stlimit=5)+ # Create ExaTools agent for finding competitor URLs+ if search_engine == "Exa AI":+ exa_tools = ExaTools(+ api_key=st.session_state.exa_api_key,+ category="company",+ num_results=3+ )+ competitor_finder_agent = Agent(+ model=OpenAIChat(id="gpt-4o", api_key=st.session_state.openai_api_key),+ tools=[exa_tools],+ debug_mode=True,+ markdown=True,+ instructions=[+ "You are a competitor finder agent. Use ExaTools to find competitor company URLs.",+ "When given a URL, find similar companies. When given a description, search for companies matching that description.",+ "Return ONLY the URLs, one per line, with no additional text."+ ]+ )+firecrawl_agent = Agent(model=OpenAIChat(id="gpt-4o", api_key=st.session_state.openai_api_key),tools=[firecrawl_tools, DuckDuckGoTools()],- show_tool_calls=True,+ debug_mode=True,markdown=True)analysis_agent = Agent(model=OpenAIChat(id="gpt-4o", api_key=st.session_state.openai_api_key),- show_tool_calls=True,+ debug_mode=True,markdown=True)# New agent for comparing competitor datacomparison_agent = Agent(model=OpenAIChat(id="gpt-4o", api_key=st.session_state.openai_api_key),- show_tool_calls=True,+ debug_mode=True,markdown=True)@@ -145,22 +161,16 @@ if "openai_api_key" in st.session_state and "firecrawl_api_key" in st.session_stelse: # Exa AItry:+ # Use ExaTools agent to find competitor URLsif url:- result = exa.find_similar(- url=url,- num_results=3,- exclude_source_domain=True,- category="company"- )+ prompt = f"Find 3 competitor company URLs similar to: {url}. Return ONLY the URLs, one per line."else:- result = exa.search(- description,- type="neural",- category="company",- use_autoprompt=True,- num_results=3- )- return [item.url for item in result.results]+ prompt = f"Find 3 competitor company URLs matching this description: {description}. Return ONLY the URLs, one per line."++ response: RunOutput = competitor_finder_agent.run(prompt)+ # Extract URLs from the response+ urls = [line.strip() for line in response.content.strip().split('\n') if line.strip() and line.strip().startswith('http')]+ return urls[:3] # Return up to 3 URLsexcept Exception as e:st.error(f"Error fetching competitor URLs from Exa: {str(e)}")return []@@ -263,7 +273,7 @@ if "openai_api_key" in st.session_state and "firecrawl_api_key" in st.session_stformatted_data = json.dumps(competitor_data, indent=2)print("Analysis Data:", formatted_data) # For debugging- report = analysis_agent.run(+ report: RunOutput = analysis_agent.run(f"""Analyze the following competitor data in JSON format and identify market opportunities to improve my own company:{formatted_data}diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/requirements.txt b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/requirements.txtindex 90958613..8b1080ff 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/requirements.txt+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_competitor_intelligence_agent_team/requirements.txt@@ -1,5 +1,4 @@-exa-py==1.7.1firecrawl-py==1.9.0duckduckgo-search==7.2.1-agno+agno>=2.2.10streamlit==1.41.1\ No newline at end of filediff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/finance_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/finance_agent_team.pyindex 8758cf89..47fa68e3 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/finance_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/finance_agent_team.py@@ -1,17 +1,21 @@from agno.agent import Agent+from agno.team import Teamfrom agno.models.openai import OpenAIChat-from agno.storage.agent.sqlite import SqliteAgentStorage+from agno.db.sqlite import SqliteDbfrom agno.tools.duckduckgo import DuckDuckGoToolsfrom agno.tools.yfinance import YFinanceTools-from agno.playground import Playground, serve_playground_app+from agno.os import AgentOS++# Setup database for storage+db = SqliteDb(db_file="agents.db")web_agent = Agent(name="Web Agent",role="Search the web for information",model=OpenAIChat(id="gpt-4o"),tools=[DuckDuckGoTools()],- storage=SqliteAgentStorage(table_name="web_agent", db_file="agents.db"),- add_history_to_messages=True,+ db=db,+ add_history_to_context=True,markdown=True,)@@ -21,20 +25,21 @@ finance_agent = Agent(model=OpenAIChat(id="gpt-4o"),tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True)],instructions=["Always use tables to display data"],- storage=SqliteAgentStorage(table_name="finance_agent", db_file="agents.db"),- add_history_to_messages=True,+ db=db,+ add_history_to_context=True,markdown=True,)-agent_team = Agent(- team=[web_agent, finance_agent],+agent_team = Team(name="Agent Team (Web+Finance)",model=OpenAIChat(id="gpt-4o"),- show_tool_calls=True,+ members=[web_agent, finance_agent],+ debug_mode=True,markdown=True,)-app = Playground(agents=[agent_team]).get_app()+agent_os = AgentOS(agents=[agent_team])+app = agent_os.get_app()if __name__ == "__main__":- serve_playground_app("finance_agent_team:app", reload=True)\ No newline at end of file+ agent_os.serve(app="finance_agent_team:app", reload=True)\ No newline at end of filediff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/requirements.txt b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/requirements.txtindex 958c9bb7..4a467614 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/requirements.txt+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_finance_agent_team/requirements.txt@@ -1,6 +1,5 @@openai-agno+agno>=2.2.10duckduckgo-searchyfinance-fastapi[standard]sqlalchemy\ No newline at end of filediff --git a/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/movie_production_agent.py b/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/movie_production_agent.pyindex 0b201170..8815ed0b 100644--- a/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/movie_production_agent.py+++ b/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/movie_production_agent.py@@ -2,23 +2,24 @@import streamlit as stfrom agno.agent import Agentfrom agno.run.agent import RunOutput+from agno.team import Teamfrom agno.tools.serpapi import SerpApiTools-from agno.models.anthropic import Claude+from agno.models.google import Geminifrom textwrap import dedent# Set up the Streamlit appst.title("AI Movie Production Agent 🎬")st.caption("Bring your movie ideas to life with the teams of script writing and casting AI agents")-# Get Anthropic API key from user-anthropic_api_key = st.text_input("Enter Anthropic API Key to access Claude Sonnet 3.5", type="password")+# Get Google API key from user+google_api_key = st.text_input("Enter Google API Key to access Gemini 2.5 Flash", type="password")# Get SerpAPI key from the userserp_api_key = st.text_input("Enter Serp API Key for Search functionality", type="password")-if anthropic_api_key and serp_api_key:+if google_api_key and serp_api_key:script_writer = Agent(name="ScriptWriter",- model=Claude(id="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),+ model=Gemini(id="gemini-2.5-flash", api_key=google_api_key),description=dedent("""\You are an expert screenplay writer. Given a movie idea and genre,@@ -34,7 +35,7 @@ if anthropic_api_key and serp_api_key:casting_director = Agent(name="CastingDirector",- model=Claude(id="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),+ model=Gemini(id="gemini-2.5-flash", api_key=google_api_key),description=dedent("""\You are a talented casting director. Given a script outline and character descriptions,@@ -50,10 +51,10 @@ if anthropic_api_key and serp_api_key:tools=[SerpApiTools(api_key=serp_api_key)],)- movie_producer = Agent(+ movie_producer = Team(name="MovieProducer",- model=Claude(id="claude-3-5-sonnet-20240620", api_key=anthropic_api_key),- team=[script_writer, casting_director],+ model=Gemini(id="gemini-2.5-flash", api_key=google_api_key),+ members=[script_writer, casting_director],description="Experienced movie producer overseeing script and casting.",instructions=["Ask ScriptWriter for a script outline based on the movie idea.",diff --git a/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/requirements.txt b/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/requirements.txtindex fc46b552..cdb30392 100644--- a/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/requirements.txt+++ b/advanced_ai_agents/single_agent_apps/ai_movie_production_agent/requirements.txt@@ -1,5 +1,4 @@streamlit-agno-anthropic+agno>=2.2.10google-search-resultslxml_html_clean\ No newline at end of file