{"id":17220800,"url":"https://github.com/thedayisntgray/ruby-react-agent","last_synced_at":"2025-07-28T13:31:20.103Z","repository":{"id":204393192,"uuid":"711718604","full_name":"thedayisntgray/Ruby-ReAct-Agent","owner":"thedayisntgray","description":"An implementation of the ReAct approach to give LLMs access to external tools","archived":false,"fork":false,"pushed_at":"2023-10-30T11:19:59.000Z","size":10,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-29T03:24:52.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thedayisntgray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-30T03:06:41.000Z","updated_at":"2024-05-12T09:50:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"677ec2ab-ef00-435c-b612-40dc0dbe9a91","html_url":"https://github.com/thedayisntgray/Ruby-ReAct-Agent","commit_stats":null,"previous_names":["thedayisntgray/ruby-react-agent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedayisntgray%2FRuby-ReAct-Agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedayisntgray%2FRuby-ReAct-Agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedayisntgray%2FRuby-ReAct-Agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedayisntgray%2FRuby-ReAct-Agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thedayisntgray","download_url":"https://codeload.github.com/thedayisntgray/Ruby-ReAct-Agent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227914056,"owners_count":17839207,"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","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":[],"created_at":"2024-10-15T03:53:13.628Z","updated_at":"2024-12-03T11:41:48.825Z","avatar_url":"https://github.com/thedayisntgray.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby-ReAct-Agent 🤖\n### An implementation of the ReAct approach to give LLMs access to external tools in ruby\n\n\u003cimg width=\"150\" alt=\"Image Generated by DALL·E 2 with the prompt: Ruby Robot using tools in the style of basquiat\" src=\"https://github.com/thedayisntgray/Ruby-ReAct-Agent/assets/4859128/09294617-4185-456e-a5c7-0ae9bf58aa96\"\u003e\n\n\nThis is an implementation of the ReAct Pattern described in the paper [ReAct: Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629) in Ruby as a learning exercise.\n\nTo aide me in this project I closely followed and essentially ported over some python code written by [Simon Willison](https://twitter.com/simonw) in his article [Python ReAct Pattern](https://til.simonwillison.net/llms/python-react-pattern)\n\nHope this sample code benefits someone in their own exploration of AI Agents in Ruby.\n\nCurrently the only tool implemented is a calculator.\n\n#### Example terminal session:\n\nThe noteworthy aspect here is that the LLM isn't dependent on the data it was trained on. Instead, it calls a method in the code. This method serves as a versatile tool. You have the flexibility to define other tools, such as the capability to search websites like Wikipedia or make API calls, rather than having the LLM rely solely on its training data.\n\n\u003cimg width=\"598\" alt=\"Screenshot 2023-10-30 at 1 29 37 AM\" src=\"https://github.com/thedayisntgray/Ruby-ReAct-Agent/assets/4859128/8f2eff1d-5876-427d-8b55-c20dc8102d35\"\u003e\n\n#### To Run the file on mac make it an executable by running:\n\n```chmod +x ruby-re-act.sh```\n\n#### Create a file named .env copy over the contents of .env.example. Then replace with your OpenAI key.\n\n```touch .env \u0026\u0026 cat .env.example \u003e .env```\n\n\n#### To execute the file type:\n\n```./ruby-re-act.sh```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedayisntgray%2Fruby-react-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedayisntgray%2Fruby-react-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedayisntgray%2Fruby-react-agent/lists"}