This is an example of a coding agent which uses infrastructure from Runloop and the code mounts to interact with another repository.
This demo showcases how to build a coding agent that uses a Runloop devbox to safely execute commands and perform file I/O against a code repository.
Although the agent runs on your local machine, the agent's connection to the "real world" -- the tools it can invoke -- are implemented against the devbox.
Here's what the code agent does:
- At launch, a devbox is created and a remote repository is pulled using code mounts.
- The agent is prompted to perform various cleanups on the repository.
- Finally, the agent prints a
git diffof the changes it has made.
Set up your envrionment with the necessary keys:
export RUNLOOP_API_KEY="..."
export OPENAI_API_KEY="..."
export GITHUB_TOKEN="..."First use poetry to install all dependencies:
cd python/
poetry installThen run the agent:
poetry run python agent.py <github url>For example, this command runs the agent against our sample Todo App:
poetry run python agent.py https://github.com/runloopai/simple-todoFirst install the dependencies using npm:
cd typescript/
npm installThen run the agent. You have two options:
- Using
ts-node:
ts-node agent.ts <github url>- Using
npm:
npm run start -- <github url>We can run the agent against our sample Todo app using:
ts-node agent.ts https://github.com/runloopai/simple-todo
npm run start -- https://github.com/runloopai/simple-todoTo update the table of contents in this README, run:
npx doctoc README.md --githubThe Python demo uses the ell library to call the LLM and to bind devbox tools to the agent.
The TypeScript demo implements tool calling directly using OpenAI's function calling feature to allow the agent to interact with the devbox.