Chapter 48
Have several agents collaborate in a multi-agent hierarchy ๐ค๐ค๐ค
Have several agents collaborate in a multi-agent hierarchy ๐ค๐ค๐ค
Authored by: Aymeric Roucher
This tutorial is advanced. You should have notions from this other cookbook first!
In this notebook we will make a multi-agent web browser: an agentic system with several agents collaborating to solve problems using the web!
It will be a simple hierarchy, using a ManagedAgent object to wrap the managed web search agent:
+----------------+
| Manager agent |
+----------------+
|
_______________|______________
| |
Code interpreter +--------------------------------+
tool | Managed agent |
| +------------------+ |
| | Web Search agent | |
| +------------------+ |
| | | |
| Web Search tool | |
| Visit webpage tool |
+--------------------------------+Let's set up this system.
Run the line below to install the required dependencies:
!pip install markdownify duckduckgo-search smolagents --upgrade -qLet's login in order to call the HF Inference API:
from huggingface_hub import notebook_login
notebook_login()โก๏ธ Our agent will be powered by Qwen/Qwen2.5-72B-Instruct using HfApiEngine class that uses HF's Inference API: the Inference API allows to quickly and easily run any OS model.
Note: The Inference API hosts models based on various criteria, and deployed models may be updated or replaced without prior notice. Learn more about it here.
model_id = "Qwen/Qwen2.5-72B-Instruct"๐ Create a web search tool
For web browsing, we can already use our pre-existing DuckDuckGoSearchTool tool to provide a Google search equivalent.
But then we will also need to be able to peak into the page found by the DuckDuckGoSearchTool.
To do so, we could import the library's built-in VisitWebpageTool, but we will build it again to see how it's done.
So let's create our VisitWebpageTool tool from scratch using markdownify.
import re
import requests
from markdownify import markdownify as md
from requests.exceptions import RequestException
from smolagents import tool
@tool
def visit_webpage(url: str) -> str:
"""Visits a webpage at the given URL and returns its content as a markdown string.
Args:
url: The URL of the webpage to visit.
Returns:
The content of the webpage converted to Markdown, or an error message if the request fails.
"""
try:
# Send a GET request to the URL
response = requests.get(url)
response.raise_for_status() # Raise an exception for bad status codes
# Convert the HTML content to Markdown
markdown_content = md(response.text).strip()
# Remove multiple line breaks
markdown_content = re.sub(r"\n{3,}", "\n\n", markdown_content)
return markdown_content
except RequestException as e:
return f"Error fetching the webpage: {str(e)}"
except Exception as e:
return f"An unexpected error occurred: {str(e)}"Ok, now let's initialize and test our tool!
print(visit_webpage("https://en.wikipedia.org/wiki/Hugging_Face")[:500])Output
Hugging Face - Wikipedia [Jump to content](#bodyContent) Main menu Main menu move to sidebar hide Navigation * [Main page](/wiki/Main_Page "Visit the main page [z]") * [Contents](/wiki/Wikipedia:Contents "Guides to browsing Wikipedia") * [Current events](/wiki/Portal:Current_events "Articles related to current events") * [Random article](/wiki/Special:Random "Visit a randomly selected article [x]") * [About Wikipedia](/wiki/Wikipedia:About "Learn about Wikipedia and how it works") * [Contac
Build our multi-agent system ๐ค๐ค๐ค
Now that we have all the tools search and visit_webpage, we can use them to create the web agent.
Which configuration to choose for this agent?
- Web browsing is a single-timeline task that does not require parallel tool calls, so JSON tool calling works well for that. We thus choose a
ReactJsonAgent. - Also, since sometimes web search requires exploring many pages before finding the correct answer, we prefer to increase the number of
max_iterationsto 10.
from smolagents import (
CodeAgent,
ToolCallingAgent,
InferenceClientModel,
ManagedAgent,
DuckDuckGoSearchTool
)
model = InferenceClientModel(model_id)
web_agent = ToolCallingAgent(
tools=[DuckDuckGoSearchTool(), visit_webpage],
model=model,
max_iterations=10,
)We then wrap this agent into a ManagedAgent that will make it callable by its manager agent.
managed_web_agent = ManagedAgent(
agent=web_agent,
name="search_agent",
description="Runs web searches for you. Give it your query as an argument.",
)Finally we create a manager agent, and upon initialization we pass our managed agent to it in its managed_agents argument.
Since this agent is the one tasked with the planning and thinking, advanced reasoning will be beneficial, so a ReactCodeAgent will be the best choice.
Also, we want to ask a question that involves the current year: so let us add additional_authorized_imports=["time", "datetime"]
manager_agent = CodeAgent(
tools=[],
model=model,
managed_agents=[managed_web_agent],
additional_authorized_imports=["time", "datetime"],
)That's all! Now let's run our system! We select a question that requires some calculation and
manager_agent.run("How many years ago was Stripe founded?")Output
[38;2;212;183;2mโญโ[0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2m [0m[1;38;2;212;183;2mNew run[0m[38;2;212;183;2m [0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2mโโฎ[0m [38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m [1mHow many years ago was Stripe founded?[0m [38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m [38;2;212;183;2mโฐโ[0m[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-72B-Instruct [0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2mโโฏ[0m
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ New run โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ โ โ How many years ago was Stripe founded? โ โ โ โฐโ InferenceClientModel - Qwen/Qwen2.5-72B-Instruct โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [0m[1mStep [0m[1;36m0[0m[38;2;212;183;2m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Step 0 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโ [1mExecuting this code:[0m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m1 [0m[38;2;248;248;242;48;2;39;40;34mfound_year[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34m=[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;248;248;242;48;2;39;40;34msearch_agent[0m[38;2;248;248;242;48;2;39;40;34m([0m[38;2;248;248;242;48;2;39;40;34mrequest[0m[38;2;255;70;137;48;2;39;40;34m=[0m[38;2;230;219;116;48;2;39;40;34m"[0m[38;2;230;219;116;48;2;39;40;34mWhen was Stripe founded?[0m[38;2;230;219;116;48;2;39;40;34m"[0m[38;2;248;248;242;48;2;39;40;34m)[0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m2 [0m[38;2;248;248;242;48;2;39;40;34mprint[0m[38;2;248;248;242;48;2;39;40;34m([0m[38;2;248;248;242;48;2;39;40;34mfound_year[0m[38;2;248;248;242;48;2;39;40;34m)[0m[48;2;39;40;34m [0m โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Executing this code: โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ 1 found_year = search_agent(request="When was Stripe founded?") โ โ 2 print(found_year) โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[38;2;212;183;2mโญโ[0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2m [0m[1;38;2;212;183;2mNew run[0m[38;2;212;183;2m [0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2mโโฎ[0m
[38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mYou're a helpful agent named 'search_agent'.[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mYou have been submitted this task by your manager.[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m---[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mTask:[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mWhen was Stripe founded?[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m---[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mYou're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1minformation as possible to give them a clear understanding of the answer.[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mYour final_answer WILL HAVE to contain these parts:[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m### 1. Task outcome (short version):[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m### 2. Task outcome (extremely detailed version):[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m### 3. Additional context (if relevant):[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mPut all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mlost.[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mAnd even if your task resolution is not successful, please return as much context as possible, so that your [0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1mmanager can act upon this feedback.[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [1m{additional_prompting}[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโ[0m [38;2;212;183;2mโ[0m
[38;2;212;183;2mโฐโ[0m[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-72B-Instruct [0m[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[38;2;212;183;2mโโฏ[0m
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ New run โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ โ โ You're a helpful agent named 'search_agent'. โ โ You have been submitted this task by your manager. โ โ --- โ โ Task: โ โ When was Stripe founded? โ โ --- โ โ You're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much โ โ information as possible to give them a clear understanding of the answer. โ โ โ โ Your final_answer WILL HAVE to contain these parts: โ โ ### 1. Task outcome (short version): โ โ ### 2. Task outcome (extremely detailed version): โ โ ### 3. Additional context (if relevant): โ โ โ โ Put all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be โ โ lost. โ โ And even if your task resolution is not successful, please return as much context as possible, so that your โ โ manager can act upon this feedback. โ โ {additional_prompting} โ โ โ โฐโ InferenceClientModel - Qwen/Qwen2.5-72B-Instruct โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [0m[1mStep [0m[1;36m0[0m[38;2;212;183;2m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Step 0 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Calling tool: 'web_search' with arguments: {'query': 'When was Stripe founded'} โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Calling tool: 'web_search' with arguments: {'query': 'When was Stripe founded'} โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Observations: ## Search Results [1m[[0mStripe, Inc. - Wikipedia[1m][0m[1m([0m[4;94mhttps://en.wikipedia.org/wiki/Stripe,_Inc.[0m[4;94m)[0m Stripe, Inc. is an Irish-American [1m[[0m[1;36m3[0m[1m][0m multinational financial services and software as a service [1m([0mSaaS[1m)[0m [33m...[0m Irish entrepreneur brothers John and Patrick Collison founded Stripe in Palo Alto, California, in [1;36m2010[0m, [1m[[0m[1;36m9[0m[1m][0m and serve as the company's president [1m[[0m[1;36m10[0m[1m][0m and CEO, [1m[[0m[1;36m11[0m[1m][0m respectively. [1m[[0mThe Collison Brothers and Story Behind The Founding Of Stripe[1m][0m[1m([0m[4;94mhttps://www.startupgrind.com/blog/the-collison-brothers-and-story-behind-the-founding-of-stripe/[0m[4;94m)[0m Stripe is a payment platform that aims to give developers the tools they need to create the most secure and novel buying experiences. The company was founded in [1;36m2010[0m by brothers Patrick and John Collison, who started working on it while they were still in high school and college. [1m[[0mStripe's Founders: The Story of Collison Brothers - KITRUM[1m][0m[1m([0m[4;94mhttps://kitrum.com/blog/stripe-founders-the-story-of-collison-brothers/[0m[4;94m)[0m The factors contributing to Stripe's rise in popularity. Back in May [1;36m2011[0m, Stripe acquired a $[1;36m2[0m million investment from a group of venture capitalists, including Peter Thiel, Elon Musk, Sequoia Capital, SV Angel, and Andreessen Horowitz. Stripe then launched publicly in September [1;36m2011[0m after a lengthy private beta period. [1m[[0mStripe, Inc. - Simple English Wikipedia, the free encyclopedia[1m][0m[1m([0m[4;94mhttps://simple.wikipedia.org/wiki/Stripe,_Inc.[0m[4;94m)[0m Stripe, Inc. is an Irish-American financial services and software as a service [1m([0mSaaS[1m)[0m company. It is headquartered in South San Francisco, California, United States and Dublin, Ireland. [1m[[0m[1;36m1[0m[1m][0m [1m[[0m[1;36m2[0m[1m][0m The company offers payment software for e-commerce websites and mobile applications. Stripe was founded in Palo Alto, California in [1;36m2009[0m. [1m[[0mStripe | Company Overview & News - Forbes[1m][0m[1m([0m[4;94mhttps://www.forbes.com/companies/stripe/[0m[4;94m)[0m More than $[1;36m1[0m trillion in payments now pass through Stripe's software on behalf of customers, a milestone reached just over [1;36m12[0m years after its first product launch in [1;36m2011[0m. [33m...[0m Founded [1;36m2009[0m [33m...[0m [1m[[0mBuilding a $[1;36m95[0m Billion Startup: The Stripe Story - Wishpond Blog[1m][0m[1m([0m[4;94mhttps://blog.wishpond.com/post/115675438299/stripe-startup[0m[4;94m)[0m Stripe Background: How Stripe Was Started. Stripe was founded [1;36m11[0m years ago by John and Patrick Collison, aged [1;36m19[0m and [1;36m21[0m at the time. Hailing from Dromineer, a small town on the shores of Lough Derg in County Tipperary, Ireland, both the brothers were academically gifted and showed a special interest in math and physics from a very young age. [1m[[0mStripe History: Founding, Timeline, and Milestones - Zippia[1m][0m[1m([0m[4;94mhttps://www.zippia.com/stripe-careers-39818/history/[0m[4;94m)[0m Stripe was founded in [1;36m2010[0m by Irish entrepreneurs Patrick and John Collison. John and Patrick first started working on Stripe in early [1;36m2010[0m. In early [1;36m2010[0m John and Patrick began working on Stripe together. In [1;36m2010[0m he co-founded Commonred which was acquired by Income.com. [1m[[0mThe Collison Brothers: The Story Behind The Founding Of Stripe[1m][0m[1m([0m[4;94mhttps://medium.com/startup-grind/the-collison-brothers-the-story-behind-the-founding-of-stripe-ae013434c080[0m [4;94m)[0m In [1;36m2012[0m, we updated this piece to reflect Bloomberg's latest report that Stripe had just raised an $18MM round with Sequoia at a $100MM valuation. On July 28th, [1;36m2015[0m Stripe announced even biggerโฆ [1m[[0mStripe co-founder and CEO Patrick Collison on "prizing the small [33m...[0m[1m][0m[1m([0m[4;94mhttps://newsroom.haas.berkeley.edu/stripe-co-founder-and-ceo-patrick-collison-on-founding-a-company-that-shoul[0m [4;94md-have-already-existed/[0m[4;94m)[0m Stripe was born when Patrick and John looked for a payment platform but couldn't find all of the features they thought would be important. And Stripe debuted in [1;36m2010[0m and grew exponentially because the product is really simple for businesses to implement. Of course, the back end is anything but simple, but it's easy on the front end for [33m...[0m [1m[[0mWhat is Stripe and why is the State investing $[1;36m50[0m million in it?[1m][0m[1m([0m[4;94mhttps://www.irishtimes.com/business/technology/what-is-stripe-and-why-is-the-state-investing-50-million-in-it-[0m [4;94m1.4510680[0m[4;94m)[0m They founded Stripe two years later, which became a tech unicorn - that is a privately-owned company worth more than $[1;36m1[0m billion in [1;36m2014[0m. John was named the world's youngest self-made [33m...[0m
Observations: ## Search Results [Stripe, Inc. - Wikipedia](https://en.wikipedia.org/wiki/Stripe,_Inc.) Stripe, Inc. is an Irish-American [3] multinational financial services and software as a service (SaaS) ... Irish entrepreneur brothers John and Patrick Collison founded Stripe in Palo Alto, California, in 2010, [9] and serve as the company's president [10] and CEO, [11] respectively. [The Collison Brothers and Story Behind The Founding Of Stripe](https://www.startupgrind.com/blog/the-collison-brothers-and-story-behind-the-founding-of-stripe/) Stripe is a payment platform that aims to give developers the tools they need to create the most secure and novel buying experiences. The company was founded in 2010 by brothers Patrick and John Collison, who started working on it while they were still in high school and college. [Stripe's Founders: The Story of Collison Brothers - KITRUM](https://kitrum.com/blog/stripe-founders-the-story-of-collison-brothers/) The factors contributing to Stripe's rise in popularity. Back in May 2011, Stripe acquired a $2 million investment from a group of venture capitalists, including Peter Thiel, Elon Musk, Sequoia Capital, SV Angel, and Andreessen Horowitz. Stripe then launched publicly in September 2011 after a lengthy private beta period. [Stripe, Inc. - Simple English Wikipedia, the free encyclopedia](https://simple.wikipedia.org/wiki/Stripe,_Inc.) Stripe, Inc. is an Irish-American financial services and software as a service (SaaS) company. It is headquartered in South San Francisco, California, United States and Dublin, Ireland. [1] [2] The company offers payment software for e-commerce websites and mobile applications. Stripe was founded in Palo Alto, California in 2009. [Stripe | Company Overview & News - Forbes](https://www.forbes.com/companies/stripe/) More than $1 trillion in payments now pass through Stripe's software on behalf of customers, a milestone reached just over 12 years after its first product launch in 2011. ... Founded 2009 ... [Building a $95 Billion Startup: The Stripe Story - Wishpond Blog](https://blog.wishpond.com/post/115675438299/stripe-startup) Stripe Background: How Stripe Was Started. Stripe was founded 11 years ago by John and Patrick Collison, aged 19 and 21 at the time. Hailing from Dromineer, a small town on the shores of Lough Derg in County Tipperary, Ireland, both the brothers were academically gifted and showed a special interest in math and physics from a very young age. [Stripe History: Founding, Timeline, and Milestones - Zippia](https://www.zippia.com/stripe-careers-39818/history/) Stripe was founded in 2010 by Irish entrepreneurs Patrick and John Collison. John and Patrick first started working on Stripe in early 2010. In early 2010 John and Patrick began working on Stripe together. In 2010 he co-founded Commonred which was acquired by Income.com. [The Collison Brothers: The Story Behind The Founding Of Stripe](https://medium.com/startup-grind/the-collison-brothers-the-story-behind-the-founding-of-stripe-ae013434c080 ) In 2012, we updated this piece to reflect Bloomberg's latest report that Stripe had just raised an $18MM round with Sequoia at a $100MM valuation. On July 28th, 2015 Stripe announced even biggerโฆ [Stripe co-founder and CEO Patrick Collison on "prizing the small ...](https://newsroom.haas.berkeley.edu/stripe-co-founder-and-ceo-patrick-collison-on-founding-a-company-that-shoul d-have-already-existed/) Stripe was born when Patrick and John looked for a payment platform but couldn't find all of the features they thought would be important. And Stripe debuted in 2010 and grew exponentially because the product is really simple for businesses to implement. Of course, the back end is anything but simple, but it's easy on the front end for ... [What is Stripe and why is the State investing $50 million in it?](https://www.irishtimes.com/business/technology/what-is-stripe-and-why-is-the-state-investing-50-million-in-it- 1.4510680) They founded Stripe two years later, which became a tech unicorn - that is a privately-owned company worth more than $1 billion in 2014. John was named the world's youngest self-made ...
[2m[Step 0: Duration 3.77 seconds| Input tokens: 1,599 | Output tokens: 20][0m
[Step 0: Duration 3.77 seconds| Input tokens: 1,599 | Output tokens: 20]
[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [0m[1mStep [0m[1;36m1[0m[38;2;212;183;2m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Step 1 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Calling tool: 'final_answer' with arguments: {'answer': '### 1. Task outcome (short version):\\\\\\\\nStripe โ
โ was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome (extremely detailed version):\\\\\\\\nStripe, Inc. โ
โ was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for โ
โ e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and โ
โ Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The โ
โ company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\n\\\\\\\\n### 3. โ
โ Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million investment from notable โ
โ investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\n- Stripe has โ
โ since grown significantly, processing over $1 trillion in payments through its software, contributing to its โ
โ rapid rise in popularity. The company has become a leading player in the financial technology sector, with a โ
โ valuation that has surpassed $95 billion.'} โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Calling tool: 'final_answer' with arguments: {'answer': '### 1. Task outcome (short version):\\\\\\\\nStripe โ
โ was founded in 2010.\\\\\\\\n\\\\\\\\n### 2. Task outcome (extremely detailed version):\\\\\\\\nStripe, Inc. โ
โ was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for โ
โ e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and โ
โ Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The โ
โ company publicly launched in September 2011 after a lengthy private beta period.\\\\\\\\n\\\\\\\\n### 3. โ
โ Additional context (if relevant):\\\\\\\\n- The Collison brothers secured a $2 million investment from notable โ
โ investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\\\\\n- Stripe has โ
โ since grown significantly, processing over $1 trillion in payments through its software, contributing to its โ
โ rapid rise in popularity. The company has become a leading player in the financial technology sector, with a โ
โ valuation that has surpassed $95 billion.'} โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[1;38;2;212;183;2mFinal answer: ### 1. Task outcome (short version):\\\\nStripe was founded in 2010.\\\\n\\\\n### 2. Task outcome [0m [1;38;2;212;183;2m(extremely detailed version):\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The[0m [1;38;2;212;183;2mcompany, which offers payment software for e-commerce websites and mobile applications, was initially established [0m [1;38;2;212;183;2min Palo Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working [0m [1;38;2;212;183;2mon Stripe in early 2010. The company publicly launched in September 2011 after a lengthy private beta [0m [1;38;2;212;183;2mperiod.\\\\n\\\\n### 3. Additional context (if relevant):\\\\n- The Collison brothers secured a $2 million [0m [1;38;2;212;183;2minvestment from notable investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May [0m [1;38;2;212;183;2m2011.\\\\n- Stripe has since grown significantly, processing over $1 trillion in payments through its software, [0m [1;38;2;212;183;2mcontributing to its rapid rise in popularity. The company has become a leading player in the financial technology [0m [1;38;2;212;183;2msector, with a valuation that has surpassed $95 billion.[0m
Final answer: ### 1. Task outcome (short version):\\\\nStripe was founded in 2010.\\\\n\\\\n### 2. Task outcome (extremely detailed version):\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The company publicly launched in September 2011 after a lengthy private beta period.\\\\n\\\\n### 3. Additional context (if relevant):\\\\n- The Collison brothers secured a $2 million investment from notable investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\n- Stripe has since grown significantly, processing over $1 trillion in payments through its software, contributing to its rapid rise in popularity. The company has become a leading player in the financial technology sector, with a valuation that has surpassed $95 billion.
[2m[Step 1: Duration 34.02 seconds| Input tokens: 4,290 | Output tokens: 288][0m
[Step 1: Duration 34.02 seconds| Input tokens: 4,290 | Output tokens: 288]
[1mExecution logs:[0m ### 1. Task outcome (short version):\\\\nStripe was founded in 2010.\\\\n\\\\n### 2. Task outcome (extremely detailed version):\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The company, which offers payment software for e-commerce websites and mobile applications, was initially established in Palo Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe in early 2010. The company publicly launched in September 2011 after a lengthy private beta period.\\\\n\\\\n### 3. Additional context (if relevant):\\\\n- The Collison brothers secured a $2 million investment from notable investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\n- Stripe has since grown significantly, processing over $1 trillion in payments through its software, contributing to its rapid rise in popularity. The company has become a leading player in the financial technology sector, with a valuation that has surpassed $95 billion. Out: None
Execution logs:
### 1. Task outcome (short version):\\\\nStripe was founded in 2010.\\\\n\\\\n### 2. Task outcome (extremely
detailed version):\\\\nStripe, Inc. was founded in 2010 by Irish brothers John and Patrick Collison. The company,
which offers payment software for e-commerce websites and mobile applications, was initially established in Palo
Alto, California. John and Patrick, who were 19 and 21 years old at the time, respectively, began working on Stripe
in early 2010. The company publicly launched in September 2011 after a lengthy private beta period.\\\\n\\\\n### 3.
Additional context (if relevant):\\\\n- The Collison brothers secured a $2 million investment from notable
investors, including Peter Thiel, Elon Musk, Sequoia Capital, and others, in May 2011.\\\\n- Stripe has since grown
significantly, processing over $1 trillion in payments through its software, contributing to its rapid rise in
popularity. The company has become a leading player in the financial technology sector, with a valuation that has
surpassed $95 billion.
Out: None
[2m[Step 0: Duration 45.47 seconds| Input tokens: 2,691 | Output tokens: 268][0m
[Step 0: Duration 45.47 seconds| Input tokens: 2,691 | Output tokens: 268]
[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [0m[1mStep [0m[1;36m1[0m[38;2;212;183;2m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Step 1 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโ [1mExecuting this code:[0m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m1 [0m[38;2;255;70;137;48;2;39;40;34mimport[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;248;248;242;48;2;39;40;34mdatetime[0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m2 [0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m3 [0m[38;2;248;248;242;48;2;39;40;34mfounding_year[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34m=[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;174;129;255;48;2;39;40;34m2010[0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m4 [0m[38;2;248;248;242;48;2;39;40;34mcurrent_year[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34m=[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;248;248;242;48;2;39;40;34mdatetime[0m[38;2;255;70;137;48;2;39;40;34m.[0m[38;2;248;248;242;48;2;39;40;34mdatetime[0m[38;2;255;70;137;48;2;39;40;34m.[0m[38;2;248;248;242;48;2;39;40;34mnow[0m[38;2;248;248;242;48;2;39;40;34m([0m[38;2;248;248;242;48;2;39;40;34m)[0m[38;2;255;70;137;48;2;39;40;34m.[0m[38;2;248;248;242;48;2;39;40;34myear[0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m5 [0m[38;2;248;248;242;48;2;39;40;34myears_since_founded[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34m=[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;248;248;242;48;2;39;40;34mcurrent_year[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;255;70;137;48;2;39;40;34m-[0m[38;2;248;248;242;48;2;39;40;34m [0m[38;2;248;248;242;48;2;39;40;34mfounding_year[0m[48;2;39;40;34m [0m โ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m6 [0m[38;2;248;248;242;48;2;39;40;34mprint[0m[38;2;248;248;242;48;2;39;40;34m([0m[38;2;248;248;242;48;2;39;40;34myears_since_founded[0m[38;2;248;248;242;48;2;39;40;34m)[0m[48;2;39;40;34m [0m โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Executing this code: โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ 1 import datetime โ โ 2 โ โ 3 founding_year = 2010 โ โ 4 current_year = datetime.datetime.now().year โ โ 5 years_since_founded = current_year - founding_year โ โ 6 print(years_since_founded) โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[1mExecution logs:[0m 15 Out: None
Execution logs:
15
Out: None
[2m[Step 1: Duration 7.91 seconds| Input tokens: 5,155 | Output tokens: 350][0m
[Step 1: Duration 7.91 seconds| Input tokens: 5,155 | Output tokens: 350]
[38;2;212;183;2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ [0m[1mStep [0m[1;36m2[0m[38;2;212;183;2m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Step 2 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญโ [1mExecuting this code:[0m โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ [1;38;2;227;227;221;48;2;39;40;34m [0m[38;2;101;102;96;48;2;39;40;34m1 [0m[38;2;248;248;242;48;2;39;40;34mfinal_answer[0m[38;2;248;248;242;48;2;39;40;34m([0m[38;2;248;248;242;48;2;39;40;34myears_since_founded[0m[38;2;248;248;242;48;2;39;40;34m)[0m[48;2;39;40;34m [0m โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Executing this code: โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ โ 1 final_answer(years_since_founded) โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
[1;38;2;212;183;2mOut - Final answer: 15[0m
Out - Final answer: 15
[2m[Step 2: Duration 5.18 seconds| Input tokens: 7,808 | Output tokens: 406][0m
[Step 2: Duration 5.18 seconds| Input tokens: 7,808 | Output tokens: 406]
15
Our agents managed to efficiently collaborate towards solving the task! โ
๐ก You can easily extend this to more agents: one does the code execution, one the web search, one handles file loadings...
๐ค๐ญ One could even think of doing more complex, tree-like hierarchies, with one CEO agent handling multiple middle managers, each with several reports.
We could even add more intermediate layers of management, each with multiple daily meetings, lots of agile stuff with scrum masters, and each new component adds enough friction to ensure the tasks never get done... Ehm wait, no, let's stick with our simple structure.
