{"id":19156224,"url":"https://github.com/kyegomez/algorithm-of-thoughts","last_synced_at":"2025-08-21T16:25:37.556Z","repository":{"id":191361093,"uuid":"684614596","full_name":"kyegomez/Algorithm-Of-Thoughts","owner":"kyegomez","description":"My implementation of \"Algorithm of Thoughts: Enhancing Exploration of Ideas in Large Language Models\"","archived":false,"fork":false,"pushed_at":"2023-10-13T05:35:20.000Z","size":301,"stargazers_count":97,"open_issues_count":2,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-20T01:40:39.965Z","etag":null,"topics":["ai-reasoning","artificial-intelligence","gpt4","gpt4-api","gpt4all","prompt-engineering","swarms","transformer-architecture","transformer-models"],"latest_commit_sha":null,"homepage":"https://apac.ai/agora","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyegomez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T13:55:04.000Z","updated_at":"2025-07-14T04:47:19.000Z","dependencies_parsed_at":"2024-11-09T08:35:45.355Z","dependency_job_id":"64086fb7-351f-4c38-979e-e2b9a010407a","html_url":"https://github.com/kyegomez/Algorithm-Of-Thoughts","commit_stats":null,"previous_names":["kyegomez/algorithm-of-thoughts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kyegomez/Algorithm-Of-Thoughts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAlgorithm-Of-Thoughts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAlgorithm-Of-Thoughts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAlgorithm-Of-Thoughts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAlgorithm-Of-Thoughts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/Algorithm-Of-Thoughts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FAlgorithm-Of-Thoughts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271507523,"owners_count":24771824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-reasoning","artificial-intelligence","gpt4","gpt4-api","gpt4all","prompt-engineering","swarms","transformer-architecture","transformer-models"],"created_at":"2024-11-09T08:33:39.980Z","updated_at":"2025-08-21T16:25:37.499Z","avatar_url":"https://github.com/kyegomez.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# Algorithm-Of-Thoughts\n![Discord](https://img.shields.io/discord/999382051935506503)\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts)](https://twitter.com/intent/tweet?text=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Algorithm%20of%20Thoughts!%20https://github.com/kyegomez/Algorithm-Of-Thoughts)\n[![LinkedIn](https://img.shields.io/badge/Share-LinkedIn-blue?style=social\u0026logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts)\n[![Facebook](https://img.shields.io/badge/Share-Facebook-blue?style=social\u0026logo=facebook)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts)\n[![Reddit](https://img.shields.io/badge/Share-Reddit-orange?style=social\u0026logo=reddit)](https://www.reddit.com/submit?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts\u0026title=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Algorithm%20of%20Thoughts%21)\n[![Hacker News](https://img.shields.io/badge/Share-Hacker%20News-orange?style=social\u0026logo=y-combinator)](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts\u0026t=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Algorithm%20of%20Thoughts%21)\n[![Pinterest](https://img.shields.io/badge/Share-Pinterest-red?style=social\u0026logo=pinterest)](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts\u0026media=https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts%2Fraw%2Fmain%2FAlgorithm-Of-Thoughts.jpeg\u0026description=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Algorithm%20of%20Thoughts%21)\n[![WhatsApp](https://img.shields.io/badge/Share-WhatsApp-green?style=social\u0026logo=whatsapp)](https://api.whatsapp.com/send?text=Check%20out%20this%20amazing%20project%20on%20improving%20AI%20reasoning%20-%20Algorithm%20of%20Thoughts%21%20https%3A%2F%2Fgithub.com%2Fkyegomez%2FAlgorithm-Of-Thoughts)\n\n\n![AOT BANNER](aot.png)\nThe open source implementation of \"Algorithm of Thoughts: Enhancing Exploration of Ideas in Large Language Models\" that increases model reasoning by nearly 80% or 10% more than [Tree of thoughts!](https://github.com/kyegomez/Algorithm-Of-Thoughts)\n\n[Algorithm of Thoughts: Enhancing Exploration of Ideas in Large Language Models](https://arxiv.org/abs/2308.10379)\n\n# Installation\n`pip install aot-x`\n\n\n# Usage\n```python\nfrom aot.main import AoT\n\ntask = \"\"\"\n\nUse numbers and basic arithmetic operations (+ - * /) to obtain 24. When\nconsidering the next steps, do not choose operations that will result in a\nnegative or fractional number. In order to help with the calculations, the\nnumbers in the parenthesis represent the numbers that are left after the\noperations and they are in descending order.\nAnother thing we do is when there are only two numbers left in the parenthesis, we\ncheck whether we can arrive at 24 only by using basic arithmetic operations\n(+ - * /). Some examples regarding this idea:\n(21 2) no\nsince 21 + 2 = 23, 21 - 2 = 19, 21 * 2 = 42, 21 / 2 = 10.5, none of which is equal\nto 24.\n(30 6) 30 - 6 = 24 yes\n(8 3) 8 * 3 = 24 yes\n(12 8) no\n(48 2) 48 / 2 = 24 yes\nMost importantly, do not give up, all the numbers that will be given has indeed a\nsolution.\n\n14 8 8 2\n\nOBJECTIVE\n#########\n5 10 5 2\n\"\"\"\n\n\ndfs = AoT(\n    num_thoughts=2,\n    max_steps=10, \n    value_threshold=1,\n    initial_prompt=task,\n    openai_api_key=\"ENETER IN YOUR API KEY\"\n)\n\nresult = dfs.solve()\nprint(result)\n```\n\n# Todo\n- [ ] All thoughts over 0.5 are added to cache or longterm vectorstore \n- [x] DFS search similiar to Algorithm of thoughts\n- [x] Propose solutions function\n- [x] Backtrack to nearest successful states\n- [x] Implement evaluation strategy similiar to tot with [0.0, 1.0]\n- [x] Working demo: Conducts search then backtracks through states, provide visuals green text\n- [ ] Streamlit demo\n\n\n## Citation\n```\n@misc{2308.10379,\nAuthor = {Bilgehan Sel and Ahmad Al-Tawaha and Vanshaj Khattar and Lu Wang and Ruoxi Jia and Ming Jin},\nTitle = {Algorithm of Thoughts: Enhancing Exploration of Ideas in Large Language Models},\nYear = {2023},\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Falgorithm-of-thoughts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Falgorithm-of-thoughts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Falgorithm-of-thoughts/lists"}