Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Doc: Update architecture diagram for 1.0 (#1015)

Kilian Lieret63823e564753
diff --git a/docs/assets/architecture.png b/docs/assets/architecture.png
index 953c0ac7..062b5a93 100644
Binary files a/docs/assets/architecture.png and b/docs/assets/architecture.png differ
diff --git a/docs/background/architecture.md b/docs/background/architecture.md
index 0d60f0e8..6e7ae083 100644
--- a/docs/background/architecture.md
+++ b/docs/background/architecture.md
@@ -1,18 +1,17 @@
# Architecture
-!!! warning "Out of date"
- This page is a bit out of date for SWE-agent 1.0.0. We're working on it!
-
This page walks you through the general architecture of the SWE-agent package. Want to just run it? Jump ahead to the [installation](../installation/index.md) or [usage](../usage/index.md) sections.
![architecture](../assets/architecture.png)
-The central entry point to SWE-agent is the `run.py` script (1). It initializes the [`SWEEnv`](../reference/env.md) instance (2) that manages the environment. Upon initialization (and by default for every new instance), it starts a docker container together with a shell session (3). This shell session will be kept alive throughout the task. All installation commands and actions from the model will be executed therein.
-
-`SWEEnv` then installs the dependencies of the repository to which the task instance belongs into a new conda environment (4).
+The central entry point to SWE-agent is the `sweagent` command line executable (1). It initializes an instance of the [`SWEEnv`](../reference/env.md) class (2) that manages the environment.
+With SWE-agent 1.0, this class is now merely a thin wrapper around our [SWE-ReX](https://swe-rex.com) package.
+Upon initialization, `SWEEnv` initializes the SWE-ReX _Deployment_. The Deployment either starts a local Docker container (4), or it starts the container on a remote system like modal or aws (3).
+Within the container, SWE-ReX starts a shell session (5) that will be used to execute the commands.
+SWE-ReX also installs the [ACI](aci.md) elements as [custom tools](../config/tools.md) (9) that are available to the shell session.
-The second class that is initialized by `run.py` is the [`Agent`](../reference/agent.md) class (5). It can be configured with a yaml file (see [config](../config/config.md)). It's most important method is `forward()` which prompts the model and executes its action.
+The second class that is initialized by is the [`Agent`](../reference/agent.md) (6). It can be configured with a yaml file (see [config](../config/config.md)). It's most important method is `forward()` which prompts the model and executes its action.
-To prompt the model, the history (all prompts to the model together with actions and outputs) need to be sent to the LM. In order to make the best use of the context window of the model, the history gets compressed by a `HistoryProcessor` (7). The model output (8) is then interpreted by the `Agent` class and executed in the Shell session via `SWEEnv`.
+To prompt the model, the history (all prompts to the model together with actions and outputs) need to be sent to the LM. In order to make the best use of the context window of the model, the history gets compressed by a `HistoryProcessor` (7). The model output (8) is then interpreted by the `Agent` class (in particular, we use a [parser](../reference/parsers.md) to extract the action) and executed in the Shell session via `SWEEnv` (10).
-The [ACI](aci.md) elements are implemented as [custom commands](../config/tools.md) (9) that are available to the shell session.
\ No newline at end of file
+For this, `SWEEnv` holds the SWE-ReX deployment class that talks to a server running within the docker container (11).
\ No newline at end of file
diff --git a/docs/index.md b/docs/index.md
index 9f50ab4c..b9c34418 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -64,3 +64,7 @@ SWE-agent uses [SWE-ReX](https://swe-rex.com/) for sandboxed code execution.
* Feb 25: [SWE-agent 1.0 + Claude 3.7 is SoTA on SWE-bench verified](https://x.com/KLieret/status/1894408819670733158)
* Feb 13: [Releasing SWE-agent 1.0: SoTA on SWE-bench light & tons of new features](https://x.com/KLieret/status/1890048205448220849)
* Dec 7: [An interview with the SWE-agent & SWE-bench team](https://www.youtube.com/watch?v=fcr8WzeEXyk)
+
+## ✍️ Doc updates
+
+* Mar 7: [Updated SWE-agent architecture diagram of 1.0](background/architecture.md)
\ No newline at end of file