[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9804":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":37,"discoverSource":38},9804,"tree-of-thoughts","kyegomez\u002Ftree-of-thoughts","kyegomez","Plug in and Play Implementation of Tree of Thoughts: Deliberate Problem Solving with Large Language Models that Elevates Model Reasoning by atleast 70% ","https:\u002F\u002Fdiscord.gg\u002FqUtxnK2NMf",null,"Python",4581,374,49,12,0,2,8,29.72,"Apache License 2.0",false,"main",true,[25,26,27,28,29,30,31,32,33],"artificial-intelligence","chatgpt","deep-learning","gpt4","multimodal","prompt","prompt-engineering","prompt-learning","prompt-tuning","2026-06-12 02:02:12","\n![Tree of Thoughts Banner](images\u002Ftreeofthoughts.png)\n\n![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F999382051935506503)\n[![Twitter](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Furl?style=social&url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts)](https:\u002F\u002Ftwitter.com\u002Fintent\u002Ftweet?text=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Tree%20of%20Thoughts!%20https:\u002F\u002Fgithub.com\u002Fkyegomez\u002Ftree-of-thoughts)\n[![LinkedIn](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-LinkedIn-blue?style=social&logo=linkedin)](https:\u002F\u002Fwww.linkedin.com\u002Fsharing\u002Fshare-offsite\u002F?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts)\n[![Facebook](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-Facebook-blue?style=social&logo=facebook)](https:\u002F\u002Fwww.facebook.com\u002Fsharer\u002Fsharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts)\n[![Reddit](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-Reddit-orange?style=social&logo=reddit)](https:\u002F\u002Fwww.reddit.com\u002Fsubmit?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts&title=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Tree%20of%20Thoughts%21)\n[![Hacker News](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-Hacker%20News-orange?style=social&logo=y-combinator)](https:\u002F\u002Fnews.ycombinator.com\u002Fsubmitlink?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts&t=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Tree%20of%20Thoughts%21)\n[![Pinterest](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-Pinterest-red?style=social&logo=pinterest)](https:\u002F\u002Fpinterest.com\u002Fpin\u002Fcreate\u002Fbutton\u002F?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts&media=https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts%2Fraw%2Fmain%2Ftree-of-thoughts.jpeg&description=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Tree%20of%20Thoughts%21)\n[![WhatsApp](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FShare-WhatsApp-green?style=social&logo=whatsapp)](https:\u002F\u002Fapi.whatsapp.com\u002Fsend?text=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Tree%20of%20Thoughts%21%20https%3A%2F%2Fgithub.com%2Fkyegomez%2Ftree-of-thoughts)\n\n\n[Paper link](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2305.10601.pdf)\n[Author's implementation](https:\u002F\u002Fgithub.com\u002Fprinceton-nlp\u002Ftree-of-thought-llm)\n\n## Introduction\n\nTree of Thoughts (ToT) is a powerful and flexible algorithm that significantly advances model reasoning by up to 70%. This plug-and-play version allows you to connect your own models and experience superintelligence!\n\n\n## Install\n\n```bash\n$ pip3 install -U tree-of-thoughts\n```\n\n## Requirements \nIn your .env file, you need to have the following variables:\n\n```bash\nWORKSPACE_DIR=\"artifacts\"\nOPENAI_API_KEY=\"your_openai_api_key\"\n```\n\n## Example\n```python\nfrom tree_of_thoughts import TotAgent, ToTDFSAgent\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\n# Create an instance of the TotAgent class\ntot_agent = TotAgent(use_openai_caller=False)  # Use openai caller\n\n# Create an instance of the ToTDFSAgent class with specified parameters\ndfs_agent = ToTDFSAgent(\n    agent=tot_agent,  # Use the TotAgent instance as the agent for the DFS algorithm\n    threshold=0.8,  # Set the threshold for evaluating the quality of thoughts\n    max_loops=1,  # Set the maximum number of loops for the DFS algorithm\n    prune_threshold=0.5,  # Branches with evaluation \u003C 0.5 will be pruned\n    number_of_agents=4,  # Set the number of agents to be used in the DFS algorithm\n)\n\n# Define the initial state for the DFS algorithm\ninitial_state = \"\"\"\n\nYour task: is to use 4 numbers and basic arithmetic operations (+-*\u002F) to obtain 24 in 1 equation, return only the math\n\n\"\"\"\n\n# Run the DFS algorithm to solve the problem and obtain the final thought\nfinal_thought = dfs_agent.run(initial_state)\n\n# Print the final thought in JSON format for easy reading\nprint(final_thought)\n\n\"\"\"\n\n# Run the DFS algorithm to solve the problem and obtain the final thought\nfinal_thought = dfs_agent.run(initial_state)\n\n# Print the final thought in JSON format for easy reading\nprint(final_thought)\n\n\n```\n\n### Basic Prompts\n```txt\n\nImagine three different experts are answering this question. All experts will write down 1 step of their thinking, then share it with the group. Then all experts will go on to the next step, etc. If any expert realises they're wrong at any point then they leave. The question is...\n\n\n\n################ 2nd ################\n\nSimulate three brilliant, logical experts collaboratively answering a question. Each one verbosely explains their thought process in real-time, considering the prior explanations of others and openly acknowledging mistakes. At each step, whenever possible, each expert refines and builds upon the thoughts of others, acknowledging their contributions. They continue until there is a definitive answer to the question. For clarity, your entire response should be in a markdown table. The question is...\n\n\n################ ################\n\nImagine three highly intelligent experts working together to answer a question. They will follow a tree of thoughts approach, where each expert shares their thought process step by step. They will consider the input from others, refine their thoughts, and build upon the group's collective knowledge. If an expert realizes their thought is incorrect, they will acknowledge it and withdraw from the discussion. Continue this process until a definitive answer is reached. Present the entire response in a markdown table. The question is...\n\n\n################ 2nd ################\n\nThree experts with exceptional logical thinking skills are collaboratively answering a question using a tree of thoughts method. Each expert will share their thought process in detail, taking into account the previous thoughts of others and admitting any errors. They will iteratively refine and expand upon each other's ideas, giving credit where it's due. The process continues until a conclusive answer is found. Organize the entire response in a markdown table format. The question is...\n################ 2nd ################\n\n\nEnvision a group of three experts working in unison to tackle a question by employing a tree of thoughts strategy. Each expert will thoroughly explain their line of thinking at every step, while also considering the insights provided by their peers. They will openly recognize any mistakes and build upon the group's shared understanding. This iterative process will continue until a definitive solution is reached. Structure the entire response as a markdown table. The question is...\n\n\n################ 2nd ################\n\n\"Three experts with exceptional logical thinking skills are collaboratively answering a question using the tree of thoughts method. Each expert will share their thought process in detail, taking into account the previous thoughts of others and admitting any errors. They will iteratively refine and expand upon each other's ideas, giving credit where it's due. The process continues until a conclusive answer is found. Organize the entire response in a markdown table format. The task is:\n```\n\n## Todo\n- [ ] Finish implementing the depth or max_loops feature in the dfs class\n- [ ] Finish the new BFS search algorithm\n- [ ] Implement montecarlo search algorithm\n- [ ] Make a function that can intake json and make a tree out of it visually to visualize the tree of thoughts! \n\n\n# Acknowledgements\n\nThanks to: Shunyu Yao Princeton University, Dian Yu Google DeepMind, Jeffrey Zhao, Google DeepMind, Izhak Shafran Google DeepMind, Thomas L. Griffiths, Princeton University, Yuan Cao Google DeepMind, Karthik Narasimha, Princeton University for sharing this amazing work with the world!\n\nAnd, thanks to Phil Wang or Lucidrains for inspiring me to devote myself to open source AI Research\n\n# License\nApache\n","Tree of Thoughts (ToT) 是一个旨在显著提升大型语言模型推理能力的算法，通过其独特的设计可将模型的推理性能提高至少70%。该项目提供了一个即插即用的实现方式，允许用户轻松集成自己的模型以体验增强后的智能表现。它主要使用Python编写，支持多种先进的AI技术如深度学习、多模态处理以及提示工程等。特别适合需要复杂问题解决和决策制定的应用场景，比如教育辅助工具、智能客服系统或任何需要高级别认知处理能力的软件开发项目中。","2026-06-11 03:24:49","top_topic"]