Overview
SWE Development Kit (swekit) is a powerful framework for building Software Engineering agents using Composio’s tooling ecosystem. This example demonstrates how to build a Pull Request (PR) Review Agent using SWE Development Kit (swekit). The PR Review Agent uses Composio’s tooling ecosystem to help automate and enhance the PR review process.Getting Started
Installation
Begin by installing the core packages:For additional functionality, install packages for your preferred framework (e.g., LangChain):
Connect your Github Account
To utilize Github Issues as a task source, link your Github account as follows:
- Composio CLI
- Locally using Github Auth Token
There are two ways to provide the GitHub access token for git clone:
- Set the environment variable
GITHUB_ACCESS_TOKEN='<git_access_token>'. - Use the GitHub account connected to your toolset entity. However, this method has limitations:
- The agent won’t be able to push or create PRs.
- You need to set
export ALLOW_CLONE_WITHOUT_REPO='true'.
Create a New Agent
Generate your agent’s scaffolding:
This process will establish a new agent at
| Argument | Description | Accepted Values |
|---|---|---|
-f | Specifies the framework to use | langgraph |
-o | Sets the output directory for generated files | Any valid directory path |
Scaffold support for other frameworks coming soon!
pr_review_agent with essential files:main.py: The main script to execute the agentagent.py: The agent’s core definitionprompts.py: Prompts to guide the agent’s actionsinput.py: A helper file to take inputs from the usertools.py: A file to add custom tools to the agent
Start Docker Server
If you prefer to run the agent locally without Docker (Unsafe), modify the workspace configuration in
agent.py by setting the WorkspaceType.Docker() to WorkspaceType.Host().