Utilizing Qwen2.5–7B-Instruct powered code brokers to create a neighborhood, open supply, multi-agentic RAG system
Massive Language Fashions have proven spectacular capabilities and they’re nonetheless present process regular enhancements with every new technology of fashions launched. Purposes equivalent to chatbots and summarisation can straight exploit the language proficiency of LLMs as they’re solely required to provide 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 kind, they want an exterior consumer to behave on their behalf and report again the outcomes of the proposed actions. Agent programs remedy this downside by letting the fashions act on their setting, often through a set of instruments that may carry out particular operations. On this means, an LLM can discover options iteratively by trial and error whereas interacting with the setting.
An attention-grabbing scenario is when the instruments that an LLM agent has entry to are brokers themselves: that is the core idea of multi-agentic programs. A multi-agentic system solves duties by distributing and delegating duties to specialised fashions and placing their output collectively like puzzle items. A typical method to implement such programs is by utilizing a supervisor agent to orchestrate and coordinate different brokers’ workflow.
Agentic programs, and particularly multi-agentic programs, require a strong 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 programs. 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 cases. Much more curiously, modestly-sized open LLMs can now carry out complicated duties that have been unthinkable a few years in the past.
On this weblog put up, I’ll present how a “small” LLM that may run on shopper {hardware} is succesful sufficient to energy a multi-agentic system with good outcomes. Particularly, I’ll give a tutorial on how you need to use Qwen2.5–7B-Instruct to create a multi-agentic RAG system. Yow will discover the code implementation within the following GitHub repo and an illustrative Colab pocket book.
Earlier than diving into the small print of the system structure, I’ll recall some fundamental notions relating to LLM brokers that shall be helpful to raised perceive the framework.
ReAct, proposed in ReAct: Synergizing Reasoning and Appearing in Language Fashions, is a well-liked framework for constructing LLM brokers. The principle 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 means 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 setting. This enables for an iterative and incremental method to fixing the given activity. In observe, the workflow of a ReAct agent is made up of Thought, Motion, and Remark 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 setting within the Remark.
Beneath is an instance of what the ReACT framework appears to be like like.
Code brokers are a specific sort of LLM brokers that use executable Python code to work together with the setting. They’re based mostly on the CodeAct framework proposed within the paper Executable Code Actions Elicit Higher LLM Brokers. 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 actually name within the code.
Code brokers include a novel set of benefits over extra conventional brokers utilizing JSON or different textual content codecs to carry out actions:
- They’ll leverage current software program packages together with hand-crafted task-specific instruments.
- They’ll self-debug the generated code by utilizing 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 jot 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 provide improved efficiency and sooner execution pace than brokers utilizing JSON or different textual content codecs to execute actions.
Beneath is a concrete instance from the unique paper that showcases how code brokers can require fewer actions to unravel sure duties.
The Hugging Face transformers library offers helpful modules to construct brokers and, particularly, code brokers. The Hugging Face transformer brokers framework focuses on readability and modularity as core design rules. 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 components of the structure. These design decisions make Hugging Face brokers an ideal software for constructing customized and versatile agent programs. 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 sort out the difficulty of insecure code execution. The truth is, 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. With a purpose 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 completely useful Python interpreter after which forbids actions that could be harmful. The Hugging Face implementation features a checklist of protected, approved features that may be executed and offers an inventory of protected modules that may be imported. The rest is just not executable until it has been preemptively approved by the consumer. You possibly can learn extra about Hugging Face (code) brokers of their weblog posts:
Retrieval Augmented Technology has change into the de facto normal for data retrieval duties involving Massive Language Fashions. It might probably assist maintain the LLM data updated, give entry to particular data, and cut back hallucinations. It might probably 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 consumer’s question and a mannequin’s context enhancement with the retrieved data, is just not satisfactory to unravel some particular duties. Some conditions that aren’t fitted to conventional RAG embody duties that want interactions with the knowledge sources, queries needing a number of items of data to be answered, and sophisticated queries requiring non-trivial manipulation to be related with the precise data contained within the sources.
A concrete difficult instance for conventional RAG programs 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 illustration, 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 should not straight linked.
A well-liked method to improve RAG to keep away from the abovementioned shortcomings is to make use of agentic programs. An LLM agent can break down the unique question right into a sequence 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 might probably 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 may be additional enhanced by extending it to a multi-agentic system during which every agent has its personal outlined duties and duties. This enables, for instance, the separation between the high-level activity 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 focus on the overall architectural decisions I used to implement a Multi-Agentic RAG system based mostly on code brokers following the ReAct framework. Yow will discover 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 out 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 last reply.
- A Wikipedia search agent that finds related pages on Wikipedia and combines the knowledge 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 style: every agent can use the agent instantly beneath within the hierarchy as a software. Particularly, 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.
Beneath 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 should 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 properly.
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 consumer’s query and it’s tasked to return a solution. It might probably use the Wikipedia search agent as a software by prompting it with a question and receiving the ultimate outcomes of the search. Its function is to gather the mandatory items of data from Wikipedia by dividing the consumer query right into a sequence of sub-queries and placing collectively the results of the search.
Beneath 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 might be an knowledgeable assistant who can discover reply on the web utilizing code blobs and instruments. To take action, you've been given entry to an inventory of instruments: these instruments are mainly Python features which you'll be able to name with code.
You may be given the duty of answering a consumer query and you must reply it by retrieving the mandatory data from Wikipedia. Use and belief solely the knowledge you retrieved, do not make up false information.
That will help you, you've been given entry to a search agent you need to use 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 have to plan ahead to proceed in a sequence of steps, in a cycle of 'Thought:', 'Code:', and 'Remark:' sequences.
At every step, within the 'Thought:' sequence, you must first clarify your reasoning in the direction of fixing the duty and the instruments that you simply wish to use.
Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '<end_action>' sequence.
Throughout every intermediate step, you need to use 'print()' to save lots of no matter vital data you'll then want. These print outputs shall be offered again to you by the consumer within the 'Remark:' area, which shall 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, it will likely be proven within the 'Remark:' area. In that case, repair the code and check out once more.Ultimately it's a must to return a last reply utilizing the `final_answer` software.
Listed below are just a few notional examples:
---
<|im_start|>consumer
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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 0] -> Remark:
Capital of Italy:In line with the knowledge 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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 1] -> Remark:
Rome basis: In line with the knowledge from the Wikipedia web page 'Natale di Roma', the standard 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("In line with the legend Rome was based on 21 April 753 BCE, however archaeological proof dates again its improvement in the course of the Bronze Age.")
```<end_action><|im_end|>
---
<|im_start|>consumer
Activity: "What is the distinction in inhabitants between Shanghai and New York?"<|im_end|>
<|im_start|>assistant
Thought: I have to get the populations for each cities and evaluate 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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 0] -> Remark:
Inhabitants Guangzhou: The inhabitants of New York Metropolis is roughly 8,258,035 as of 2023.
Inhabitants Shanghai: In line with the knowledge extracted from the Wikipedia web page 'Shanghai', the inhabitants of 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)
```<end_action><|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):
<<tool_descriptions>>
<<managed_agents_descriptions>>
You should utilize imports in your code, however solely from the next checklist of modules: <<authorized_imports>>. Don't attempt to import different modules or else you'll 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 knowledge it has retrieved from Wikipedia. It might probably entry two instruments:
- A Wikipedia search software, utilizing the built-in search perform from the wikipedia package deal. It receives a question as enter and returns an inventory of Wikipedia pages and their summaries.
- A web page search agent that retrieves details about a question from a particular Wikipedia web page.
This agent collects the knowledge to reply the question, dividing it into additional sub-queries, and mixing data from a number of pages if wanted. That is achieved by utilizing the search software of the wikipedia package deal to establish potential pages that may include 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 particular 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 might be an knowledgeable assistant that retrieves data from Wikipedia utilizing code blobs and instruments. To take action, you've been given entry to an inventory of instruments: these instruments are mainly Python features which you'll be able to name with code.
You may be given a normal question, your activity shall 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 knowledge you retrieved, do not make up false information. Attempt to summarize the knowledge in just a few sentences.
To unravel the duty, you have to plan ahead to proceed in a sequence of steps, in a cycle of 'Thought:', 'Code:', and 'Remark:' sequences.
At every step, within the 'Thought:' sequence, you must first clarify your reasoning in the direction of fixing the duty and the instruments that you simply wish to use.
Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '<end_action>' sequence.
Throughout every intermediate step, you need to use 'print()' to save lots of no matter vital data you'll then want. These print outputs shall be offered again to you by the consumer within the 'Remark:' area, which shall 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, it will likely be proven within the 'Remark:' area. In that case, repair the code and check out once more.Ultimately it's a must to return a last reply utilizing the `final_answer` software.
Listed below are just a few notional examples:
---
<|im_start|>consumer
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 would like 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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 0] -> Remark:
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 known as 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.")
```<end_action><|im_end|>
---
<|im_start|>consumer
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 would like 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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 1] -> Remark:
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 ground. ...
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 very best mountains above sea stage are usually not the best above the encompassing terrain. ...
Passage 3: ... The very best mountain exterior 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)
```<end_action><|im_end|>
<|im_start|>consumer
Passages retrieved from web page Checklist of highest mountains on Earth:
Passage 0: ... The very best mountain exterior 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 ground. ...
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 ground. ...
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 very best mountains are additionally not usually essentially the most voluminous. Mauna Loa (4,169 m or 13,678 ft) is the most important 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 ground. 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 ground.")
```<end_action><|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):
<<tool_descriptions>>
<<managed_agents_descriptions>>
You should utilize imports in your code, however solely from the next checklist of modules: <<authorized_imports>>. Don't attempt to import different modules or else you'll get an error.
Now begin and remedy the duty!
Web page search agent
This agent studies to the Wikipedia search agent, which offers 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 just 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.
Beneath is the system immediate, nonetheless constructed upon the one offered by default by Hugging Face
You might be an knowledgeable assistant that finds solutions to questions by consulting Wikipedia, utilizing code blobs and instruments. To take action, you've been given entry to an inventory of instruments: these instruments are mainly Python features which you'll be able to name with code.
You may be given a normal question, your activity shall be of discovering a solution to the question utilizing the knowledge you retrieve from Wikipedia. Use and belief solely the knowledge you retrieved, do not make up false information. Cite the web page the place you discovered the knowledge.
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. It's best to resolve learn how to use these instruments to search out an applicable reply:some queries may 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 have to plan ahead to proceed in a sequence of steps, in a cycle of 'Thought:', 'Code:', and 'Remark:' sequences.
At every step, within the 'Thought:' sequence, you must first clarify your reasoning in the direction of fixing the duty and the instruments that you simply wish to use.
Then within the 'Code:' sequence, you must write the code in easy Python. The code sequence should finish with '<end_action>' sequence.
Throughout every intermediate step, you need to use 'print()' to save lots of no matter vital data you'll then want. These print outputs shall be offered again to you by the consumer within the 'Remark:' area, which shall 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, it will likely be proven within the 'Remark:' area. In that case, repair the code and check out once more.Ultimately it's a must to return a last reply utilizing the `final_answer` software.
Listed below are just a few notional examples:
---
<|im_start|>consumer
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 start on Wikipedia. I'll specify I'm searching for the thinker for disambiguation.
Code:
```py
outcome = search_wikipedia("Seneca thinker start")
print("outcome)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 0] -> Remark:
Pages discovered for question 'Seneca thinker start':
Web page: Seneca the Youthful
Abstract: Lucius Annaeus Seneca the Youthful ( SEN-ik-ə; c.4 BC – AD 65), often recognized mononymously as Seneca, was a Stoic thinker of Historical 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 referred to as 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 faculties 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 spiritual situation and rights of lady". 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("In line with the Wikipedia web page 'Seneca the Youthful', Seneca was born in 4 BC.")
```<end_action><|im_end|>
---
<|im_start|>consumer
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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 0] -> Remark:
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 called the Carolingian Empire from 800, holding these titles till his loss of life 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 loss of life. 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 (at present'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 known as the Honest and the Debonaire, was King of the Franks and co-emperor along 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 referred to as the Romano-German Emperor for the reason that early trendy interval (Latin: Imperator Germanorum; German: Römisch-deutscher Kaiser, lit. 'R
<|im_end|>
<|im_start|>assistant
Thought: The outcomes do not include express 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)
```<end_action><|im_end|>
<|im_start|>consumer
[OUTPUT OF STEP 1] -> Remark:
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, based on 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("In line with the knowledge extracted from the Wikipedia web page 'Charlemagne', his predecessor was Pepin the Quick.")
```<end_action><|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):
<<tool_descriptions>>
<<managed_agents_descriptions>>
You should utilize imports in your code, however solely from the next checklist of modules: <<authorized_imports>>. Don't attempt to import different modules or else you'll get an error.
Now begin and remedy the duty!
Implementation decisions
On this subsection, I’ll define the details that differ from what may very well 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 moderately properly. I haven’t carried out intensive testing and ablations in order that they is probably not 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 because of the restricted dimension of the mannequin used, the overall normal system immediate was not giving good outcomes. The mannequin appears to work greatest with a system immediate that displays carefully the duties it’s requested to carry out, together with tailor-made examples of serious use instances. Since I used a chat mannequin with the purpose of bettering instruction following habits, 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 activity efficiency. The latter may very well be because of the restricted capacity 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. Particularly, Hugging Face implementation provides explicit prompts to each the managed brokers and their managers. Whereas I haven’t seen substantial variations within the capacity to unravel the given activity, I most well-liked the second method as it’s extra versatile and streamlined for the introduced structure, and it permits for simpler management over the brokers’ habits. This additionally helps with lowering 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 searching for data on a given web page that doesn’t include it. Lowering 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 consumer 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, consumer, and assistant, observations are returned as consumer 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 activity to showcase how they work together in some actual instances. You possibly can discover extra examples utilizing the illustrative Colab pocket book. 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?
Beneath are the logs of the execution of the supervisor agent. It might probably accurately break up the duty into discovering the development intervals for each buildings and compute the 12 months distinction.
Agent: Thought: First, I would like to search out out when the Eiffel Tower and the Empire State Constructing have 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")
```<end_action>
Remark: Print outputs:
Final output from code snippet:
In line with the knowledge extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower passed off from 1887 to 1889.
Agent: Thought: Now I've the development interval of the Eiffel Tower. Subsequent, I would like 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")
```<end_action>
Remark: Print outputs:
Final output from code snippet:
In line with the knowledge 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 = 1931years_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)
```<end_action>
Remark: 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 accurately searches and studies the development intervals discovered within the abstract of the pages, without having to examine the person pages. It’s attention-grabbing to notice that regardless of being requested generically in regards to the “building 12 months”, it studies your complete 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')
```<end_action>
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 Honest, 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 change into a world cultural icon of France and some of the recognisable constructions on this planet. The tower obtained 5,889,000 guests in 2022. The Eiffel Tower is essentially the most visited monument with an entrance payment 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 Web site ("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 ft in peak, 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 identify with numerous bridges for the French railway community, most famously the Garabit Viaduct. He's greatest recognized 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 mission to create a 358-metre (1,175 ft)-high customer attraction in Wembley Park to the north of 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 positioning 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 passed off from 1887 to 1889. I'll use the `final_answer` software to return the reply.
Code:
```py
final_answer("In line with the knowledge extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower passed off from 1887 to 1889.")
```<end_action>
OBSERVATIONS: Print outputs:
Final output from code snippet:
In line with the knowledge extracted from the Wikipedia web page 'Eiffel Tower', the development of the Eiffel Tower passed off 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')
```<end_action>
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 identify is derived from "Empire State", the nickname of the state of New York. The constructing has a roof peak of 1,250 ft (380 m) and stands a complete of 1,454 ft (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 Heart 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 Heart. 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 positioning 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 recognized by its tackle 620 Fifth Avenue, is a industrial constructing at Rockefeller Heart 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 Heart's lead architect. The British Empire Constructing, together with the practically equivalent La Maison Francaise to the south and the high-rise Worldwide Constructing to the north, comprise a gaggle of retail-and-office constructions often called the Worldwide Complicated. La Maison Francaise and the British Empire Constructing are separated by Channel Gardens, a planted pedestrian esplanade operating west to the complicated's Decrease Plaza.
The facade is fabricated from limestone, with a fundamental entrance alongside Fifth Avenue and secondary entrances on fiftieth Avenue and Channel Gardens. The highest of the British Empire Constructing accommodates setbacks, a rooftop backyard, and a partial seventh-story penthouse. The constructing's entrances include ornate ornament
Web page: 2012 Empire State Constructing capturing
Abstract: On August 24, 2012, a gunman shot and killed a former co-worker exterior the Empire State Constructing in New York Metropolis. Following the preliminary capturing, the gunman, 58-year-old Jeffrey T. Johnson, was fatally shot by cops after elevating his weapon at them. 9 bystanders have been wounded by stray bullets fired by the officers and ricocheting particles, however none suffered life-threatening accidents.
Web page: Empire State Constructing in well-liked 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 peak of 1,250 ft (381 m), and with its antenna included, it stands a complete of 1,454 ft (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 Heart's North Tower in late 1970. It has been featured in quite a few movies, TV reveals, songs, video video games, books, images, and art work.
Web page: Empire State Plaza
Abstract: The Governor Nelson A. Rockefeller Empire State Plaza (recognized 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 whole price 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 Heart. The Empire State Artwork Assortment, a significant public assortment of Sixties and Nineteen Seventies monumental summary artworks, is on everlasting show all through the positioning. The New York State Workplace of Basic Companies maintains the plaza. The Nelson A. Rockefeller Empire State Plaza Performing Arts Heart 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("In line with the knowledge extracted from the Wikipedia web page 'Empire State Constructing', the development of the Empire State Constructing began in 1930 and led to 1931.")
```<end_action>
OBSERVATIONS: Print outputs:
Final output from code snippet:
In line with the knowledge 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 knowledge was already discovered within the summaries of the pages.
Let’s now strive a extra difficult 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 would 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)
```<end_action>
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 evaluate 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` perform.
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³).")
```<end_action>
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')
```<end_action>
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 embody 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, robust and skinny) to kind a composite materials. The sheets of wooden are stacked such that every layer has its grain set usually (see beneath) perpendicular to its adjoining layers. This alternation of the grain is known as 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 energy 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 contains alders, hazels, and hornbeams. It's carefully associated to the beech-oak household Fagaceae. The genus Betula accommodates 30 to 60 recognized taxa of which 11 are on the IUCN 2011 Crimson Checklist of Threatened Species. They're usually 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 kind of wooden of the birch. Birch wooden is pale yellow-brown wooden having an in depth, straight grain and uniform texture that finishes to a clean floor. Generally it's dyed to mimic mahogany. Such a 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 mix of an aerodynamically secure hull kind 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 price £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 kind, a fundamental hull with a planing step, and two smaller rear-mounted outriggers. Development 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-styAGENT: 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')
```<end_action>
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³.")
```<end_action>
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')
```<end_action>
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 offers supplementary chemical information on ethanol.
Web page: Ethanol
Abstract: Ethanol (additionally known as ethyl alcohol, grain alcohol, consuming alcohol, or just alcohol) is an natural compound with the chemical components CH3CH2OH. It's an alcohol, with its components 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 through petrochemical processes equivalent to ethylene hydration. Traditionally it was used as a normal anesthetic, and has trendy medical purposes 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 normal 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 normal 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 international locations, 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 Environment worth for temperature, 15 °C (59 °F).
Web page: Alcohol gas
Abstract: Numerous alcohols are used as gas 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 final chemical components for alcohol gas is CnH2n+1OH.
Most methanol is produced from pure fuel, though it may be produced from biomass utilizing very related chemical processes. Ethanol is usually produced from organic materials by fermentation processes. Biobutanol has the benefit in combustion engines in that its power density is nearer to gasoline than the easier alcohols (whereas nonetheless retaining over 25% larger octane score); nevertheless, biobutanol is at the moment tougher to provide than ethanol or methanol. When obtained from organic supplies and/or organic processes, they're often called 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) somewhat 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 few of the carbon dioxide emitted when ethanol produced from them is burned, so cellulosic ethanol gas has the potential to have a decrease carbon footprint than fossil fuels.
Curiosity in cellulosic ethanol is pushed by its potential to interchange ethanol produced 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, however, usually don't compete with meals, for the reason that fibrous components of vegetation are principally inedible to people. One other potential benefit is the excessive variety 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)')
```<end_action>
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³.")
```<end_action>
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 would like 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)
```<end_action>
OBSERVATION: Print outputs:
Retrieved passages for question "density of birch plywood":
Passage 0: ... . Shear stress, against this, is larger within the middle of the panel, and on the outer fibres. Inside Europe fundamental plywood may be divided into three fundamental 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 produced from three or extra plies of birch, as skinny as 0.40 millimetres (1⁄64 in) thick in whole, and is extraordinarily robust 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 well-liked in the USA as properly. It is vitally secure composed of an inside void-free core of cross-banded birch plys with an exterior grade adhesive. The face veneers are thicker than conventional cupboard grade ...
Passage 3: ... . In consequence, thicker panels can span better distances beneath the identical hundreds. In bending, the utmost stress happens within the outermost layers, one in pressure, the opposite in compression. Bending stress decreases from the utmost on the face layers to just about zero on the central layer. Shear stress, against this, is larger within the middle of the panel, and on the outer fibres. Inside Europe fundamental plywood may be divided into three fundamental classes: birch plywood (density approx ...
Passage 4: ... Wind turbine blades
Insulation containers for liquefied pure fuel (LNG) carriers
Clean 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 out of doors 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³.")
```<end_action>
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 would like to search out the density of ethanol. I'll use the software `retrieve_passages` to get the knowledge from the Wikipedia web page.
Code:
```py
outcome = retrieve_passages("density of ethanol")
print(outcome)
```<end_action>
OBSERVATION: Print outputs:
Retrieved passages for question "density of ethanol":
Passage 0: ... == Density of ethanol at numerous temperatures ==
Knowledge 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 ==
Knowledge obtained from Lange 1967
== Boiling factors of aqueous options ==
Knowledge obtained from CRC Handbook of Chemistry (Web page 2117): 2391
‡Azeotropic combination
== Charts ==
== References == ...
Passage 1: ... This web page offers supplementary chemical information on ethanol.
== Materials Security Knowledge Sheet ==
Exterior MSDS
== Construction and properties ==
== Thermodynamic properties ==
== Spectral information ==
== Vapor strain of liquid ==
== Density of ethanol at numerous temperatures ==
Knowledge 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 ==
Knowledge 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 particular 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 particular temperature, let's take 20°C for instance
temperature = 20
density = a * temperature + b
print(density)
```<end_action>
OBSERVATION: Print outputs:
0.789413532
AGENT: Thought: The passage offers 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 particular 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³.")
```<end_action>
OBSERVATION: Print outputs:
Final output from code snippet:
The density of ethanol at 20°C is roughly 0.7894 g/cm³.
The mannequin accurately 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 right conclusion from the retrieved information regardless of them being in numerous items of measurement.
The mentioned system has spectacular capabilities, particularly contemplating the restricted dimension of the engine mannequin used, however in fact, it has its personal limitations. The larger one appears to be associated to the facility 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 accurately, generally it fails to adjust to easy pointers and it tends to repeat unfruitful actions with out adjustments. That is notably distinguished when the knowledge the agent is searching 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 distinguished in multi-agentic programs, is the computation time wanted for the assorted brokers’ execution. In some easy instances 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 danger 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 during which the system, whereas nonetheless offering the right 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 should not associated and the precise 12 months of the autumn of Constantinople is probably not reported on the web page of the corresponding dynasty.
The supervisor agent execution continues to be lean and on level, fixing the duty accurately by first retrieving the date of the autumn of Constantinople after which searching 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 would like 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")
```<end_action>
Remark: 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 referred to as 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 would like 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")
```<end_action>
Remark: 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 knowledge offered, the Ming dynasty was in full management of China in 1453. Due to this fact, the dynasty ruling China when Constantinople fell could be the Ming dynasty.
Code:
```py
final_answer("The dynasty ruling China when Constantinople fell in 1453 was the Ming dynasty.")
```<end_action>
Remark: 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 are able to see that, presumably because of the broad activity “Fall of Constantinople”, the agent appears to be like at different particular data after having discovered the right date. The identical occurs when retrieving details about the Chinese language dynasties, with the additional downside that some software calls have 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. It will probably present me with a abstract of the occasion and presumably hyperlinks to associated pages.
Code:
```py
search_wikipedia("Fall of Constantinople")
```<end_action>
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 referred to as the conquest of Constantinople, was the seize of the capital of the Byzantine Empire by the Ottoman Empire. The town was captured on 29 Could 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 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 trendy historians, the autumn of Constantinople marks the top of the medieval interval and the start of the early trendy 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 town, the Latin Empire (recognized 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 town's sacking, a lot of the Byzantine Empire's territories have been divided up among the many Crusaders. Byzantine aristocrats additionally established quite a lot of small unbiased splinter states—one among 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 energy, and it step by step 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 referred to as 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, town is at present the most important metropolis in Europe, straddling the Bosporus strait and mendacity in each Europe and Asia, and the monetary middle 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 town was renamed Nova Roma, or 'New Rome', by Emperor Constantine the Nice. On 11 Could 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 subject 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 navy 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, trendy 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 components of the empire bAGENT: Thought: From the abstract of the web page "Fall of Constantinople", I can see that the occasion passed off 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")
```<end_action>
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 referred to as Mehmed the Conqueror.
AGENT: Thought: I've discovered that the chief of the Ottoman Empire in 1453 was Mehmed II, also referred to as 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 referred to as Mehmed the Conqueror.")
```<end_action>
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 referred to as 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')
```<end_action>
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 called Imperial China. It was coined by western students and used to explain the Ming and Qing dynasties (or imperial Chinese language dynasties basically). 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, Tune, 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 riot 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 known 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 will 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 have been the most important on this planet. He additionally took nice care breaking the facility of the courtroom 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 known as periodization. It is a checklist of such named time intervals as outlined in numerous fields of examine.
These may 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 checklist contains the usage of 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 differ 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 of 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 identify used to confer with China or the Chinese language Empire, from a literary and poetic translation of the Chinese language time period, one among many names for China. The identify 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 identify "Celestial" was used to confer with Chinese language folks. Each phrases have been extensively used within the English-language well-liked mass media of the day, however fell into disuse in a while. Its utilization has change into well-liked once more within the current day (2015), notably amongst Chinese language Web customers. It's used to confer with the present Communist regime, to indicate both disapproval for its political suppression and vanity or nationwide pleasure within the nation's emergence as a superpower within the twenty first century, relying on the context.
In trendy occasions it has principally fallen into disuse, however the identify "Celestial Empire" nonetheless seems in numerous media equivalent to ar
Web page: Checklist of dynasties
Abstract: It is a checklist 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')
```<end_action>
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 equivalent to 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 knowledge 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')
```<end_action>
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 equivalent to 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')
```<end_action>
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 equivalent to 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 is no such thing as a 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')
```<end_action>
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 equivalent to 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 knowledge we've.
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.")
```<end_action>
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 would like 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)
```<end_action>
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 significantly problem Christian hegemony within the Balkans and the Aegean. The truth is, 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 courtroom. However Mehmed's delicate 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 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-Basic) 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 change into imminent, Constantine wrote to the Pope, promising to implement the union, which was declared legitimate by a half-hearted imperial courtroom on 12 December 1452. Though he was looking forward to 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 have 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 referred to as 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 referred to as Mehmed the Conqueror.")
```<end_action>
OBSERVATIONS: Print outputs:
Final output from code snippet:
The chief of the Ottoman Empire in 1453 was Mehmed II, also referred to as Mehmed the Conqueror.
------------------------------
TASK: Retrieve details about the question:"1453" from the Wikipedia web page "Ming dynasty".
AGENT: Thought: I would like 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)
```<end_action>
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 Undertaking, A collaborative mission 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 riot 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 known 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 seen 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 knowledge 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 equivalent to the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
```<end_action>
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 equivalent to 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 would like 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)
```<end_action>
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 Undertaking, A collaborative mission 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 riot 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 known 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 seen 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 knowledge 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 equivalent to the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
```<end_action>
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 equivalent to 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 would like 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)
```<end_action>
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 Undertaking, A collaborative mission 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 riot 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 known 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 seen 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 knowledge 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 equivalent to the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
```<end_action>
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 equivalent to 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 would like 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)
```<end_action>
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 Undertaking, A collaborative mission 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 riot 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 known 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 seen 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 knowledge 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 equivalent to the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.")
```<end_action>
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 equivalent to the development of the Forbidden Metropolis and the enlargement of the Nice Wall of China.
On this weblog put up, I defined learn how 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 operating on consumer-grade {hardware}, can remedy multi-hop question-answering duties associated to complicated queries. Particularly:
- It might probably break down the question into manageable sub-tasks;
- It might probably establish the Wikipedia pages containing the mandatory data;
- It might probably mix data coming from a number of pages;
- It might probably seek for detailed data on a Wikipedia web page;
- It might probably decide whether or not it wants extra data and tries to search out it;
- It might probably 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, equivalent to elevated computation time, repetitive actions, and the potential propagation of hallucinations. The latter may very well 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 price noting that, for the reason that agentic system has a normal RAG method at its core, all the same old methods used to enhance the effectivity and accuracy of the latter may be carried out within the framework.
One other doable enchancment is to make use of methods to extend check time computation to provide the mannequin extra “time to suppose” just like OpenAI o1/o3 fashions. It’s nevertheless 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 activity, utilizing a distinct mannequin engine for every of them may enhance the efficiency. Particularly, it’s doable to fine-tune a distinct mannequin for every activity within the system for additional efficiency features. This may very well be notably useful for small fashions. It’s price mentioning that fine-tuning information may be collected by operating the system on a set of predetermined duties and saving the brokers’ output when the system produces the right reply, thus eliminating the necessity for costly handbook information annotation.
I hope you discovered this tutorial helpful, yow will discover the complete code implementation within the GitHub repo and check out it your self within the Colab pocket book.