Authors: Robert Jambrecic, Tvrtko Sternak
Introduction
We are excited to unveil DeepResearchAgent
, a powerful autonomous research capability within our AG2 framework. Inspired by OpenAI’s Deep Research, our agent is designed to tackle complex, multi-step research tasks efficiently, synthesizing insights from diverse online sources.
With DeepResearchAgent
, we take a significant step toward the future of autonomous knowledge synthesis—freeing up valuable time and enabling deeper, data-driven decision-making
Installation
DeepResearchAgent
is built on top of Browser Use
, which requires Python 3.11 or higher.
To get started with the DeepResearchAgent
agent, follow these steps:
-
Install AG2 with the
browser-use
extra:
pip install ag2[browser-use]
If you have been using
autogen
orpyautogen
, all you need to do is upgrade it using:
pip install -U autogen[browser-use]
or
pip install -U pyautogen[browser-use]
as
pyautogen
,autogen
, andag2
are aliases for the same PyPI package. -
Set up Playwright:
# Installs Playwright and browsers for all OS playwright install # Additional command, mandatory for Linux only playwright install-deps
-
For running the code in Jupyter, use
nest_asyncio
to allow nested event loops.
pip install nest_asyncio
You’re all set! Now you can start solving complex tasks.
Imports
import os
import nest_asyncio
from autogen.agents.experimental import DeepResearchAgent
nest_asyncio.apply()
Starting the Conversation
This code initializes DeepResearchAgent
and asks it to find out What was the impact of DeepSeek on stock prices and why?
using GPT-4o
.
We recommend using gpt-4o
Models like gpt-4o-mini
often don’t perform well enough for complex tasks.
llm_config = {
"config_list": [{"model": "gpt-4o", "api_key": os.environ["OPENAI_API_KEY"]}],
}
agent = DeepResearchAgent(
name="DeepResearchAgent",
llm_config=llm_config,
)
message = "What was the impact of DeepSeek on stock prices and why?"
result = agent.run(
message=message,
tools=agent.tools,
max_turns=2,
user_input=False,
summary_method="reflection_with_llm",
)
print(result.summary)
The agent will break down the initial task into smaller, manageable subtasks and tackle them sequentially. Once all subtasks are completed, a final summary will be generated, for example:
The investigation into the impact of DeepSeek on stock prices reveals several key insights:
1. **DeepSeek's Role and Functionality:**
- DeepSeek is a renowned Chinese AI company, known for its cutting-edge, open-source language models that compete with those of major U.S. tech giants. The models offer significant advancements in reasoning and optimization of tasks requiring logical inference and problem-solving, utilizing methods such as "Chain of Thought" and reinforcement learning.
2. **Impact on Stock Prices:**
- The introduction and application of DeepSeek have led to significant repercussions in stock markets. The tech industry experienced a selloff, notably impacting companies like Nvidia, with stock valuations decreasing markedly—from 50 times to 36 times estimated earnings. Major indexes, including Nasdaq and S&P 500, faced declines of 3.1% and 1.5%, respectively.
3. **Factors behind the Changes in Stock Prices:**
- The shifts in stock prices are attributed to several factors:
- **Technological Advancements:** DeepSeek's technological breakthroughs have triggered notable market changes.
- **Impact on Major Tech Companies:** There have been significant market-cap losses for companies like Nvidia due to concerns about competition from DeepSeek.
- **Market Volatility:** Concerns over Chinese AI enhancements have induced market-wide volatility.
- **Investment Opportunities:** DeepSeek's advancements have sparked interest in investing in undervalued Chinese AI stocks, indicating potential growth areas.
- **Financial Market Reactions:** The rapid changes induced by DeepSeek's developments have caused noticeable financial market fluctuations, particularly affecting Wall Street.
Overall, DeepSeek's emergence has profoundly influenced stock prices by fostering both immediate market anxiety and potential long-term investment opportunities.
Reasoning: The answer comprehensively covers the impact of DeepSeek on stock prices and the reasons behind these changes. It is well-structured, providing a clear understanding of DeepSeek's functions, its effects on the stock market, and the underlying factors contributing to these effects. Each aspect of the investigation aligns with the subquestions previously addressed, ensuring completeness and coherence. Thus, this summary effectively communicates the investigation's findings.
Conclusion
The DeepResearchAgent
within the AG2 framework helps automate complex research tasks by gathering information from different online sources. It breaks down big questions into smaller tasks and works through them one by one. After completing all the steps, the agent creates a detailed summary, making it easier for users to handle research challenges and find useful insights quickly.
Finding this useful?
The AG2 team is working hard to create content like this, not to mention building a powerful, open-source, end-to-end platform for multi-agent automation.
The easiest way to show your support is just to star AG2 repo, but also take a look at it for contributions or simply to give it a try.
Also, let us know if you have any interesting use cases for DeepResearchAgent
! Or maybe you would like to see more features or improvements? In any case, do join our Discord server for discussion.
Top comments (0)