langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.76k stars 15.12k forks source link

Custom Agent Repeats same thought #1013

Closed alexprice12 closed 1 year ago

alexprice12 commented 1 year ago

Looking at this example, the CustomAgent repeats the same thought "I should look for the population of Canada." endlessly.

I tried to fix this by adding the instruction "Memorize the Obersavation for each thought. Do not repeat the same thought." but that didn't work. Is this an issue with OpenAI or the ZeroShotAgent?

conceptofmind commented 1 year ago

Can you try setting max iterations to something like 2?

max_iterations=2

dosubot[bot] commented 1 year ago

Hi, @alexprice12! I'm helping the LangChain team manage their backlog and I wanted to let you know that we are marking this issue as stale.

From what I understand, you reported an issue with the CustomAgent in the provided example. You noticed that it was repeating the same thought and tried to fix it by adding an instruction, but it didn't work. conceptofmind suggested setting the max iterations to 2 as a possible solution.

I wanted to check with you if this issue is still relevant to the latest version of the LangChain repository. If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution and please let us know if you have any further questions or concerns!

dosubot[bot] commented 1 year ago

Hi, @alexprice12! I'm helping the LangChain team manage their backlog and I wanted to let you know that we are marking this issue as stale.

From what I understand, you reported an issue with the CustomAgent in the provided example. You noticed that it was repeating the same thought and tried to fix it by adding an instruction, but it didn't work. conceptofmind suggested setting the max iterations to 2 as a possible solution.

I wanted to check with you if this issue is still relevant to the latest version of the LangChain repository. If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution and please let us know if you have any further questions or concerns!

MarkusMCGOS commented 4 weeks ago

The same thing appears to be happening to me:

Thought: I need to understand what the user wants to know about today's news. 
Action:
```json
{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What is the most important news today?"
  }
}

Observation: NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events. The number of lives lost around the world due to infections that are resistant to the medications intended to treat them could increase nearly 70% by 2050, a new study projects, further showing ... Middle East Turkey calls on West to take 'deterrent steps' against Israeli action 6:02 AM PDT. Reuters.com is your online source for the latest world news stories and current events, ensuring our ... Reuters, the news and media division of Thomson Reuters, is the world's largest multimedia news provider, reaching billions of people worldwide every day. Reuters provides business, financial ... NPR world news, international art and culture, world business and financial markets, world economy, and global trends in health, science and technology. Subscribe to the World Story of the Day ... Thought:Thought: The user wants to know about the most important news today. I need to understand what the user means by "important". Action:

{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What are the most important news stories today?"
  }
}

Observation: NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events. Reuters.com is your online source for the latest US news stories and current events, ensuring our readers up to date with any breaking news developments Middle East Turkey calls on West to take 'deterrent steps' against Israeli action 6:02 AM PDT. Reuters.com is your online source for the latest world news stories and current events, ensuring our ... NPR world news, international art and culture, world business and financial markets, world economy, and global trends in health, science and technology. Subscribe to the World Story of the Day ... Get the latest international news and world events from Asia, Europe, the Middle East, and more. See world news photos and videos at ABCNews.com Thought:Thought: The user wants to know about the most important news today. I need to understand what the user means by "important". I can use the search results to identify the most common themes in the news today. Action:

{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What are the most important news stories today?"
  }
}

Observation: NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events. Reuters.com is your online source for the latest US news stories and current events, ensuring our readers up to date with any breaking news developments Middle East Turkey calls on West to take 'deterrent steps' against Israeli action 6:02 AM PDT. Reuters.com is your online source for the latest world news stories and current events, ensuring our ... September 4, 2024 • The once-thriving Japanese hamlet of Nanmoku was known for its silk and timber industries. Today, it is the country's most aged village, with two-thirds of residents over age ... NPR world news, international art and culture, world business and financial markets, world economy, and global trends in health, science and technology. Subscribe to the World Story of the Day ... Thought:Thought: The user wants to know about the most important news today. I can use the search results to identify the most common themes in the news today. Action:

{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What are the most important news stories today?"
  }
}

Observation: NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events. Reuters.com is your online source for the latest US news stories and current events, ensuring our readers up to date with any breaking news developments Middle East Turkey calls on West to take 'deterrent steps' against Israeli action 6:02 AM PDT. Reuters.com is your online source for the latest world news stories and current events, ensuring our ... NPR world news, international art and culture, world business and financial markets, world economy, and global trends in health, science and technology. Subscribe to the World Story of the Day ... Get the latest international news and world events from Asia, Europe, the Middle East, and more. See world news photos and videos at ABCNews.com Thought:Thought: The user wants to know about the most important news today. I can use the search results to identify the most common themes in the news today. Action:

{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What are the most important news stories today?"
  }
}

Observation: NPR news, audio, and podcasts. Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events. Middle East Turkey calls on West to take 'deterrent steps' against Israeli action 6:02 AM PDT. Reuters.com is your online source for the latest world news stories and current events, ensuring our ... U.S. News and National Top Stories NPR coverage of national news, U.S. politics, elections, business, arts, culture, health and science, and technology. Subscribe to the NPR Nation RSS feed. ... And it set off a chain of events that would fundamentally change how U.S. law deals with guns. Today on Throughline's We the People: How the second ... Reuters.com is your online source for the latest US news stories and current events, ensuring our readers up to date with any breaking news developments NPR world news, international art and culture, world business and financial markets, world economy, and global trends in health, science and technology. Subscribe to the World Story of the Day ... Thought:Thought: The user wants to know about the most important news today. I can use the search results to identify the most common themes in the news today. Action:


{
  "action": "duckduckgo_search",
  "action_input": {
    "query": "What are the most important news stories today?"
  }
}