Canada just voted to make its national anthem, ‚ÄúO Canada,‚Äù gender neutral,¬†... "O Canada" was proclaimed Canada's national anthem on July 1,. 1980, 100 years after it was first sung on June 24, 1880. The music. Patriotic music in Canada dates back over 200 years as a distinct category from British or French patriotism, preceding the first legal steps to¬†... Feb 4, 2022 ... English version: O Canada! Our home and native land! True patriot love in all of us command. With glowing hearts we¬†... Feb 1, 2018 ... Canada's Senate has passed a bill making the country's national anthem gender-neutral. If you're not familiar with the words to ‚ÄúO Canada,‚Äù¬†...    Thought: I now know the final answer.    Final Answer: The national anthem of Canada is called "O Canada".    > Finished AgentExecutor chain.    'The national anthem of Canada is called "O Canada".'We can see that the agent remembered that the previous question was about Canada, and properly asked Google Search what the name of Canada's national anthem was.For fun, let's compare this to an agent that does NOT have memory.prefix = """Have a conversation with a human, answering the following questions as best you can. You have access to the following tools:"""suffix = """Begin!"Question: {input}{agent_scratchpad}"""prompt = ZeroShotAgent.create_prompt(    tools, prefix=prefix, suffix=suffix, input_variables=["input", "agent_scratchpad"])llm_chain = LLMChain(llm=OpenAI(temperature=0), prompt=prompt)agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)agent_without_memory = AgentExecutor.from_agent_and_tools(    agent=agent, tools=tools, verbose=True)agent_without_memory.run("How many people live in canada?")            > Entering new AgentExecutor chain...    Thought: I need to find out the population of Canada    Action: Search    Action Input: Population of Canada    Observation: The current population of Canada is 38,566,192 as of Saturday, December 31, 2022, based on Worldometer elaboration
This notebook goes over adding memory to an Agent. Before going through this notebook, please walkthrough the following notebooks, as this will build on top of both of them:
This notebook goes over adding memory to an Agent. Before going through this notebook, please walkthrough the following notebooks, as this will build on top of both of them: ->: Canada just voted to make its national anthem, ‚ÄúO Canada,‚Äù gender neutral,¬†... "O Canada" was proclaimed Canada's national anthem on July 1,. 1980, 100 years after it was first sung on June 24, 1880. The music. Patriotic music in Canada dates back over 200 years as a distinct category from British or French patriotism, preceding the first legal steps to¬†... Feb 4, 2022 ... English version: O Canada! Our home and native land! True patriot love in all of us command. With glowing hearts we¬†... Feb 1, 2018 ... Canada's Senate has passed a bill making the country's national anthem gender-neutral. If you're not familiar with the words to ‚ÄúO Canada,‚Äù¬†...    Thought: I now know the final answer.    Final Answer: The national anthem of Canada is called "O Canada".    > Finished AgentExecutor chain.    'The national anthem of Canada is called "O Canada".'We can see that the agent remembered that the previous question was about Canada, and properly asked Google Search what the name of Canada's national anthem was.For fun, let's compare this to an agent that does NOT have memory.prefix = """Have a conversation with a human, answering the following questions as best you can. You have access to the following tools:"""suffix = """Begin!"Question: {input}{agent_scratchpad}"""prompt = ZeroShotAgent.create_prompt(    tools, prefix=prefix, suffix=suffix, input_variables=["input", "agent_scratchpad"])llm_chain = LLMChain(llm=OpenAI(temperature=0), prompt=prompt)agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)agent_without_memory = AgentExecutor.from_agent_and_tools(    agent=agent, tools=tools, verbose=True)agent_without_memory.run("How many people live in canada?")            > Entering new AgentExecutor chain...    Thought: I need to find out the population of Canada    Action: Search    Action Input: Population of Canada    Observation: The current population of Canada is 38,566,192 as of Saturday, December 31, 2022, based on Worldometer elaboration