"url": "https://xkcd.com/"
  }
}
```
Observation: Navigating to https://xkcd.com/ returned status code 200
Thought:I can extract the latest comic title and alt text using CSS selectors.
Action:
```
{
  "action": "get_elements",
  "action_input": {
    "selector": "#ctitle, #comic img",
    "attributes": ["alt", "src"]
  }
}
``` 
Observation: [{"alt": "Tapetum Lucidum", "src": "//imgs.xkcd.com/comics/tapetum_lucidum.png"}]
Thought:
> Finished chain.
The latest xkcd comic is titled "Tapetum Lucidum" and the image can be found at https://xkcd.com/2565/.
Adding in memory#
Here is how you add in memory to this agent
from langchain.prompts import MessagesPlaceholder
from langchain.memory import ConversationBufferMemory
chat_history = MessagesPlaceholder(variable_name="chat_history")
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
agent_chain = initialize_agent(
    tools, 
    llm, 
    agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION, 
    verbose=True, 
    memory=memory, 
    agent_kwargs = {
        "memory_prompts": [chat_history],
        "input_variables": ["input", "agent_scratchpad", "chat_history"]
    }
)
response = await agent_chain.arun(input="Hi I'm Erica.")
print(response)
> Entering new AgentExecutor chain...
Action:
```
{
  "action": "Final Answer",
rtdocs_stable/api.python.langchain.com/en/stable/modules/agents/agents/examples/structured_chat.html