Close Menu
    Trending
    • Is Your AI Whispering Secrets? How Scientists Are Teaching Chatbots to Forget Dangerous Tricks | by Andreas Maier | Jul, 2025
    • Qantas data breach to impact 6 million airline customers
    • He Went From $471K in Debt to Teaching Others How to Succeed
    • An Introduction to Remote Model Context Protocol Servers
    • Blazing-Fast ML Model Serving with FastAPI + Redis (Boost 10x Speed!) | by Sarayavalasaravikiran | AI Simplified in Plain English | Jul, 2025
    • AI Knowledge Bases vs. Traditional Support: Who Wins in 2025?
    • Why Your Finance Team Needs an AI Strategy, Now
    • How to Access NASA’s Climate Data — And How It’s Powering the Fight Against Climate Change Pt. 1
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Artificial Intelligence»Multi-Agentic RAG with Hugging Face Code Agents | by Gabriele Sgroi, PhD | Dec, 2024
    Artificial Intelligence

    Multi-Agentic RAG with Hugging Face Code Agents | by Gabriele Sgroi, PhD | Dec, 2024

    Team_AIBS NewsBy Team_AIBS NewsDecember 31, 2024No Comments78 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Utilizing Qwen2.5–7B-Instruct powered code brokers to create a neighborhood, open supply, multi-agentic RAG system

    Towards Data Science

    Picture by Jaredd Craig on Unsplash

    Massive Language Fashions have proven spectacular capabilities and they’re nonetheless present process regular enhancements with every new era of fashions launched. Purposes reminiscent of chatbots and summarisation can straight exploit the language proficiency of LLMs as they’re solely required to supply textual outputs, which is their pure setting. Massive Language Fashions have additionally proven spectacular skills to know and remedy complicated duties, however so long as their answer stays “on paper”, i.e. in pure textual type, they want an exterior person to behave on their behalf and report again the outcomes of the proposed actions. Agent methods remedy this downside by letting the fashions act on their surroundings, often by way of a set of instruments that may carry out particular operations. On this method, an LLM can discover options iteratively by trial and error whereas interacting with the surroundings.

    An fascinating state of affairs is when the instruments that an LLM agent has entry to are brokers themselves: that is the core idea of multi-agentic methods. A multi-agentic system solves duties by distributing and delegating duties to specialised fashions and placing their output collectively like puzzle items. A typical solution to implement such methods is through the use of a supervisor agent to orchestrate and coordinate different brokers’ workflow.

    Agentic methods, and particularly multi-agentic methods, require a robust LLM as a spine to carry out correctly, because the underlying mannequin wants to have the ability to perceive the aim and applicability of the assorted instruments in addition to break up the unique downside into sub-problems that may be tackled by every software. Because of this, proprietary fashions like ChatGpt or Anthropic’s Claude are usually the default go-to answer for agentic methods. Thankfully, open-source LLMs have continued to see large enhancements in efficiency a lot in order that a few of them now rival proprietary fashions in some situations. Much more curiously, modestly-sized open LLMs can now carry out complicated duties that had been unthinkable a few years in the past.

    On this weblog put up, I’ll present how a “small” LLM that may run on client {hardware} is succesful sufficient to energy a multi-agentic system with good outcomes. Specifically, I’ll give a tutorial on how you should utilize Qwen2.5–7B-Instruct to create a multi-agentic RAG system. You’ll find the code implementation within the following GitHub repo and an illustrative Colab notebook.

    Earlier than diving into the small print of the system structure, I’ll recall some fundamental notions concerning LLM brokers that can be helpful to higher perceive the framework.

    ReAct, proposed in ReAct: Synergizing Reasoning and Acting in Language Models, is a well-liked framework for constructing LLM brokers. The primary concept of the strategy is to include the effectiveness of Chain of Thought prompting into an agent framework. ReACT consists of interleaved reasoning and motion steps: the Massive Language Mannequin is prompted to supply a thought sequence earlier than emitting an motion. On this method the mannequin can create dynamic reasoning traces to steer actions and replace the high-level plan whereas incorporating data coming from the interplay with the surroundings. This enables for an iterative and incremental method to fixing the given job. In follow, the workflow of a ReAct agent is made up of Thought, Motion, and Statement sequences: the mannequin produces reasoning for a normal plan and particular software utilization within the Thought step, then invokes the related software within the Motion step, and eventually receives suggestions from the surroundings within the Statement.

    Under is an instance of what the ReACT framework appears to be like like.

    Comparability between the ReACT, Chain-of-Thought, and Act-Solely frameworks for a Query Answering job. Picture from ReAct: Synergizing Reasoning and Acting in Language Models.

    Code brokers are a specific sort of LLM brokers that use executable Python code to work together with the surroundings. They’re based mostly on the CodeAct framework proposed within the paper Executable Code Actions Elicit Better LLM Agents. CodeAct is similar to the ReAct framework, with the distinction that every motion consists of arbitrary executable code that may carry out a number of operations. Hand-crafted instruments are offered to the agent as common Python features that it could possibly name within the code.

    Code brokers include a singular set of benefits over extra conventional brokers utilizing JSON or different textual content codecs to carry out actions:

    • They will leverage present software program packages together with hand-crafted task-specific instruments.
    • They will self-debug the generated code through the use of the error messages returned after an error is raised.
    • LLMs are acquainted with writing code as it’s usually extensively current of their pre-training information, making it a extra pure format to write down their actions.
    • Code naturally permits for the storage of intermediate outcomes and the composition of a number of operations in a single motion, whereas JSON or different textual content codecs may have a number of actions to perform the identical.

    For these causes, Code Brokers can supply improved efficiency and quicker execution pace than brokers utilizing JSON or different textual content codecs to execute actions.

    Comparability between code brokers and brokers utilizing JSON or textual content as actions. Picture from Executable Code Actions Elicit Better LLM Agents.

    Under is a concrete instance from the unique paper that showcases how code brokers can require fewer actions to resolve sure duties.

    Code brokers vs brokers utilizing JSON/textual content motion format. Code brokers can execute a number of operations in a single motion. Picture from Executable Code Actions Elicit Better LLM Agents. [RIVEDERE]

    The Hugging Face transformers library gives helpful modules to construct brokers and, particularly, code brokers. The Hugging Face transformer brokers framework focuses on readability and modularity as core design ideas. These are notably vital when constructing an agent system: the complexity of the workflow makes it important to have management over all of the interconnected elements of the structure. These design decisions make Hugging Face brokers an ideal software for constructing customized and versatile agent methods. When utilizing open-source fashions to energy the agent engine, the Hugging Face brokers framework has the additional benefit of permitting easy accessibility to the fashions and utilities current within the Hugging Face ecosystem.

    Hugging Face code brokers additionally deal with the problem of insecure code execution. Actually, letting an LLM generate code unrestrained can pose severe dangers because it may carry out undesired actions. For instance, a hallucination may trigger the agent to erase vital recordsdata. In an effort to mitigate this danger, Hugging Face code brokers implementation makes use of a ground-up method to safe code execution: the code interpreter can solely execute explicitly approved operations. That is in distinction to the same old top-down paradigm that begins with a totally useful Python interpreter after which forbids actions that could be harmful. The Hugging Face implementation features a listing of secure, approved features that may be executed and gives a listing of secure modules that may be imported. Anything is just not executable until it has been preemptively approved by the person. You possibly can learn extra about Hugging Face (code) brokers of their weblog posts:

    Retrieval Augmented Era has turn out to be the de facto commonplace for data retrieval duties involving Massive Language Fashions. It may possibly assist maintain the LLM data updated, give entry to particular data, and cut back hallucinations. It may possibly additionally improve human interpretability and supervision by returning the sources the mannequin used to generate its reply. The standard RAG workflow, consisting of a retrieval course of based mostly on semantic similarity to a person’s question and a mannequin’s context enhancement with the retrieved data, is just not sufficient to resolve some particular duties. Some conditions that aren’t fitted to conventional RAG embrace duties that want interactions with the data sources, queries needing a number of items of data to be answered, and complicated queries requiring non-trivial manipulation to be linked with the precise data contained within the sources.

    A concrete difficult instance for conventional RAG methods is multi-hop query answering (MHQA). It entails extracting and mixing a number of items of data, presumably requiring a number of iterative reasoning processes over the extracted data and what’s nonetheless lacking. As an example, if the mannequin has been requested the query “Does birch plywood float in ethanol?”, even when the sources used for RAG contained details about the density of each supplies, the usual RAG framework may fail if these two items of data usually are not straight linked.

    A preferred solution to improve RAG to keep away from the abovementioned shortcomings is to make use of agentic methods. An LLM agent can break down the unique question right into a collection of sub-queries after which use semantic search as a software to retrieve passages for these generated sub-queries, altering and adjusting its plan as extra data is collected. It may possibly autonomously resolve whether or not it has collected sufficient data to reply every question or if it ought to proceed the search. The agentic RAG framework could be additional enhanced by extending it to a multi-agentic system by which every agent has its personal outlined duties and duties. This enables, for instance, the separation between the high-level job planning and the interplay with the doc sources. Within the subsequent part, I’ll describe a sensible implementation of such a system.

    On this part, I’ll talk about the overall architectural decisions I used to implement a Multi-Agentic RAG system based mostly on code brokers following the ReAct framework. You’ll find the remaining particulars within the full code implementation within the following GitHub repo.

    The purpose of the multi-agentic system is to reply a query by looking the mandatory data on Wikipedia. It’s made up of three brokers:

    • A supervisor agent whose job is to interrupt down the duty into sub-tasks and use their output to supply a ultimate reply.
    • A Wikipedia search agent that finds related pages on Wikipedia and combines the data extracted from them.
    • A web page search agent to retrieve and summarize data related to a given question from the offered Wikipedia web page.

    These three brokers are organized in a hierarchical trend: every agent can use the agent instantly beneath within the hierarchy as a software. Specifically, the supervisor agent can name the Wikipedia search agent to search out details about a question which, in flip, can use the web page search agent to extract explicit data from Wikipedia pages.

    Under is the diagram of the structure, specifying which hand-crafted instruments (together with instruments wrapping different brokers) every agent can name. Discover that since code brokers act utilizing code execution, these usually are not truly the one instruments they will use as any native Python operation and performance (so long as it’s approved) can be utilized as effectively.

    Structure diagram exhibiting brokers and hand-crafted instruments. Picture by the creator.

    Let’s dive into the small print of the workings of the brokers concerned within the structure.

    Supervisor agent

    That is the top-level agent, it receives the person’s query and it’s tasked to return a solution. It may possibly use the Wikipedia search agent as a software by prompting it with a question and receiving the ultimate outcomes of the search. Its goal is to gather the mandatory items of data from Wikipedia by dividing the person query right into a collection of sub-queries and placing collectively the results of the search.

    Under is the system immediate used for this agent. It’s constructed upon the default Hugging Face default immediate template. Discover that the examples offered within the immediate comply with the chat template of the mannequin powering the agent, on this case, Qwen2.5–7B-Instruct.

    You're an professional assistant who can discover reply on the web utilizing code blobs and instruments. To take action, you've been given entry to a listing of instruments: these instruments are mainly Python features which you'll name with code.
    You'll be given the duty of answering a person query and you must reply it by retrieving the mandatory data from Wikipedia. Use and belief solely the data you retrieved, do not make up false information.
    That can assist you, you've been given entry to a search agent you should utilize as a software. You should utilize the search agent to search out data on Wikipedia. Break down the duty into smaller sub-tasks and use the search agent to search out the mandatory data for every sub-task.
    To unravel the duty, you could plan ahead to proceed in a collection of steps, in a cycle of 'Thought:', 'Code:', and 'Statement:' sequences.
    At every step, within the 'Thought:' sequence, you must first clarify your reasoning in direction of fixing the duty and the instruments that you simply need to use.
    Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '' sequence.
    Throughout every intermediate step, you should utilize 'print()' to save lots of no matter vital data you'll then want. These print outputs can be offered again to you by the person within the 'Statement:' area, which can be accessible as enter for the following steps. All the time print the output of instruments, do not course of it or attempt to extract data earlier than inspecting it.
    If an error rise whereas executing the code, will probably be proven within the 'Statement:' area. In that case, repair the code and take a look at once more.

    In the long run you must return a ultimate reply utilizing the `final_answer` software.

    Listed here are a number of notional examples:
    ---
    <|im_start|>person
    Activity: When was the capital of Italy based?<|im_end|>
    <|im_start|>assistant
    Thought: Let's break up the duty: I first want to search out the capital of Italy after which take a look at its basis date. I'll use the software `wikipedia_search_agent` to get the capital of Italy. Code:
    ```py
    outcome = wikipedia_search_agent("Italy capital")
    print("Capital of Italy:", outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 0] -> Statement:
    Capital of Italy:Based on the data extracted from the Wikipedia web page 'Rome', the capital of Italy is Rome.<|im_end|>
    <|im_start|>assistant
    Thought: Now that I do know that the capital of Italy is Rome, I can use the `wikipedia_search_agent` software to search for its basis date.
    Code:
    ```py
    outcome = wikipedia_search_agent("Rome basis date")
    print("Rome basis:", outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 1] -> Statement:
    Rome basis: Based on the data from the Wikipedia web page 'Natale di Roma', the normal basis date of Rome is April 21, 753 BC.<|im_end|>
    <|im_start|>assistant
    Thought: Now that I've retrieved the related data, I can use the `final_answer` software to return the reply.
    Code:
    ```py
    final_answer("Based on the legend Rome was based on 21 April 753 BCE, however archaeological proof dates again its growth in the course of the Bronze Age.")
    ```<|im_end|>
    ---
    <|im_start|>person
    Activity: "What is the distinction in inhabitants between Shanghai and New York?"<|im_end|>
    <|im_start|>assistant
    Thought: I must get the populations for each cities and examine them: I'll use the software `search_agent` to get the inhabitants of each cities.
    Code:
    ```py
    population_guangzhou_info = wikipedia_search_agent("New York Metropolis inhabitants")
    population_shanghai_info = wikipedia_search_agent("Shanghai inhabitants")
    print("Inhabitants Guangzhou:", population_guangzhou)
    print("Inhabitants Shanghai:", population_shanghai)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 0] -> Statement:
    Inhabitants Guangzhou: The inhabitants of New York Metropolis is roughly 8,258,035 as of 2023.
    Inhabitants Shanghai: Based on the data extracted from the Wikipedia web page 'Shanghai', the inhabitants of the town correct is round 24.87 million inhabitants in 2023.<|im_end|>
    <|im_start|>assistant
    Thought: Now I do know each the inhabitants of Shanghai (24.87 million) and of New York Metropolis (8.25 million), I'll calculate the distinction and return the outcome.
    Code:
    ```py
    population_difference = 24.87*1e6 - 8.25*1e6
    reply=f"The distinction in inhabitants between Shanghai and New York is {population_difference} inhabitants."
    final_answer(reply)
    ```<|im_end|>
    ---

    On prime of performing computations within the Python code snippets that you simply create, you've entry to these instruments (and no different software):

    <>

    <>

    You should utilize imports in your code, however completely from the next listing of modules: <>. Don't attempt to import different modules or else you're going to get an error.
    Now begin and remedy the duty!

    Wikipedia search agent

    This agent studies to the supervisor agent, it receives a question from it and it’s tasked to return the data it has retrieved from Wikipedia. It may possibly entry two instruments:

    • A Wikipedia search software, utilizing the built-in search operate from the wikipedia package. It receives a question as enter and returns a listing of Wikipedia pages and their summaries.
    • A web page search agent that retrieves details about a question from a selected Wikipedia web page.

    This agent collects the data to reply the question, dividing it into additional sub-queries, and mixing data from a number of pages if wanted. That is achieved through the use of the search software of the wikipedia bundle to establish potential pages that may comprise the mandatory data to reply the question: the agent can both use the reported web page summaries or name the web page search agent to extract extra data from a selected web page. After sufficient information has been collected, it returns a solution to the supervisor agent.

    The system immediate is once more a slight modification of the Hugging Face default immediate with some particular examples following the mannequin’s chat template.

    You're an professional assistant that retrieves data from Wikipedia utilizing code blobs and instruments. To take action, you've been given entry to a listing of instruments: these instruments are mainly Python features which you'll name with code.
    You'll be given a normal question, your job can be of retrieving and summarising data that's related to the question from a number of passages retrieved from the given Wikipedia web page. Use and belief solely the data you retrieved, do not make up false information. Attempt to summarize the data in a number of sentences.
    To unravel the duty, you could plan ahead to proceed in a collection of steps, in a cycle of 'Thought:', 'Code:', and 'Statement:' sequences.
    At every step, within the 'Thought:' sequence, you must first clarify your reasoning in direction of fixing the duty and the instruments that you simply need to use.
    Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '' sequence.
    Throughout every intermediate step, you should utilize 'print()' to save lots of no matter vital data you'll then want. These print outputs can be offered again to you by the person within the 'Statement:' area, which can be accessible as enter for the following steps. All the time print the output of instruments, do not course of it or attempt to extract data earlier than inspecting it.
    If an error rise whereas executing the code, will probably be proven within the 'Statement:' area. In that case, repair the code and take a look at once more.

    In the long run you must return a ultimate reply utilizing the `final_answer` software.

    Listed here are a number of notional examples:
    ---
    <|im_start|>person
    Activity: Retrieve details about the question:"What is the capital of France?" from the Wikipedia web page "France".<|im_end|>
    <|im_start|>assistant
    Thought: I want to search out the capital of France. I'll use the software `retrieve_passages` to get the capital of France from the Wikipedia web page.
    Code:
    ```py
    outcome = retrieve_passages("France capital")
    print("Capital of France:", outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 0] -> Statement:
    Retrieved passages for question "France capital":
    Passage 0: ... inhabitants of practically 68.4 million as of January 2024. France is a semi-presidential republic with its capital in Paris, the ...
    Passage 1: ... France, formally the French Republic, is a rustic situated primarily in Western Europe. Its abroad areas and territories ...
    Passage 2: ... The overwhelming majority of France's territory and inhabitants is located in Western Europe and is named Metropolitan France. It's ...
    Passage 3: ... France is a extremely urbanised nation, with its largest cities (by way of metropolitan space inhabitants in 2021) being Paris ...
    Passage 4: ... === Authorities ===nFrance.fr – official French tourism website (in English)...<|im_end|>
    <|im_start|>assistant
    Thought: Now that I do know that the capital of France is Paris, I can use the `final_answer` software to return the reply.
    Code:
    ```py
    final_answer("The capital of France is Paris.")
    ```<|im_end|>
    ---
    <|im_start|>person
    Activity: Retrieve details about the question:"Tallest mountain within the World" from the Wikipedia web page "Checklist of highest mountains on Earth"<|im_end|>
    <|im_start|>assistant
    Thought: I want to search out the tallest mountain on this planet. I'll use the software `retrieve_passages` to search for information on the Wikipedia web page.
    Code:
    ```py
    outcome = retrieve_passages("highest mountain")
    print(outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 1] -> Statement:
    Retrieved passages for question "highest mountain":
    Passage 0: ... above sea stage) is the world's tallest mountain and volcano, rising about 10,203 m (33,474 ft) from the Pacific Ocean flooring. ...
    Passage 1: ... As of December 2018, the best peaks on 4 of the mountains—Gangkhar Puensum, Labuche Kang III, Karjiang, and Tongshanjiabu, all situated in Bhutan or China—haven't been ascended. ...
    Passage 2: ... The best mountains above sea stage are usually not the best above the encircling terrain. ...
    Passage 3: ... The best mountain outdoors of Asia is Aconcagua (6,961 m or 22,838 ft), the 189th highest on this planet. ...
    Passage 4: ... the southern summit of Peru's tallest mountain, Huascarán, is one other contender. Each have elevations above sea stage greater than 2 km (1.2 mi) lower than that of Everest....
    <|im_end|>
    <|im_start|>assistant
    Thought: The outcomes do not clearly specify a transparent outcome for the world's tallest mountain, I'll use the software `web_results` with a distinct question.
    Code:
    ```py
    outcome = retrieve_passages("world's tallest mountain")
    print(outcome)
    ```<|im_end|>
    <|im_start|>person
    Passages retrieved from web page Checklist of highest mountains on Earth:
    Passage 0: ... The best mountain outdoors of Asia is Aconcagua (6,961 m or 22,838 ft), the 189th highest on this planet....
    Passage 1: ... above sea stage) is the world's tallest mountain and volcano, rising about 10,203 m (33,474 ft) from the Pacific Ocean flooring. ...
    Passage 2: ... The bases of mountain islands are beneath sea stage, and given this consideration Mauna Kea (4,207 m (13,802 ft) above sea stage) is the world's tallest mountain and volcano, rising about 10,203 m (33,474 ft) from the Pacific Ocean flooring. ...
    Passage 3: ... the southern summit of Peru's tallest mountain, Huascarán, is one other contender. Each have elevations above sea stage greater than 2 km (1.2 mi) lower than that of Everest. ...
    Passage 4: ... The best mountains are additionally not usually essentially the most voluminous. Mauna Loa (4,169 m or 13,678 ft) is the biggest mountain on Earth by way of base space (about 5,200 km2 or 2,000 sq mi) and quantity (about 42,000 km3 or 10,000 cu mi)...<|im_end|>
    <|im_start|>assistant
    Thought: I've discovered that Mauna Kea is the world's tallest mountain rising about 10,203 m (33,474 ft) from the Pacific Ocean flooring. I can use the `final_answer` software to return the related data.
    Code:
    ```py
    final_answer("Mauna Kea is the world's tallest mountain, rising about 10,203 m (33,474 ft) from the Pacific Ocean flooring.")
    ```<|im_end|>
    ___
    On prime of performing computations within the Python code snippets that you simply create, you've entry to these instruments (and no different software):

    <>

    <>

    You should utilize imports in your code, however solely from the next listing of modules: <>. Don't attempt to import different modules or else you're going to get an error.
    Now begin and remedy the duty!

    Web page search agent

    This agent studies to the Wikipedia search agent, which gives it with a question and the title of a Wikipedia web page, and it’s tasked to retrieve the related data to reply the question from that web page. That is, in essence, a single-agent RAG system. To carry out the duty, this agent generates customized queries and makes use of the semantic search software to retrieve the passages which can be extra much like them. The semantic search software follows a easy implementation that splits the web page contents into chunks and embeds them utilizing the FAISS vector database offered by LangChain.

    Under is the system immediate, nonetheless constructed upon the one offered by default by Hugging Face

    You're an professional assistant that finds solutions to questions by consulting Wikipedia, utilizing code blobs and instruments. To take action, you've been given entry to a listing of instruments: these instruments are mainly Python features which you'll name with code.
    You'll be given a normal question, your job can be of discovering a solution to the question utilizing the data you retrieve from Wikipedia. Use and belief solely the data you retrieved, do not make up false information. Cite the web page the place you discovered the data.
    You possibly can seek for pages and their summaries from Wikipedia utilizing the `search_wikipedia` software and search for particular passages from a web page utilizing the `search_info` software. You must resolve the way to use these instruments to search out an acceptable reply:some queries could be answered by taking a look at one web page abstract, others can require taking a look at particular passages from a number of pages.
    To unravel the duty, you could plan ahead to proceed in a collection of steps, in a cycle of 'Thought:', 'Code:', and 'Statement:' sequences.
    At every step, within the 'Thought:' sequence, you must first clarify your reasoning in direction of fixing the duty and the instruments that you simply need to use.
    Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '' sequence.
    Throughout every intermediate step, you should utilize 'print()' to save lots of no matter vital data you'll then want. These print outputs can be offered again to you by the person within the 'Statement:' area, which can be accessible as enter for the following steps. All the time print the output of instruments, do not course of it or attempt to extract data earlier than inspecting it.
    If an error rise whereas executing the code, will probably be proven within the 'Statement:' area. In that case, repair the code and take a look at once more.

    In the long run you must return a ultimate reply utilizing the `final_answer` software.

    Listed here are a number of notional examples:
    ---
    <|im_start|>person
    Activity: When was the traditional thinker Seneca born?<|im_end|>
    <|im_start|>assistant
    Thought: I'll use the software `search_wikipedia` to seek for Seneca's delivery on Wikipedia. I'll specify I'm on the lookout for the thinker for disambiguation.
    Code:
    ```py
    outcome = search_wikipedia("Seneca thinker delivery")
    print("outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 0] -> Statement:
    Pages discovered for question 'Seneca thinker delivery':
    Web page: Seneca the Youthful
    Abstract: Lucius Annaeus Seneca the Youthful ( SEN-ik-ə; c.4 BC – AD 65), often identified mononymously as Seneca, was a Stoic thinker of Historic Rome, a statesman, dramatist, and in a single work, satirist, from the post-Augustan age of Latin literature.
    Seneca was born in Colonia Patricia Corduba in Hispania, a
    Web page: Phaedra (Seneca)
    Abstract: Phaedra is a Roman tragedy written by thinker and dramatist Lucius Annaeus Seneca earlier than 54 A.D. Its 1,280 traces of verse inform the story of Phaedra, spouse of King Theseus of Athens and her consuming lust for her stepson Hippolytus. Primarily based on Greek mythology and the tragedy Hippolytus by Euripides,
    Web page: Seneca the Elder
    Abstract: Lucius Annaeus Seneca the Elder ( SEN-ik-ə; c.54 BC – c. AD 39), also called Seneca the Rhetorician, was a Roman author, born of a rich equestrian household of Corduba, Hispania. He wrote a group of reminiscences in regards to the Roman colleges of rhetoric, six books of that are extant in a extra or
    Web page: AD 1
    Abstract: AD 1 (I) or 1 CE was a standard 12 months beginning on Saturday or Sunday, a standard 12 months beginning on Saturday by the proleptic Julian calendar, and a standard 12 months beginning on Monday by the proleptic Gregorian calendar. It's the epoch 12 months for the Anno Domini (AD) Christian calendar period, and the first 12 months of
    Web page: Seneca Falls Conference
    Abstract: The Seneca Falls Conference was the primary girls's rights conference. It marketed itself as "a conference to debate the social, civil, and non secular situation and rights of girl". Held within the Wesleyan Chapel of the city of Seneca Falls, New York, it spanned two days over July 19–20, 1848. Attrac
    <|im_start|>assistant
    Thought: From the abstract of the web page "", I can see that Seneca was born in . I can use the `final_answer` software to return the reply.
    Code:
    ```py
    final_answer("Based on the Wikipedia web page 'Seneca the Youthful', Seneca was born in 4 BC.")
    ```<|im_end|>
    ---
    <|im_start|>person
    Activity: Who was Charlemagne predecessor?<|im_end|>
    <|im_start|>assistant
    Thought: I'll use the software `search_wikipedia` to seek for Charlemagne reign period.
    Code:
    ```py
    outcome = search_wikipedia("Charlemagne predecessor")
    print(outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 0] -> Statement:
    Pages discovered for question 'Charlemagne predecessor':
    Web page: Charlemagne
    Abstract: Charlemagne ( SHAR-lə-mayn; 2 April 748 – 28 January 814) was King of the Franks from 768, King of the Lombards from 774, and Emperor of what's now often known as the Carolingian Empire from 800, holding these titles till his dying in 814. He united most of Western and Central Europe, and was the primary
    Web page: Pope Leo III
    Abstract: Pope Leo III (Latin: Leo III; died 12 June 816) was bishop of Rome and ruler of the Papal States from 26 December 795 to his dying. Protected by Charlemagne from the supporters of his predecessor, Adrian I, Leo subsequently strengthened Charlemagne's place by crowning him emperor. The coronation
    Web page: Throne of Charlemagne
    Abstract: The Throne of Charlemagne (German: Karlsthron or Aachener Königsthron, "Royal Throne of Aachen") is a throne erected within the 790s by Charlemagne, as one of many fittings of his palatine chapel in Aachen (as we speak's Aachen Cathedral) and positioned within the Octagon of the church. Till 1531, it served because the co
    Web page: Louis the Pious
    Abstract: Louis the Pious (Latin: Hludowicus Pius; French: Louis le Pieux; German: Ludwig der Fromme; 16 April 778 – 20 June 840), additionally referred to as the Truthful and the Debonaire, was King of the Franks and co-emperor together with his father, Charlemagne, from 813. He was additionally King of Aquitaine from 781. As the one surviving
    Web page: Holy Roman Emperor
    Abstract: The Holy Roman Emperor, initially and formally the Emperor of the Romans (Latin: Imperator Romanorum; German: Kaiser der Römer) in the course of the Center Ages, and also called the Romano-German Emperor for the reason that early fashionable interval (Latin: Imperator Germanorum; German: Römisch-deutscher Kaiser, lit. 'R
    <|im_end|>
    <|im_start|>assistant
    Thought: The outcomes do not comprise specific details about Charlemagne predecessor, I'll seek for extra data on the web page 'Charlemagne' utilizing the 'search_info' software.
    Code:
    ```py
    outcome = search_info("Charlemagne predecessor", "Charlemagne")
    print(outcome)
    ```<|im_end|>
    <|im_start|>person
    [OUTPUT OF STEP 1] -> Statement:
    Info retrieved from the web page 'Charlemagne' for the question 'Charlemagne predecessor':
    Charlemagne's predecessor was Pepin the Quick.
    <|im_end|>
    <|im_start|>assistant
    Thought: I've discovered that, in response to the Wikipedia web page 'Charlemagne', Pepin the Quick was Charlemagne predecessor. I'll return the outcomes utilizing the `final_answer` software.
    Code:
    ```py
    final_answer("Based on the data extracted from the Wikipedia web page 'Charlemagne', his predecessor was Pepin the Quick.")
    ```<|im_end|>
    ___
    On prime of performing computations within the Python code snippets that you simply create, you've entry to these instruments (and no different software):

    <>

    <>

    You should utilize imports in your code, however solely from the next listing of modules: <>. Don't attempt to import different modules or else you're going to get an error.
    Now begin and remedy the duty!

    Implementation decisions

    On this subsection, I’ll define the details that differ from what might be a simple implementation of the structure utilizing Hugging Face brokers. These are the outcomes of restricted trial and error earlier than acquiring an answer that works fairly effectively. I haven’t carried out in depth testing and ablations so that they might not be the optimum decisions.

    • Prompting: as defined within the earlier sections, every agent has its personal specialised system immediate that differs from the default one offered by Hugging Face Code Brokers. I noticed that, maybe as a result of restricted dimension of the mannequin used, the overall commonplace system immediate was not giving good outcomes. The mannequin appears to work greatest with a system immediate that displays intently the duties it’s requested to carry out, together with tailor-made examples of great use circumstances. Since I used a chat mannequin with the goal of enhancing instruction following conduct, the offered examples comply with the mannequin’s chat template to be as shut as doable to the format encountered throughout a run.
    • Summarizing historical past: lengthy execution histories have detrimental results on each execution pace and job efficiency. The latter might be as a result of restricted potential of the mannequin to retrieve the mandatory data from a protracted context. Furthermore, extraordinarily lengthy execution histories may exceed the utmost context size for the engine mannequin. To mitigate these issues and pace up execution, I selected to not present all the small print of the earlier thought-action-observation steps, however as an alternative collected solely the earlier observations. Extra particularly, at every step the mannequin solely receives the next chat historical past: the system message, the primary message containing the duty, its final motion, and all of the historical past of the earlier observations. Moreover, execution errors are current within the commentary historical past provided that they occur within the final step, earlier errors which were already solved are discarded.
    • Instruments vs managed brokers: Hugging Face brokers implementation has native help for managed brokers however wrapping them as instruments permits for higher management of the prompts and a extra streamlined implementation. Specifically, Hugging Face implementation provides explicit prompts to each the managed brokers and their managers. Whereas I haven’t seen substantial variations within the potential to resolve the given job, I most popular the second method as it’s extra versatile and streamlined for the introduced structure, and it permits for simpler management over the brokers’ conduct. This additionally helps with decreasing the immediate size, which is beneficial for dashing up computations.
    • Restrict the utmost variety of trials for the web page search agent: generally the web page search agent retains on the lookout for data on a given web page that doesn’t comprise it. Decreasing the utmost variety of trials mitigated this concern: after reaching that quantity the agent execution is stopped and the software returns the final commentary from code execution.
    • Altering software response to person message: that is extra of a technical, implementation-specific level. Because the solely supported roles for the chat template of Qwen2.5–7B-Instruct are system, person, and assistant, observations are returned as person messages.

    On this part, I’ll acquire some examples produced with the described structure. I may even present the detailed execution of all of the brokers concerned within the job to showcase how they work together in some actual circumstances. You possibly can discover extra examples utilizing the illustrative Colab notebook. All of the extracted passages are taken from the Wikipedia web page specified within the execution.

    Let’s begin exploring a easy instance that requires combining data from a number of sources and a few fundamental arithmetic understanding.

    Activity: What number of years handed between the development of the Eiffel Tower and the development of the Empire State Constructing?

    Under are the logs of the execution of the supervisor agent. It may possibly appropriately break up the duty into discovering the development intervals for each buildings and compute the 12 months distinction.

    Agent:  Thought: First, I want to search out out when the Eiffel Tower and the Empire State Constructing had been constructed. I'll use the `wikipedia_search_agent` software to search out this data.
    Code:
    ```py
    wikipedia_search_agent(question="Eiffel Tower building 12 months")
    ```
    Statement: Print outputs:
    Final output from code snippet:
    Based on the data extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower came about from 1887 to 1889.
    Agent: Thought: Now I've the development interval of the Eiffel Tower. Subsequent, I want to search out the development interval of the Empire State Constructing. I'll use the `wikipedia_search_agent` software once more.
    Code:
    ```py
    wikipedia_search_agent(question="Empire State Constructing building 12 months")
    ```
    Statement: Print outputs:
    Final output from code snippet:
    Based on the data extracted from the Wikipedia web page 'Empire State Constructing', the development of the Empire State Constructing began in 1930 and led to 1931.
    Agent: Thought: Now I've the development intervals for each the Eiffel Tower and the Empire State Constructing. I can now calculate the variety of years between their constructions.
    Code:
    ```py
    construction_eiffel_tower_start = 1887
    construction_eiffel_tower_end = 1889
    construction_empire_state_building_start = 1930
    construction_empire_state_building_end = 1931

    years_passed = construction_empire_state_building_start - construction_eiffel_tower_end
    reply = f"The variety of years handed between the development of the Eiffel Tower and the Empire State Constructing is {years_passed} years."
    final_answer(reply)
    ```
    Statement: Print outputs:
    Final output from code snippet:
    The variety of years handed between the development of the Eiffel Tower and the Empire State Constructing is 41 years.

    Let’s now visualize the execution of the Wikipedia search agent. It appropriately searches and studies the development intervals discovered within the abstract of the pages, while not having to examine the person pages. It’s fascinating to notice that regardless of being requested generically in regards to the “building 12 months”, it studies your entire building interval as it isn’t clear if the 12 months refers back to the begin or the top of the development works.

    TASK:  Eiffel Tower building 12 months
    AGENT: Thought: I'll use the `search_wikipedia` software to search out details about the Eiffel Tower building 12 months.
    Code:
    ```py
    search_wikipedia('Eiffel Tower building 12 months')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'Eiffel Tower building 12 months':
    Web page: Eiffel Tower
    Abstract: The Eiffel Tower ( EYE-fəl; French: Tour Eiffel [tuʁ ɛfɛl] ) is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It's named after the engineer Gustave Eiffel, whose firm designed and constructed the tower from 1887 to 1889.
    Regionally nicknamed "La dame de fer" (French for "Iron Woman"), it was constructed because the centerpiece of the 1889 World's Truthful, and to crown the centennial anniversary of the French Revolution. Though initially criticised by a few of France's main artists and intellectuals for its design, it has since turn out to be a world cultural icon of France and one of the recognisable buildings on this planet. The tower acquired 5,889,000 guests in 2022. The Eiffel Tower is essentially the most visited monument with an entrance charge on this planet: 6.91 million folks ascended it in 2015. It was designated a monument historique in 1964, and was named a part of a UNESCO World Heritage Website ("Paris, Banks of the Seine") in 1991.
    The tower is 330 metres (1,083 ft) tall, about t
    Web page: Eiffel Tower (Paris, Texas)
    Abstract: Texas's Eiffel Tower is a landmark within the metropolis of Paris, Texas. The tower was constructed in 1993. It's a scale mannequin of the Eiffel Tower in Paris, France; at 65 toes in top, it's roughly one-sixteenth of the peak of the unique.

    Web page: Gustave Eiffel
    Abstract: Alexandre Gustave Eiffel ( EYE-fəl, French: [alɛksɑ̃dʁ ɡystav ɛfɛl]; né Bonickhausen dit Eiffel; 15 December 1832 – 27 December 1923) was a French civil engineer. A graduate of École Centrale des Arts et Manufactures, he made his title with numerous bridges for the French railway community, most famously the Garabit Viaduct. He's greatest identified for the world-famous Eiffel Tower, designed by his firm and constructed for the 1889 Common Exposition in Paris, and his contribution to constructing the Statue of Liberty in New York. After his retirement from engineering, Eiffel targeted on analysis into meteorology and aerodynamics, making important contributions in each fields.
    Web page: Watkin's Tower
    Abstract: Watkin's Tower was {a partially} accomplished iron lattice tower in Wembley Park, London, England. Its building was an bold venture to create a 358-metre (1,175 ft)-high customer attraction in Wembley Park to the north of the town, led by the railway entrepreneur Sir Edward Watkin. Marketed because the "Nice Tower of London", it was designed to surpass the peak of the Eiffel Tower in Paris, and it was a part of Wembley Park's emergence as a leisure place. The tower was by no means accomplished and it was demolished in 1907. The location of the tower is now occupied by the English nationwide soccer floor, Wembley Stadium.
    Web page: Eiffel Tower (Paris, Tennessee)
    Abstract: The Eiffel Tower is a landmark within the metropolis of Paris, Tennessee. It's a 1:20 scale reproduction of the unique situated in Paris, France.

    AGENT: Thought: From the abstract of the web page 'Eiffel Tower', I can see that the development of the Eiffel Tower came about from 1887 to 1889. I'll use the `final_answer` software to return the reply.
    Code:
    ```py
    final_answer("Based on the data extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower came about from 1887 to 1889.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Based on the data extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower came about from 1887 to 1889.
    ------------------------------
    TASK: Empire State Constructing building 12 months
    AGENT: Thought: I'll use the `search_wikipedia` software to search out details about the development 12 months of the Empire State Constructing.
    Code:
    ```py
    search_wikipedia('Empire State Constructing building 12 months')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'Empire State Constructing building 12 months':
    Web page: Empire State Constructing
    Abstract: The Empire State Constructing is a 102-story Artwork Deco skyscraper within the Midtown South neighborhood of Manhattan in New York Metropolis. The constructing was designed by Shreve, Lamb & Harmon and constructed from 1930 to 1931. Its title is derived from "Empire State", the nickname of the state of New York. The constructing has a roof top of 1,250 toes (380 m) and stands a complete of 1,454 toes (443.2 m) tall, together with its antenna. The Empire State Constructing was the world's tallest constructing till the primary tower of the World Commerce Middle was topped out in 1970; following the September 11 assaults in 2001, the Empire State Constructing was New York Metropolis's tallest constructing till it was surpassed in 2012 by One World Commerce Middle. As of 2024, the constructing is the seventh-tallest constructing in New York Metropolis, the ninth-tallest accomplished skyscraper in the USA, and the 57th-tallest accomplished skyscraper on this planet.
    The location of the Empire State Constructing, on the west facet of Fifth Avenue between West thirty third and thirty fourth St
    Web page: British Empire Constructing
    Abstract: The British Empire Constructing, additionally identified by its deal with 620 Fifth Avenue, is a business constructing at Rockefeller Middle within the Midtown Manhattan neighborhood of New York Metropolis. Accomplished in 1933, the six-story construction was designed within the Artwork Deco type by Raymond Hood, Rockefeller Middle's lead architect. The British Empire Constructing, together with the practically an identical La Maison Francaise to the south and the high-rise Worldwide Constructing to the north, comprise a bunch of retail-and-office buildings often known as the Worldwide Advanced. La Maison Francaise and the British Empire Constructing are separated by Channel Gardens, a planted pedestrian esplanade working west to the complicated's Decrease Plaza.
    The facade is product of limestone, with a important entrance alongside Fifth Avenue and secondary entrances on fiftieth Road and Channel Gardens. The highest of the British Empire Constructing incorporates setbacks, a rooftop backyard, and a partial seventh-story penthouse. The constructing's entrances comprise ornate ornament
    Web page: 2012 Empire State Constructing taking pictures
    Abstract: On August 24, 2012, a gunman shot and killed a former co-worker outdoors the Empire State Constructing in New York Metropolis. Following the preliminary taking pictures, the gunman, 58-year-old Jeffrey T. Johnson, was fatally shot by law enforcement officials after elevating his weapon at them. 9 bystanders had been wounded by stray bullets fired by the officers and ricocheting particles, however none suffered life-threatening accidents.
    Web page: Empire State Constructing in standard tradition
    Abstract: The Empire State Constructing is a 102-story skyscraper on Fifth Avenue between West thirty third and thirty fourth Streets in Midtown, Manhattan, New York Metropolis. It has a roof top of 1,250 toes (381 m), and with its antenna included, it stands a complete of 1,454 toes (443.2 m) tall. The Empire State Constructing stood because the world's tallest constructing for practically 40 years, from its completion in early 1931 till the topping out of the unique World Commerce Middle's North Tower in late 1970. It has been featured in quite a few movies, TV exhibits, songs, video video games, books, images, and paintings.
    Web page: Empire State Plaza
    Abstract: The Governor Nelson A. Rockefeller Empire State Plaza (identified generally because the Empire State Plaza, and likewise because the South Mall) is a posh of a number of state authorities buildings in downtown Albany, New York.
    The complicated was constructed between 1965 and 1976 at an estimated complete value of $2 billion. It homes a number of departments of the New York State administration and is built-in with the New York State Capitol, accomplished in 1899, which homes the state legislature. Among the many places of work on the plaza are the Division of Well being and the Biggs Laboratory of the Wadsworth Middle. The Empire State Artwork Assortment, a serious public assortment of Sixties and Seventies monumental summary artworks, is on everlasting show all through the location. The New York State Workplace of Common Providers maintains the plaza. The Nelson A. Rockefeller Empire State Plaza Performing Arts Middle Company is a New York state public-benefit company that was created in 1979 to handle the performing arts facility within the plaza.

    AGENT: Thought: From the abstract of the web page "Empire State Constructing", I can see that the constructing was designed and constructed from 1930 to 1931. I'll use the `final_answer` software to return the reply.
    Code:
    ```py
    final_answer("Based on the data extracted from the Wikipedia web page 'Empire State Constructing', the development of the Empire State Constructing began in 1930 and led to 1931.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Based on the data extracted from the Wikipedia web page 'Empire State Constructing', the development of the Empire State Constructing began in 1930 and led to 1931.

    The passage retrieval agent was not used as all the data was already discovered within the summaries of the pages.

    Let’s now strive a extra sophisticated instance asking if birch plywood floats in alcohol. This query requires fundamental physics understanding and arithmetic skills, mixed with non-trivial retrieval duties.

    Activity: Does birch plywood float in ethanol?

    Let’s first visualize the logs of the assorted brokers.

    Supervisor agent logs

    AGENT:  Thought: To find out if birch plywood floats in ethanol, we have to know the density of each birch plywood and ethanol. If the density of birch plywood is lower than the density of ethanol, it'll float. I'll use the `wikipedia_search_agent` software to search out the densities of birch plywood and ethanol.
    Code:
    ```py
    birch_plywood_density_info = wikipedia_search_agent("density of birch plywood")
    ethanol_density_info = wikipedia_search_agent("density of ethanol")
    print(birch_plywood_density_info)
    print(ethanol_density_info)
    ```
    OBSERVATION: Print outputs:
    The density of birch plywood is roughly 680 kg/m³.
    The density of ethanol at 20°C is roughly 0.7894 g/cm³.

    AGENT: Thought: Now that I've the densities, I can examine them. Birch plywood has a density of 680 kg/m³ and ethanol has a density of 0.7894 g/cm³. Since 1 g/cm³ is the same as 1000 kg/m³, the density of ethanol is 789.4 kg/m³. Because the density of birch plywood (680 kg/m³) is lower than the density of ethanol (789.4 kg/m³), birch plywood will float in ethanol. I'll now present this conclusion utilizing the `final_answer` operate.
    Code:
    ```py
    final_answer("Birch plywood will float in ethanol as a result of its density (680 kg/m³) is lower than the density of ethanol (789.4 kg/m³).")
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    Birch plywood will float in ethanol as a result of its density (680 kg/m³) is lower than the density of ethanol (789.4 kg/m³).

    Wikipedia search agent logs

    TASK:  density of birch plywood
    AGENT: Thought: I'll use the `search_wikipedia` software to search out details about the density of birch plywood.
    Code:
    ```py
    search_wikipedia('birch plywood')
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'birch plywood':
    Web page: Plywood
    Abstract: Plywood is a composite materials manufactured from skinny layers, or "plies", of wooden veneer which were stacked and glued collectively. It's an engineered wooden from the household of manufactured boards, which embrace plywood, medium-density fibreboard (MDF), oriented strand board (OSB), and particle board (or chipboard).
    All plywoods bind resin and wooden fibre sheets (cellulose cells are lengthy, sturdy and skinny) to type a composite materials. The sheets of wooden are stacked such that every layer has its grain set sometimes (see beneath) perpendicular to its adjoining layers. This alternation of the grain is named cross-graining and has a number of vital advantages: it reduces the tendency of wooden to separate when nailed on the edges; it reduces thickness swelling and shrinkage, offering improved dimensional stability; and it makes the power of the panel constant throughout all instructions. There may be often an odd variety of plies, in order that the sheet is balanced, that's, the floor layers have their gr
    Web page: Birch
    Abstract: A birch is a thin-leaved deciduous hardwood tree of the genus Betula (), within the household Betulaceae, which additionally consists of alders, hazels, and hornbeams. It's intently associated to the beech-oak household Fagaceae. The genus Betula incorporates 30 to 60 identified taxa of which 11 are on the IUCN 2011 Purple Checklist of Threatened Species. They're sometimes short-lived pioneer species and are widespread within the Northern Hemisphere, notably in northern areas of temperate climates and in boreal climates. Birch wooden is used for a variety of functions.
    Web page: Birch wooden
    Abstract: Birch wooden is a sort of wooden of the birch. Birch wooden is pale yellow-brown wooden having a detailed, straight grain and uniform texture that finishes to a easy floor. Generally it's dyed to mimic mahogany. Any such wooden is used for amongst others firewood, turnery, furnishings, cabinetry, instruments handles, hoops, plywood, flooring and shoe heels.
    Web page: Falco F8L
    Abstract: The Falco F8L is an Italian-designed light-weight 2-seater aerobatic plane.
    Web page: Crusader (speedboat)
    Abstract: Crusader was a jet-powered pace boat piloted by John Cobb.
    The mixture of an aerodynamically secure hull type and turbojet propulsion was proposed by Reid Railton, Cobb's adviser. A rocket-powered scale mannequin was examined at Haslar. The total dimension design was by Peter du Cane and constructed by Vospers of Portsmouth. Technical help got here from Saunders-Roe and Vickers-Supermarine. It value £15,000 in 1949.
    It was silver and scarlet in color and 10 m lengthy.
    The engine was a de Havilland Ghost Mk 48 centrifugal turbojet offered as a mortgage by the Ministry of Provide on the request of Main Frank Halford, the engine designer. The engine was rated at 5,000 lb thrust fed by two scoop inlets ahead of the cockpit.
    The hull was of trimaran type, a important hull with a planing step, and two smaller rear-mounted outriggers. Building was of birch plywood frames and stringers. The hull was skinned in birch ply coated in doped cloth with steel pores and skin reinforcement for planing surfaces. Plane-sty

    AGENT: Thought: The pages returned from the search didn't straight point out the density of birch plywood. Nevertheless, the web page on Birch Wooden mentions that birch wooden is used for plywood. I'll use the `search_info` software to search out extra particular details about the density of birch plywood from the web page 'Plywood'.
    Code:
    ```py
    search_info('density of birch plywood', 'Plywood')
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Plywood' for the question 'density of birch plywood':
    The density of birch plywood is roughly 680 kg/m³.
    AGENT: Thought: I've discovered the density of birch plywood from the Wikipedia web page 'Plywood'. The density is roughly 680 kg/m³.
    Code:
    ```py
    final_answer("The density of birch plywood is roughly 680 kg/m³.")
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    The density of birch plywood is roughly 680 kg/m³.
    ------------------------------
    TASK: density of ethanol
    AGENT: Thought: I'll use the `search_wikipedia` software to search out the density of ethanol from Wikipedia.
    Code:
    ```py
    search_wikipedia('density of ethanol')
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'density of ethanol':
    Web page: Ethanol (information web page)
    Abstract: This web page gives supplementary chemical information on ethanol.

    Web page: Ethanol
    Abstract: Ethanol (additionally referred to as ethyl alcohol, grain alcohol, consuming alcohol, or just alcohol) is an natural compound with the chemical system CH3CH2OH. It's an alcohol, with its system additionally written as C2H5OH, C2H6O or EtOH, the place Et stands for ethyl. Ethanol is a unstable, flammable, colorless liquid with a attribute wine-like odor and pungent style. In nature, grape-sugar breaks up by the motion of fermentation into alcohol or carbonic acid, with out something being added. As a psychoactive depressant, it's the lively ingredient in alcoholic drinks, and the second most consumed drug globally behind caffeine.
    Ethanol is of course produced by the fermentation technique of sugars by yeasts or by way of petrochemical processes reminiscent of ethylene hydration. Traditionally it was used as a normal anesthetic, and has fashionable medical functions as an antiseptic, disinfectant, solvent for some medicines, and antidote for methanol poisoning and ethylene glycol poisoning. It's used as a chemical so
    Web page: Alcohol by quantity
    Abstract: Alcohol by quantity (abbreviated as alc/vol or ABV) is a regular measure of the amount of alcohol contained in a given quantity of an alcoholic beverage, expressed as a quantity p.c. It's outlined because the variety of millilitres (mL) of pure ethanol current in 100 mL (3.5 imp fl oz; 3.4 US fl oz) of answer at 20 °C (68 °F). The variety of millilitres of pure ethanol is the mass of the ethanol divided by its density at 20 °C (68 °F), which is 0.78945 g/mL (0.82353 oz/US fl oz; 0.79122 oz/imp fl oz; 0.45633 oz/cu in). The alc/vol commonplace is used worldwide. The Worldwide Group of Authorized Metrology has tables of density of water–ethanol mixtures at completely different concentrations and temperatures.
    In some nations, e.g. France, alcohol by quantity is also known as levels Homosexual-Lussac (after the French chemist Joseph Louis Homosexual-Lussac), though there's a slight distinction for the reason that Homosexual-Lussac conference makes use of the Worldwide Commonplace Ambiance worth for temperature, 15 °C (59 °F).

    Web page: Alcohol gasoline
    Abstract: Numerous alcohols are used as gasoline for inner combustion engines. The primary 4 aliphatic alcohols (methanol, ethanol, propanol, and butanol)
    are of curiosity as fuels as a result of they are often synthesized chemically or biologically, they usually have traits which permit them for use in inner combustion engines. The overall chemical system for alcohol gasoline is CnH2n+1OH.
    Most methanol is produced from pure gasoline, though it may be produced from biomass utilizing very comparable chemical processes. Ethanol is usually produced from organic materials by means of fermentation processes. Biobutanol has the benefit in combustion engines in that its vitality density is nearer to gasoline than the less complicated alcohols (whereas nonetheless retaining over 25% greater octane ranking); nonetheless, biobutanol is presently tougher to supply than ethanol or methanol. When obtained from organic supplies and/or organic processes, they're often known as bioalcohols (e.g. "bioethanol"). There isn't a chemical dif
    Web page: Cellulosic ethanol
    Abstract: Cellulosic ethanol is ethanol (ethyl alcohol) produced from cellulose (the stringy fiber of a plant) quite than from the plant's seeds or fruit. It may be produced from grasses, wooden, algae, or different vegetation. It's usually mentioned to be used as a biofuel. The carbon dioxide that vegetation take in as they develop offsets a number of the carbon dioxide emitted when ethanol constructed from them is burned, so cellulosic ethanol gasoline has the potential to have a decrease carbon footprint than fossil fuels.
    Curiosity in cellulosic ethanol is pushed by its potential to interchange ethanol constructed from corn or sugarcane. Since these vegetation are additionally used for meals merchandise, diverting them for ethanol manufacturing could cause meals costs to rise; cellulose-based sources, alternatively, usually don't compete with meals, for the reason that fibrous elements of vegetation are principally inedible to people. One other potential benefit is the excessive range and abundance of cellulose sources; grasses, bushes and algae are present in nearly each envi

    AGENT: Thought: The abstract of the web page 'Ethanol' mentions that ethanol is an alcohol with a attribute wine-like odor and pungent style. Nevertheless, it doesn't present the density of ethanol. I'll use the `search_info` software to search out the density of ethanol from the 'Ethanol (information web page)'.
    Code:
    ```py
    search_info('density of ethanol', 'Ethanol (information web page)')
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Ethanol (information web page)' for the question 'density of ethanol':
    The density of ethanol at 20°C is roughly 0.7894 g/cm³.
    AGENT: Thought: I've discovered the density of ethanol from the Wikipedia web page 'Ethanol (information web page)'. I'll return the outcome utilizing the `final_answer` software.
    Code:
    ```py
    final_answer("The density of ethanol at 20°C is roughly 0.7894 g/cm³.")
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    The density of ethanol at 20°C is roughly 0.7894 g/cm³.

    Web page search agent logs

    TASK:  Retrieve details about the question:"density of birch plywood" from the Wikipedia web page "Plywood".
    AGENT: Thought: I want to search out the density of birch plywood. I'll use the software `retrieve_passages` to search for information on the Wikipedia web page.
    Code:
    ```py
    outcome = retrieve_passages("density of birch plywood")
    print(outcome)
    ```
    OBSERVATION: Print outputs:
    Retrieved passages for question "density of birch plywood":
    Passage 0: ... . Shear stress, against this, is greater within the heart of the panel, and on the outer fibres. Inside Europe fundamental plywood could be divided into three important classes: birch plywood (density approx. 680 kg/m3), combined plywood (density approx. 620 kg/m3) and conifer plywoods (density 460–520 kg/m3). ...
    Passage 1: ... . Plane grade plywood is constructed from three or extra plies of birch, as skinny as 0.40 millimetres (1⁄64 in) thick in complete, and is extraordinarily sturdy and lightweight. ...
    Passage 2: ... Baltic Birch plywood is a product of an space across the Baltic Sea. Initially manufactured for European cupboard makers however now standard in the USA as effectively. It is vitally secure composed of an internal void-free core of cross-banded birch plys with an exterior grade adhesive. The face veneers are thicker than conventional cupboard grade ...
    Passage 3: ... . Because of this, thicker panels can span better distances beneath the identical hundreds. In bending, the utmost stress happens within the outermost layers, one in rigidity, the opposite in compression. Bending stress decreases from the utmost on the face layers to almost zero on the central layer. Shear stress, against this, is greater within the heart of the panel, and on the outer fibres. Inside Europe fundamental plywood could be divided into three important classes: birch plywood (density approx ...
    Passage 4: ... Wind turbine blades
    Insulation containers for liquefied pure gasoline (LNG) carriers
    Easy floor and correct thickness mixed with the sturdiness of the fabric makes birch plywood a positive materials for a lot of particular finish makes use of e.g.:

    Excessive-end loud audio system
    Die-cutting boards
    Supporting construction for parquet
    Playground tools
    Furnishings
    Indicators and fences for demanding outside promoting
    Musical devices
    Sports activities tools...

    AGENT: Thought: From the passages, I can see that the density of birch plywood is roughly 680 kg/m³. I can use the `final_answer` software to supply the reply.
    Code:
    ```py
    final_answer("The density of birch plywood is roughly 680 kg/m³.")
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    The density of birch plywood is roughly 680 kg/m³.
    ------------------------------
    TASK: Retrieve details about the question:"density of ethanol" from the Wikipedia web page "Ethanol (information web page)".
    AGENT: Thought: I want to search out the density of ethanol. I'll use the software `retrieve_passages` to get the data from the Wikipedia web page.
    Code:
    ```py
    outcome = retrieve_passages("density of ethanol")
    print(outcome)
    ```
    OBSERVATION: Print outputs:
    Retrieved passages for question "density of ethanol":
    Passage 0: ... == Density of ethanol at numerous temperatures ==
    Information obtained from Lange 1967

    These information correlate as ρ [g/cm3] = −8.461834×10−4 T [°C] + 0.8063372 with an R2 = 0.99999.

    == Properties of aqueous ethanol options ==
    Information obtained from Lange 1967

    == Boiling factors of aqueous options ==
    Information obtained from CRC Handbook of Chemistry (Web page 2117): 2391

    ‡Azeotropic combination

    == Charts ==

    == References == ...
    Passage 1: ... This web page gives supplementary chemical information on ethanol.

    == Materials Security Information Sheet ==
    Exterior MSDS

    == Construction and properties ==

    == Thermodynamic properties ==

    == Spectral information ==

    == Vapor strain of liquid ==

    == Density of ethanol at numerous temperatures ==
    Information obtained from Lange 1967

    These information correlate as ρ [g/cm3] = −8.461834×10−4 T [°C] + 0.8063372 with an R2 = 0.99999.

    == Properties of aqueous ethanol options ==
    Information obtained from Lange 1967...

    AGENT: Thought: From the passages, I can see that the density of ethanol varies with temperature. I can use the offered linear equation to calculate the density at a selected temperature. I'll use the `math` module to carry out the calculation.
    Code:
    ```py
    # Extract the coefficients from the equation
    a = -8.461834e-4
    b = 0.8063372

    # Calculate the density at a selected temperature, let's take 20°C for instance
    temperature = 20
    density = a * temperature + b
    print(density)
    ```
    OBSERVATION: Print outputs:
    0.789413532

    AGENT: Thought: The passage gives a linear equation to calculate the density of ethanol at completely different temperatures. I can now use this equation to supply the density of ethanol at a selected temperature. I'll use the `final_answer` software to return the related data.
    Code:
    ```py
    final_answer(f"The density of ethanol at 20°C is roughly {spherical(0.789413532, 4)} g/cm³.")
    ```
    OBSERVATION: Print outputs:
    Final output from code snippet:
    The density of ethanol at 20°C is roughly 0.7894 g/cm³.

    The mannequin appropriately identifies density distinction as the reason for floating/sinking, breaks up the duty into discovering the density of each substances, and is in a position to attract the proper conclusion from the retrieved information regardless of them being in numerous models of measurement.

    The mentioned system has spectacular capabilities, particularly contemplating the restricted dimension of the engine mannequin used, however after all, it has its personal limitations. The larger one appears to be associated to the ability of the engine mannequin itself: whereas it appears capable of perceive and comply with complicated and lengthy directions in addition to to make use of the offered instruments appropriately, generally it fails to adjust to easy tips and it tends to repeat unfruitful actions with out modifications. That is notably outstanding when the data the agent is on the lookout for is just not current (or not simply extractible utilizing the semantic search software) from the offered pages.

    One other disadvantage, intrinsic to agentic and much more outstanding in multi-agentic methods, is the computation time wanted for the assorted brokers’ execution. In some easy circumstances the place the usual RAG workflow would have been sufficient to reply the query, this might produce an pointless computational overhead.

    Lastly, having a number of brokers interacting with one another can amplify the chance of hallucinations, as a hallucination made by one agent may propagate over the execution chain, making it additionally very troublesome to trace.

    Let’s visualize an instance by which the system, whereas nonetheless offering the proper reply, made extreme use of software calls (with some repeated actions) unnecessarily extending the execution time.

    Activity: Which dynasty was ruling China on the time of the autumn of Constantinople?

    The duty requires stage of abstraction for the reason that two occasions usually are not associated and the precise 12 months of the autumn of Constantinople might not be reported on the web page of the corresponding dynasty.

    The supervisor agent execution remains to be lean and on level, fixing the duty appropriately by first retrieving the date of the autumn of Constantinople after which on the lookout for Chinese language dynasties in that 12 months. Nevertheless, we will already see that the search outcomes, whereas nonetheless containing the required data, appear a bit unusual.

    Agent:  Thought: To reply this query, I want to search out out when Constantinople fell and which Chinese language dynasty was ruling at the moment. I am going to begin by discovering the autumn date of Constantinople.
    Code:
    ```py
    wikipedia_search_agent(question="Fall of Constantinople")
    ```
    Statement: Print outputs:
    Final output from code snippet:
    The chief of the Ottoman Empire in 1453, in the course of the fall of Constantinople, was Mehmed II, also called Mehmed the Conqueror.
    Agent: Thought: From the earlier search, we all know that Constantinople fell in 1453, and it was conquered by Mehmed II. Now I want to search out out which Chinese language dynasty was ruling in 1453. I'll seek for the Chinese language dynasties round that point.
    Code:
    ```py
    wikipedia_search_agent(question="Chinese language dynasties 1453")
    ```
    Statement: Print outputs:
    Final output from code snippet:
    In 1453, the Ming dynasty was in full management of China. No particular occasions associated to 1453 are talked about within the data offered.
    Agent: Thought: Primarily based on the data offered, the Ming dynasty was in full management of China in 1453. Due to this fact, the dynasty ruling China when Constantinople fell can be the Ming dynasty.
    Code:
    ```py
    final_answer("The dynasty ruling China when Constantinople fell in 1453 was the Ming dynasty.")
    ```
    Statement: Print outputs:
    Final output from code snippet:
    The dynasty ruling China when Constantinople fell in 1453 was the Ming dynasty.

    Let’s thus examine the corresponding Wikipedia search agent duties and their execution. We will see that, presumably as a result of broad job “Fall of Constantinople”, the agent appears to be like at different particular data after having discovered the proper date. The identical occurs when retrieving details about the Chinese language dynasties, with the additional downside that some software calls had been repeated identically.

    TASK:  Fall of Constantinople
    AGENT: Thought: I'll use the `search_wikipedia` software to search out details about the autumn of Constantinople. This may possible present me with a abstract of the occasion and presumably hyperlinks to associated pages.
    Code:
    ```py
    search_wikipedia("Fall of Constantinople")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'Fall of Constantinople':
    Web page: Fall of Constantinople
    Abstract: The autumn of Constantinople, also called the conquest of Constantinople, was the seize of the capital of the Byzantine Empire by the Ottoman Empire. The town was captured on 29 Might 1453 as a part of the fruits of a 55-day siege which had begun on 6 April.
    The attacking Ottoman Military, which considerably outnumbered Constantinople's defenders, was commanded by the 21-year-old Sultan Mehmed II (later nicknamed "the Conqueror"), whereas the Byzantine military was led by Emperor Constantine XI Palaiologos. After conquering the town, Mehmed II made Constantinople the brand new Ottoman capital, changing Adrianople.
    The autumn of Constantinople and of the Byzantine Empire was a watershed of the Late Center Ages, marking the efficient finish of the Roman Empire, a state which started in roughly 27 BC and had lasted practically 1500 years. For a lot of fashionable historians, the autumn of Constantinople marks the top of the medieval interval and the start of the early fashionable interval. The town's fall additionally stood as a turni
    Web page: Sack of Constantinople
    Abstract: The sack of Constantinople occurred in April 1204 and marked the fruits of the Fourth Campaign. Crusaders sacked and destroyed most of Constantinople, the capital of the Byzantine Empire. After the seize of the town, the Latin Empire (identified to the Byzantines because the Frankokratia, or the Latin occupation) was established and Baldwin of Flanders topped as Emperor Baldwin I of Constantinople in Hagia Sophia.
    After the town's sacking, many of the Byzantine Empire's territories had been divided up among the many Crusaders. Byzantine aristocrats additionally established quite a lot of small impartial splinter states—one in every of them being the Empire of Nicaea, which might ultimately recapture Constantinople in 1261 and proclaim the reinstatement of the Empire. Nevertheless, the restored Empire by no means managed to reclaim all its former territory or attain its earlier financial power, and it regularly succumbed to the rising Ottoman Empire over the next two centuries.
    The Byzantine Empire was left poorer, smal
    Web page: Constantinople
    Abstract: Constantinople (see different names) turned the capital of the Roman Empire in the course of the reign of Constantine the Nice in 330. Following the collapse of the Western Roman Empire within the late fifth century, Constantinople remained the capital of the Japanese Roman Empire (also called the Byzantine Empire; 330–1204 and 1261–1453), the Latin Empire (1204–1261), and the Ottoman Empire (1453–1922). Following the Turkish Warfare of Independence, the Turkish capital then moved to Ankara. Formally renamed Istanbul in 1930, the town is as we speak the biggest metropolis in Europe, straddling the Bosporus strait and mendacity in each Europe and Asia, and the monetary heart of Turkey.
    In 324, following the reunification of the Japanese and Western Roman Empires, the traditional metropolis of Byzantium was chosen to function the brand new capital of the Roman Empire, and the town was renamed Nova Roma, or 'New Rome', by Emperor Constantine the Nice. On 11 Might 330, it was renamed Constantinople and devoted to Constantine. Constantin
    Web page: Moscow, third Rome
    Abstract: Moscow, third Rome (Russian: Москва — третий Рим; Moskva, tretiĭ Rim) is a theological and political idea asserting Moscow because the successor to historical Rome, with the Russian world carrying ahead the legacy of the Roman Empire. The time period "third Rome" refers to a historic matter of debate in European tradition: the query of the successor metropolis to the "first Rome" (Rome, throughout the Western Roman Empire) and the "second Rome" (Constantinople, throughout the Japanese Roman Empire).
    Web page: Byzantine Empire
    Abstract: The Byzantine Empire, additionally known as the Japanese Roman Empire, was the continuation of the Roman Empire centred in Constantinople throughout late antiquity and the Center Ages. The japanese half of the Empire survived the circumstances that brought about the autumn of the West within the fifth century AD, and continued to exist till the autumn of Constantinople to the Ottoman Empire in 1453. Throughout most of its existence, the empire remained essentially the most highly effective financial, cultural, and army power within the Mediterranean world. The time period "Byzantine Empire" was solely coined following the empire's demise; its residents referred to the polity because the "Roman Empire" and to themselves as "Romans". Because of the imperial seat's transfer from Rome to Byzantium, the adoption of state Christianity, and the predominance of Greek as an alternative of Latin, fashionable historians proceed to make a distinction between the sooner Roman Empire and the later Byzantine Empire.
    In the course of the earlier Pax Romana interval, the western elements of the empire b

    AGENT: Thought: From the abstract of the web page "Fall of Constantinople", I can see that the occasion came about in 1453. I'll use the `search_info` software to search out extra particulars in regards to the occasion, particularly who was the chief of the Ottoman Empire at the moment.
    Code:
    ```py
    search_info("chief of the Ottoman Empire in 1453", "Fall of Constantinople")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Fall of Constantinople' for the question 'chief of the Ottoman Empire in 1453':
    The chief of the Ottoman Empire in 1453 was Mehmed II, also called Mehmed the Conqueror.
    AGENT: Thought: I've discovered that the chief of the Ottoman Empire in 1453 was Mehmed II, also called Mehmed the Conqueror. I'll use the `final_answer` software to supply the reply.
    Code:
    ```py
    final_answer("The chief of the Ottoman Empire in 1453, in the course of the fall of Constantinople, was Mehmed II, also called Mehmed the Conqueror.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The chief of the Ottoman Empire in 1453, in the course of the fall of Constantinople, was Mehmed II, also called Mehmed the Conqueror.
    ------------------------------
    TASK: Chinese language dynasties 1453
    AGENT: Thought: I'll use the `search_wikipedia` software to search out details about Chinese language dynasties across the 12 months 1453. I'll present a normal question associated to Chinese language dynasties in that point interval.
    Code:
    ```py
    search_wikipedia('Chinese language dynasties 1453')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Pages discovered for question 'Chinese language dynasties 1453':
    Web page: Chinese language Empire
    Abstract: Chinese language Empire (or Empire of China) is a time period referring to the realm dominated by the Emperor of China in the course of the period often known as Imperial China. It was coined by western students and used to explain the Ming and Qing dynasties (or imperial Chinese language dynasties generally). One other time period was "Celestial Empire", in reference to the standing of the emperor because the Son of Heaven. In 221 BC, China was unified beneath an emperor for the primary time, and numerous dynasties or empires based by hereditary monarchs dominated China for a complete of two millennia since then, together with the Qin, Han, Jin, Sui, Tang, Music, Yuan, Ming, and Qing.

    Web page: Ming dynasty
    Abstract: The Ming dynasty, formally the Nice Ming, was an imperial dynasty of China, ruling from 1368 to 1644 following the collapse of the Mongol-led Yuan dynasty. The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China. Though the first capital of Beijing fell in 1644 to a rebel led by Li Zicheng (who established the short-lived Shun dynasty), quite a few rump regimes dominated by remnants of the Ming imperial household—collectively referred to as the Southern Ming—survived till 1662.
    The Ming dynasty's founder, the Hongwu Emperor (r. 1368–1398), tried to create a society of self-sufficient rural communities ordered in a inflexible, motionless system that might assure and help a everlasting class of troopers for his dynasty: the empire's standing military exceeded a million troops and the navy's dockyards in Nanjing had been the biggest on this planet. He additionally took nice care breaking the ability of the court docket eunuchs and unrelated magnates, enfeoff
    Web page: Checklist of time intervals
    Abstract: The categorisation of the previous into discrete, quantified named blocks of time is named periodization. This can be a listing of such named time intervals as outlined in numerous fields of research.
    These could be divided broadly into prehistorical intervals and historic intervals
    (when written data started to be stored).
    In archaeology and anthropology, prehistory is subdivided into the three-age system, this listing consists of using the three-age system in addition to quite a lot of numerous designation utilized in reference to sub-ages throughout the conventional three.
    The dates for every age can fluctuate by area. On the geologic time scale, the Holocene epoch begins on the finish of the final glacial interval of the present ice age (c. 10,000 BC) and continues to the current. The start of the Mesolithic is often thought-about to correspond to the start of the Holocene epoch.

    Web page: Celestial Empire
    Abstract: Celestial Empire (Chinese language: 天朝; pinyin: Tiāncháo; lit. 'heavenly dynasty') is an outdated title used to confer with China or the Chinese language Empire, from a literary and poetic translation of the Chinese language time period, one in every of many names for China. The title was utilized in reference to the standing of the Emperor of China because the Son of Heaven within the Sinosphere.
    Accordingly, within the nineteenth century, the title "Celestial" was used to confer with Chinese language folks. Each phrases had been extensively used within the English-language standard mass media of the day, however fell into disuse in a while. Its utilization has turn out to be standard once more within the current day (2015), notably amongst Chinese language Web customers. It's used to confer with the present Communist regime, to suggest both disapproval for its political suppression and conceitedness or nationwide delight within the nation's emergence as a superpower within the twenty first century, relying on the context.
    In fashionable instances it has principally fallen into disuse, however the title "Celestial Empire" nonetheless seems in numerous media reminiscent of ar
    Web page: Checklist of dynasties
    Abstract: This can be a listing of monarchical dynasties and dynastic regimes organized by geographic area. Extant dynasties are rendered in daring and highlighted.

    AGENT: Thought: From the summaries, I can see that the Ming dynasty dominated from 1368 to 1644, which covers the 12 months 1453. I'll use the `search_info` software to search out extra detailed details about the Ming dynasty in the course of the 12 months 1453.
    Code:
    ```py
    search_info('1453', 'Ming dynasty')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Ming dynasty' for the question '1453':
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    AGENT: Thought: Now that I do know the Ming dynasty dominated throughout 1453, I can present a extra particular reply in regards to the occasions that occurred in China throughout that 12 months. Nevertheless, the data offered doesn't give us particular particulars in regards to the occasions in 1453. I'll use the `search_info` software to search out extra detailed details about the Ming dynasty in the course of the 12 months 1453.
    Code:
    ```py
    search_info('1453', 'Ming dynasty')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Ming dynasty' for the question '1453':
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    AGENT: Thought: The knowledge offered doesn't particularly point out the occasions of 1453. Nevertheless, we will infer that in the course of the Ming dynasty, important developments occurred. I'll use the `search_info` software to search out extra particular details about the occasions of 1453 within the Ming dynasty.
    Code:
    ```py
    search_info('1453', 'Ming dynasty')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Ming dynasty' for the question '1453':
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    AGENT: Thought: The knowledge offered signifies that the Ming dynasty was in full management of China in the course of the 12 months 1453. Nevertheless, there isn't any particular point out of occasions that occurred in 1453. I'll use the `search_info` software to search out extra particular details about the occasions of 1453 within the Ming dynasty.
    Code:
    ```py
    search_info('1453', 'Ming dynasty')
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    Info retrieved from the web page 'Ming dynasty' for the question '1453':
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    AGENT: Thought: The knowledge offered doesn't particularly point out any occasions that occurred in 1453. Nevertheless, we all know that the Ming dynasty was in full management of China throughout this time. I'll use the `final_answer` software to supply the reply based mostly on the data now we have.
    Code:
    ```py
    final_answer("In 1453, the Ming dynasty was in full management of China. No particular occasions associated to 1453 are talked about within the data offered.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    In 1453, the Ming dynasty was in full management of China. No particular occasions associated to 1453 are talked about within the data offered.

    Diving deeper into the web page search agent execution, we see that this additionally repeated a number of software calls with the identical parameters.

    TASK:  Retrieve details about the question:"chief of the Ottoman Empire in 1453" from the Wikipedia web page "Fall of Constantinople".
    AGENT: Thought: I want to search out out who was the chief of the Ottoman Empire in 1453. I'll use the `retrieve_passages` software to seek for this data on the Wikipedia web page "Fall of Constantinople".
    Code:
    ```py
    outcome = retrieve_passages("chief of the Ottoman Empire in 1453")
    print(outcome)
    ```
    OBSERVATIONS: Print outputs:
    Retrieved passages for question "chief of the Ottoman Empire in 1453":
    Passage 0: ... When Mehmed II succeeded his father in 1451, he was 19 years outdated. Many European courts assumed that the younger Ottoman ruler wouldn't critically problem Christian hegemony within the Balkans and the Aegean. Actually, Europe celebrated Mehmed coming to the throne and hoped his inexperience would lead the Ottomans astray. This calculation was boosted by Mehmed's pleasant overtures to the European envoys at his new court docket. However Mehmed's gentle phrases weren't matched by his actions ...
    Passage 1: ... The attacking Ottoman Military, which considerably outnumbered Constantinople's defenders, was commanded by the 21-year-old Sultan Mehmed II (later nicknamed "the Conqueror"), whereas the Byzantine military was led by Emperor Constantine XI Palaiologos. After conquering the town, Mehmed II made Constantinople the brand new Ottoman capital, changing Adrianople. ...
    Passage 2: ... . The oldest boy, renamed Murad, turned a private favorite of Mehmed and served as Beylerbey (Governor-Common) of Rumeli (the Balkans). The youthful son, renamed Mesih Pasha, turned Admiral of the Ottoman fleet and Sancak Beg (Governor) of the province of Gallipoli. He ultimately served twice as Grand Vizier beneath Mehmed's son, Bayezid II. ...
    Passage 3: ... == Exterior hyperlinks ==

    Media associated to Fall of Constantinople (1453) at Wikimedia Commons
    The Siege of Constantinople As The Islamic World Sees it Archived 22 April 2021 on the Wayback Machine
    World Historical past Encyclopedia – 1453: The Fall of Constantinople
    Constantinople Siege & Fall, BBC Radio 4 dialogue with Roger Crowley, Judith Herrin & Colin Imber (In Our Time, 28 December 2006). ...
    Passage 4: ... In the summertime of 1452, when Rumeli Hisarı was accomplished and the specter of the Ottomans had turn out to be imminent, Constantine wrote to the Pope, promising to implement the union, which was declared legitimate by a half-hearted imperial court docket on 12 December 1452. Though he was anticipating a bonus, Pope Nicholas V didn't have the affect the Byzantines thought he had over the Western kings and princes, a few of whom had been cautious of accelerating papal management...

    AGENT: Thought: From the passages, it appears that evidently the chief of the Ottoman Empire in 1453 was Mehmed II, also called Mehmed the Conqueror. I'll use the `final_answer` software to supply the reply.
    Code:
    ```py
    final_answer("The chief of the Ottoman Empire in 1453 was Mehmed II, also called Mehmed the Conqueror.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The chief of the Ottoman Empire in 1453 was Mehmed II, also called Mehmed the Conqueror.
    ------------------------------
    TASK: Retrieve details about the question:"1453" from the Wikipedia web page "Ming dynasty".
    AGENT: Thought: I want to search out data associated to the 12 months 1453 from the Wikipedia web page "Ming dynasty". I'll use the `retrieve_passages` software to get related passages.
    Code:
    ```py
    outcome = retrieve_passages("1453 Ming dynasty")
    print(outcome)
    ```
    OBSERVATIONS: Print outputs:
    Retrieved passages for question "1453 Ming dynasty":
    Passage 0: ... The Ming dynasty, formally the Nice Ming, was an imperial dynasty of China, ruling from 1368 to 1644 following the collapse of the Mongol-led Yuan dynasty. The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China ...
    Passage 1: ... === Reference works and first sources ===
    Farmer, Edward L. ed. Ming Historical past: An Introductory Information to Analysis (1994).
    Goodrich, Luther Carrington (1976). Dictionary of Ming Biography, 1368–1644. New York: Columbia College Press. ISBN 978-0-231-03833-1.
    The Ming Historical past English Translation Challenge, A collaborative venture that makes accessible translations (from Chinese language to English) of parts of the 明史 Mingshi (Official Historical past of the Ming Dynasty). ...
    Passage 2: ... ==== Reign of the Hongwu Emperor ==== ...
    Passage 3: ... . The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China. Though the first capital of Beijing fell in 1644 to a rebel led by Li Zicheng (who established the short-lived Shun dynasty), quite a few rump regimes dominated by remnants of the Ming imperial household—collectively referred to as the Southern Ming—survived till 1662. ...
    Passage 4: ... . Zhu Di assumed the throne because the Yongle Emperor (r. 1402–24); his reign is universally considered by students as a "second founding" of the Ming dynasty since he reversed a lot of his father's insurance policies....

    AGENT: Thought: The passages don't straight point out the 12 months 1453. Nevertheless, I can infer that the Ming dynasty lasted from 1368 to 1644, and 1453 falls inside this era. I'll use the `final_answer` software to supply a abstract based mostly on the data accessible.
    Code:
    ```py
    final_answer("The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    ------------------------------
    TASK: Retrieve details about the question:"1453" from the Wikipedia web page "Ming dynasty".
    AGENT: Thought: I want to search out data associated to the 12 months 1453 from the Wikipedia web page "Ming dynasty". I'll use the `retrieve_passages` software to get related passages.
    Code:
    ```py
    outcome = retrieve_passages("1453 Ming dynasty")
    print(outcome)
    ```
    OBSERVATIONS: Print outputs:
    Retrieved passages for question "1453 Ming dynasty":
    Passage 0: ... The Ming dynasty, formally the Nice Ming, was an imperial dynasty of China, ruling from 1368 to 1644 following the collapse of the Mongol-led Yuan dynasty. The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China ...
    Passage 1: ... === Reference works and first sources ===
    Farmer, Edward L. ed. Ming Historical past: An Introductory Information to Analysis (1994).
    Goodrich, Luther Carrington (1976). Dictionary of Ming Biography, 1368–1644. New York: Columbia College Press. ISBN 978-0-231-03833-1.
    The Ming Historical past English Translation Challenge, A collaborative venture that makes accessible translations (from Chinese language to English) of parts of the 明史 Mingshi (Official Historical past of the Ming Dynasty). ...
    Passage 2: ... ==== Reign of the Hongwu Emperor ==== ...
    Passage 3: ... . The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China. Though the first capital of Beijing fell in 1644 to a rebel led by Li Zicheng (who established the short-lived Shun dynasty), quite a few rump regimes dominated by remnants of the Ming imperial household—collectively referred to as the Southern Ming—survived till 1662. ...
    Passage 4: ... . Zhu Di assumed the throne because the Yongle Emperor (r. 1402–24); his reign is universally considered by students as a "second founding" of the Ming dynasty since he reversed a lot of his father's insurance policies....

    AGENT: Thought: The passages don't straight point out the 12 months 1453. Nevertheless, I can infer that the Ming dynasty lasted from 1368 to 1644, and 1453 falls inside this era. I'll use the `final_answer` software to supply a abstract based mostly on the data accessible.
    Code:
    ```py
    final_answer("The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    ------------------------------
    TASK: Retrieve details about the question:"1453" from the Wikipedia web page "Ming dynasty".
    AGENT: Thought: I want to search out data associated to the 12 months 1453 from the Wikipedia web page "Ming dynasty". I'll use the `retrieve_passages` software to get related passages.
    Code:
    ```py
    outcome = retrieve_passages("1453 Ming dynasty")
    print(outcome)
    ```
    OBSERVATIONS: Print outputs:
    Retrieved passages for question "1453 Ming dynasty":
    Passage 0: ... The Ming dynasty, formally the Nice Ming, was an imperial dynasty of China, ruling from 1368 to 1644 following the collapse of the Mongol-led Yuan dynasty. The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China ...
    Passage 1: ... === Reference works and first sources ===
    Farmer, Edward L. ed. Ming Historical past: An Introductory Information to Analysis (1994).
    Goodrich, Luther Carrington (1976). Dictionary of Ming Biography, 1368–1644. New York: Columbia College Press. ISBN 978-0-231-03833-1.
    The Ming Historical past English Translation Challenge, A collaborative venture that makes accessible translations (from Chinese language to English) of parts of the 明史 Mingshi (Official Historical past of the Ming Dynasty). ...
    Passage 2: ... ==== Reign of the Hongwu Emperor ==== ...
    Passage 3: ... . The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China. Though the first capital of Beijing fell in 1644 to a rebel led by Li Zicheng (who established the short-lived Shun dynasty), quite a few rump regimes dominated by remnants of the Ming imperial household—collectively referred to as the Southern Ming—survived till 1662. ...
    Passage 4: ... . Zhu Di assumed the throne because the Yongle Emperor (r. 1402–24); his reign is universally considered by students as a "second founding" of the Ming dynasty since he reversed a lot of his father's insurance policies....

    AGENT: Thought: The passages don't straight point out the 12 months 1453. Nevertheless, I can infer that the Ming dynasty lasted from 1368 to 1644, and 1453 falls inside this era. I'll use the `final_answer` software to supply a abstract based mostly on the data accessible.
    Code:
    ```py
    final_answer("The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
    ------------------------------
    TASK: Retrieve details about the question:"1453" from the Wikipedia web page "Ming dynasty".
    AGENT: Thought: I want to search out data associated to the 12 months 1453 from the Wikipedia web page "Ming dynasty". I'll use the `retrieve_passages` software to get related passages.
    Code:
    ```py
    outcome = retrieve_passages("1453 Ming dynasty")
    print(outcome)
    ```
    OBSERVATIONS: Print outputs:
    Retrieved passages for question "1453 Ming dynasty":
    Passage 0: ... The Ming dynasty, formally the Nice Ming, was an imperial dynasty of China, ruling from 1368 to 1644 following the collapse of the Mongol-led Yuan dynasty. The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China ...
    Passage 1: ... === Reference works and first sources ===
    Farmer, Edward L. ed. Ming Historical past: An Introductory Information to Analysis (1994).
    Goodrich, Luther Carrington (1976). Dictionary of Ming Biography, 1368–1644. New York: Columbia College Press. ISBN 978-0-231-03833-1.
    The Ming Historical past English Translation Challenge, A collaborative venture that makes accessible translations (from Chinese language to English) of parts of the 明史 Mingshi (Official Historical past of the Ming Dynasty). ...
    Passage 2: ... ==== Reign of the Hongwu Emperor ==== ...
    Passage 3: ... . The Ming dynasty was the final imperial dynasty of China dominated by the Han folks, the bulk ethnic group in China. Though the first capital of Beijing fell in 1644 to a rebel led by Li Zicheng (who established the short-lived Shun dynasty), quite a few rump regimes dominated by remnants of the Ming imperial household—collectively referred to as the Southern Ming—survived till 1662. ...
    Passage 4: ... . Zhu Di assumed the throne because the Yongle Emperor (r. 1402–24); his reign is universally considered by students as a "second founding" of the Ming dynasty since he reversed a lot of his father's insurance policies....

    AGENT: Thought: The passages don't straight point out the 12 months 1453. Nevertheless, I can infer that the Ming dynasty lasted from 1368 to 1644, and 1453 falls inside this era. I'll use the `final_answer` software to supply a abstract based mostly on the data accessible.
    Code:
    ```py
    final_answer("The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
    ```
    OBSERVATIONS: Print outputs:
    Final output from code snippet:
    The 12 months 1453 falls throughout the interval of the Ming dynasty, which dominated from 1368 to 1644. Throughout this time, the Ming dynasty was in full management of China and skilled important developments reminiscent of the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.

    On this weblog put up, I defined the way to create a multi-agentic RAG system utilizing code brokers and a “small” open-source LLM like Qwen2.5–7B-Instruct. I’ve mentioned the primary architectural options and a few particular decisions relative to the Hugging Face code agent implementation that I made to enhance the outcome. The total code particulars can be found within the following GitHub repo.

    The multi-agentic system described, regardless of being powered by a small mannequin working on consumer-grade {hardware}, can remedy multi-hop question-answering duties associated to complicated queries. Specifically:

    • It may possibly break down the question into manageable sub-tasks;
    • It may possibly establish the Wikipedia pages containing the mandatory data;
    • It may possibly mix data coming from a number of pages;
    • It may possibly seek for detailed data on a Wikipedia web page;
    • It may possibly decide whether or not it wants extra data and tries to search out it;
    • It may possibly efficiently repair small bugs within the code it produces and deal with software errors (like Wikipedia disambiguation errors).

    I’ve additionally outlined some limitations of the system, reminiscent of elevated computation time, repetitive actions, and the potential propagation of hallucinations. The latter might be mitigated by together with within the system a “proofreader” agent that checks that the reported data is in settlement with the retrieved sources.

    Additionally it is value noting that, for the reason that agentic system has a regular RAG method at its core, all the same old methods used to enhance the effectivity and accuracy of the latter could be applied within the framework.

    One other doable enchancment is to make use of methods to extend check time computation to present the mannequin extra “time to assume” much like OpenAI o1/o3 fashions. It’s nonetheless vital to notice that this modification will additional improve execution time.

    Lastly, for the reason that multi-agentic system is made up of brokers specialised in a single job, utilizing a distinct mannequin engine for every of them may enhance the efficiency. Specifically, it’s doable to fine-tune a distinct mannequin for every job within the system for additional efficiency positive aspects. This might be notably useful for small fashions. It’s value mentioning that fine-tuning information could be collected by working the system on a set of predetermined duties and saving the brokers’ output when the system produces the proper reply, thus eliminating the necessity for costly handbook information annotation.

    I hope you discovered this tutorial helpful, you’ll find the total code implementation within the GitHub repo and take a look at it your self within the Colab notebook.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleThe biggest AI flops of 2024
    Next Article I’m an SEO Expert — Here Are 6 Content Tips to Stand Out in Any Saturated Market
    Team_AIBS News
    • Website

    Related Posts

    Artificial Intelligence

    An Introduction to Remote Model Context Protocol Servers

    July 2, 2025
    Artificial Intelligence

    How to Access NASA’s Climate Data — And How It’s Powering the Fight Against Climate Change Pt. 1

    July 1, 2025
    Artificial Intelligence

    STOP Building Useless ML Projects – What Actually Works

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Is Your AI Whispering Secrets? How Scientists Are Teaching Chatbots to Forget Dangerous Tricks | by Andreas Maier | Jul, 2025

    July 2, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Building a House Price Predictor: A Full-Stack Machine Learning Project | by Nafisat Ibrahim | Feb, 2025

    February 24, 2025

    Vision Transformers (ViT) Explained: Are They Better Than CNNs?

    February 28, 2025

    Hybrid approaches: Combining Biosensors and AI for early breast cancer detection | by Developers Society | Mar, 2025

    March 1, 2025
    Our Picks

    Is Your AI Whispering Secrets? How Scientists Are Teaching Chatbots to Forget Dangerous Tricks | by Andreas Maier | Jul, 2025

    July 2, 2025

    Qantas data breach to impact 6 million airline customers

    July 2, 2025

    He Went From $471K in Debt to Teaching Others How to Succeed

    July 2, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.