# How to run an open source AI agent framework

> Running an agent framework means giving every agent a real machine and a branch of its own. Kortix is the open-source AI Operating System that does that: one sandbox and one branch per session, and each result lands through a change request a person approves.

URL: https://opensourceaiagentframework.com/how-to-run-an-agent-framework

## From a terminal to a reviewed change request

Four commands cover install, scaffold, a session and the merge.

### Install

`terminal`

```sh
$ curl -fsSL https://kortix.com/install | bash
$ kortix login
```

### Scaffold and ship

`terminal`

```sh
$ kortix init my-agent && cd my-agent
$ kortix ship
```

### Run a session

`terminal`

```sh
$ kortix sessions new --prompt "Summarize this week's commits and open a change request"
$ kortix chat <session_id>
```

### Review and merge

`terminal`

```sh
$ kortix cr ls
$ kortix cr diff 1
$ kortix cr merge 1
$ git pull
```

## Install the CLI, then create or clone a project

The install script supports macOS and Linux on x86_64 and arm64, and Windows inside WSL. `kortix login` signs you in to a host, an account and a project. `kortix init my-agent` creates a project from the starter, and `kortix ship` validates `kortix.yaml`, asks for missing secrets and pushes the repo. To adopt an existing project instead, run `kortix projects clone <project_id> my-agent`.

## Every session gets its own cloud computer and branch

`kortix sessions new --prompt "..."` starts a session. The agent works in its own sandbox on a branch named after the session id, so two runs never touch each other, and you can run thousands of agents in parallel on one config, each on its own cloud computer. Talk to a running session with `kortix chat`, or attach the OpenCode terminal UI with `kortix connect`.

## Work lands through a change request a person approves

The agent commits, pushes its session branch and opens a change request against the default branch. Review the open requests with `kortix cr ls`, read the diff with `kortix cr diff 1`, and merge with `kortix cr merge 1`. Merge is default-deny for agents, and a session can never merge a change request it opened itself.

## Self-host it or run it managed

Kortix is open source and self-host is free. `kortix self-host init --domain kortix.example.com` writes the configuration, and `kortix self-host start` runs the full platform as one Docker Compose stack on your own infrastructure. Run it on Kortix Cloud, in your VPC, or on your own on-prem network. Self-hosting needs a sandbox provider such as Daytona, Platinum or E2B, and the instance has to be reachable so those sessions can call back.

## Running an agent framework

### Do I need my own server to run agents?

No. Kortix Cloud runs the sessions for you, and self-host is free when you want the control plane on your own infrastructure.

### Where do sessions run?

Every session runs on its own cloud computer, one isolated sandbox on a branch named after the session id. Even a self-hosted instance runs sessions on a remote sandbox provider.

### What happens to what an agent produces?

The agent commits and opens a change request. A person reviews the diff and merges it, so only reviewed work reaches main.

### Can I script the whole loop?

Yes. The CLI does what the web app does, so `kortix init`, `kortix ship`, `kortix sessions new` and `kortix cr merge` run in CI or from a coding agent.

## Run your first session

Install the CLI, bring a project live in the cloud, then review what the agent proposes.

[Try Kortix](https://kortix.com) · [Compare the frameworks](https://opensourceaiagentframework.com/open-source-agent-framework-alternatives)

Open source · Any model, your keys · Self-host, VPC, or on-prem
