langchain-ai / langchain

๐Ÿฆœ๐Ÿ”— Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.78k stars 15.12k forks source link

Graph Of Thoughts #10137

Closed leo-gan closed 10 months ago

leo-gan commented 1 year ago

Feature request

Graph Of Thoughts looks promising. It is possible to implement it with LangChain?

Motivation

More performant prompt technique

Your contribution

I can help with documentation.

dosubot[bot] commented 1 year ago

๐Ÿค–

Hello,

Thank you for your interest in LangChain and for suggesting the implementation of the "Graph of Thoughts" approach.

As you may know, we have recently implemented the "Tree of Thoughts" (ToT) approach in LangChain as described in the paper Tree of Thoughts. This approach allows language models to perform deliberate decision-making by considering multiple different reasoning paths and self-evaluating choices to decide the next course of action. You can find more details about this implementation in the issue #4975 and in the pull request #5167.

Regarding the "Graph of Thoughts" approach, I'm afraid I don't have enough information about it from the LangChain repository. Could you please provide more details about this approach and how it differs from the "Tree of Thoughts" approach? This would help us understand better how it could be implemented in LangChain and how it could improve the performance of the prompt technique.

Your willingness to help with the documentation is greatly appreciated. Once we have a better understanding of the "Graph of Thoughts" approach and its potential benefits for LangChain, we can discuss how you could contribute to the documentation.

Looking forward to your response.

Best, Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

talkingtoaj commented 1 year ago

I found these explanations of Graph of Thoughts: Original Paper, Medium article

It claims GoT is a drop-in replacement for ToT (as in, it can generalize to ToT or CoT, but with performance and cost improvements), however the Medium article concludes by stating a drawback is It requires carefully hand-designed graph configurations for each new task which can be labor intensive. Automating graph decomposition would make GoT more generally applicable.

I was trying to figure out how this is true - the examples for GoT are problems that decompose into steps and can be recombined. Perhaps then GoT is more suited to a particular subset of problems and is not as flexible as ToT?

Do you have an approach in mind to implement GoT in as automated a way as possible?

leo-gan commented 1 year ago

IMHO Those tasks are tools in the LangChain terms. Branching in GoT could be toolsets in LC. Backtracking and Refining loops could be implemented with Agents but there is no direct analogy in LC. Maybe adding these abstractions could help with implementing GoT in LC? @hwchase17 Any thoughts?

dosubot[bot] commented 10 months ago

Hi, @leo-gan

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, this issue was opened as a feature request for implementing the "Graph of Thoughts" technique using LangChain for more performant prompt generation. There was some discussion in the comments about the approach, its potential benefits for LangChain, and how it could be implemented. However, the issue remains unresolved.

Could you please confirm 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 understanding and cooperation. If you have any further questions or need assistance, feel free to reach out.

kaad01 commented 8 months ago

LangGraph introduced Refining now.