k0rtexdocs Get started

Guide.

On this page

k0rtex.io

An Agentic Software House Platform: tools that help coding agents build software in a structured way. Requests go through Intake, Refine, Deliver, review and Learn, each step done by an agent in a defined role, and you sign the work off.

One server hosts the web UI, API and board database for one or more organizations, whose members sign in with OAuth (OpenID Connect or GitHub). Registered workers connect outbound over SSH and run an agent harness (OpenCode or Claude Code) in their own GitHub checkouts.

The same pages, with search, are the documentation at docs.k0rtex.io.

Start #

Build the server with mise, Python 3.12+, uv, Node.js 26 and pnpm 11. Each worker needs Git and at least one authenticated agent harness: OpenCode or Claude Code, with its command-line tool on the worker’s PATH.

sh
mise trust
mise install
mise run setup
mise run start

Open http://127.0.0.1:8765.

mise run start and mise run dev first start PostgreSQL from compose.yaml (mise run db:up, on 127.0.0.1:5432) and point K0RTEX_DATABASE_URL at it. Run one server per database: it holds the board, run history and knowledge index there, and takes a lock so a second server on the same database refuses to start. The data directory (~/.k0rtex by default) keeps the SSH host key.

Run locally with Docker Compose #

From the repository root, run mise run local, then open http://127.0.0.1:8765. Compose runs the board; the worker runs on your host so OpenCode and Git can use your existing credentials. You need Docker Compose, uv, and the worker prerequisites in Connect a worker.

Run mise run worker:install first: it installs the k0rtex command from your checkout. On first use, add a worker in Settings → Workers, copy its pairing link and run mise run worker:pair '<link>'. Run mise run local again and check that the worker shows Online. Ctrl-C stops the foreground worker. mise run compose:down stops the board; the named volumes preserve the board’s database and its SSH host key, and ~/.k0rtex-worker preserves the worker identity. Use mise run compose:up to run the board alone or mise run compose:logs to follow its logs.

If the default ports are in use, run export K0RTEX_PORT=18765 K0RTEX_SSH_PORT=18766 before starting and pairing, then open http://127.0.0.1:18765. The worker remembers its paired SSH port.

The server indexes each project’s base branch and answers agents’ searches from it. Compose runs Qdrant next to the board; search by meaning turns on once an embeddings endpoint and model are named too. Any OpenAI-compatible /v1/embeddings API works. The endpoint receives your code, so use one you trust with it.

Name them in Settings → Knowledge search: API base URL, embedding model, API key and, for models that can shorten vectors, dimensions. Saving tests the endpoint and applies at once. The key is kept in an owner-only file in the data directory and is never shown again; changing the base URL does not carry a saved key over. The same values can be set as K0RTEX_EMBEDDINGS_* environment variables, which apply until you save others.

.env.example lists these variables; copy it to .env to start.

To keep everything on your machine, put this in the repository-root .env and start with the local-embeddings profile, which runs Ollama and downloads the model:

sh
K0RTEX_EMBEDDINGS_URL=http://ollama:11434/v1
K0RTEX_EMBEDDINGS_MODEL=nomic-embed-text
sh
docker compose --profile local-embeddings up --build -d

Ollama inside Docker runs on the CPU (on a Mac it cannot use the GPU), so the first pass of a large repository takes minutes; search matches words meanwhile. An Ollama installed on the host is much faster: use http://host.docker.internal:11434/v1 as the base URL and skip the profile.

For a hosted API instead, set the URL (for OpenAI, https://api.openai.com/v1), the model and the key in Settings or .env, and start Compose without the profile. The project’s Knowledge view shows how many passages still await their vectors. If Qdrant or the endpoint is down, search keeps matching words and /api/v1/health reports degraded. Changing the model starts a new Qdrant collection and embeds everything again.

Run with Docker #

To use a release without a checkout:

sh
docker network create k0rtex
docker run -d --name k0rtex-db --network k0rtex \
  -e POSTGRES_USER=k0rtex -e POSTGRES_PASSWORD=change-me -e POSTGRES_DB=k0rtex \
  -v k0rtex-db:/var/lib/postgresql/data postgres:17-alpine
docker run -d --name k0rtex --network k0rtex \
  -e K0RTEX_DATABASE_URL=postgresql://k0rtex:change-me@k0rtex-db:5432/k0rtex \
  -p 127.0.0.1:8765:8765 -p 127.0.0.1:8766:8766 \
  -v k0rtex-data:/var/lib/k0rtex acrplatweu01-fdeugvadguaahga0.azurecr.io/k0rtex:0.1.2

Any PostgreSQL 16 or later works; the role needs to create tables in its database.

Releases are in a private Azure Container Registry: run az acr login --name acrplatweu01 first. Kubernetes clusters outside the platform also need registry pull credentials via imagePullSecrets.

Open http://127.0.0.1:8765. The image includes the UI and server; run workers separately. To upgrade, stop and remove the old container, then run the new tag with the same volume and database. Back up with pg_dump (see Upgrading to PostgreSQL for boards from before it). For remote access, put HTTPS in front of the web port, expose TCP 8766 to workers, and pass the public K0RTEX_BROWSER_URL and OIDC settings using docker run --env-file.

Deploy with Helm #

Install the released chart and open the board through a port-forward:

sh
helm upgrade --install board oci://acrplatweu01-fdeugvadguaahga0.azurecr.io/charts/k0rtex \
  --version 0.3.0 --namespace k0rtex --create-namespace --wait
kubectl -n k0rtex port-forward deployment/k0rtex-board 8765:8765 8766:8766

Open http://127.0.0.1:8765. The chart runs the server and PostgreSQL in the release. For a hosted board with sign-in, the GitHub App, an ingress or Gateway API, a managed database, backups, upgrades and every chart value, follow the Kubernetes deployment guide.

Tool gateway #

Agents reach their tools through the tool gateway by default: rather than loading every k0rtex MCP tool definition into its context, an agent gets a small server on its worker:

  • search finds tools and shows their TypeScript signatures.
  • execute runs the agent’s TypeScript in a Deno process with no file, network, environment or subprocess permission. Its only way out is tools.<server>.<tool>(), checked against the agent’s permissions. A large result is written to .k0rtex/results/ in the ticket checkout, which Git ignores, and the agent reads what it needs.
  • skill lists and loads the agent’s bundled skills.

The gateway is built on k0rtex-codemode, a package of its own that knows nothing of k0rtex. The credentials for k0rtex’s MCP servers stay in the worker process. The worker needs Deno 2 on its PATH, or k0rtex config set deno_path=/path/to/deno (a service often has a shorter PATH than your shell). Gateway runs wait for a worker that has it.

To load every tool definition instead, set Tool access → Direct on a project in Settings → Projects or on a provider in Settings → Agents (the provider’s choice wins). A change applies to runs queued afterwards.

Connect a worker #

  1. For a hosted board, put an HTTPS reverse proxy in front of 127.0.0.1:8765, preserving the Host header and streaming /api and /mcp without buffering. Set K0RTEX_BROWSER_URL to the public HTTPS origin and configure an OAuth sign-in provider. Set K0RTEX_SSH_BIND to the server’s worker-facing address and expose K0RTEX_SSH_PORT (default 8766) as TCP on that same port. This is k0rtex’s SSH listener, separate from system sshd. For a single-machine setup both listeners default to loopback.
  2. On the worker (macOS or Linux), install the worker with a provider, for example uv tool install "./backend/packages/worker[opencode]" from a checkout at the same version. With mise, mise run worker:install installs it with both providers and the terminal UI (run it again to upgrade; it reinstalls an installed service), and mise run worker:uninstall removes the service and the command. The worker package has no server code: it shares only k0rtex-protocol with the server, and the server refuses a worker that speaks another protocol version (the reason shows under Workers). The provider is what knows the agent harness; opencode runs opencode run --format json and claude-code runs claude -p with stream-json. Install both with [opencode,claude-code]. A project chooses its harness in Settings → Projects, and a provider in Settings → Agents can name its own; a run that names none gets the worker’s first, which k0rtex config set default_provider=opencode decides. To use another executable or arguments on a machine, write providers.json in the worker’s data directory: {"opencode": {"command": "/path/to/opencode"}}. Any arguments there come before the provider’s own, so remove an acp argument or adapter command left from an earlier version. Earlier versions kept this command in the board’s provider settings; after upgrading, set it on each worker that needs a non-default command. Configure Git identity, HTTPS GitHub access (for example gh auth login and gh auth setup-git), and OpenCode under the account that will run the service. Git clone/push and the agent use that account’s credentials.
  3. In Settings → Workers, choose Add worker and give it a name, labels and session capacity. Copy the pairing link and run k0rtex setup on the node: the wizard pairs it with the link, asks for its settings (sessions at once, default provider, Deno for the tool gateway, background jobs, log level) and starts it as a service or in the background. Run it again later to change the settings; it keeps the pairing. Or run k0rtex tui on the node (it needs the tui extra) and paste it: the node pairs and starts, as a service unless you untick that. Without the terminal UI run k0rtex pair '<link>' --start (service) or --run (background process). Pairing pins the server host key and registers the node’s public key; the link works once and expires after ten minutes. The worker’s page issues a new one, pauses or revokes the worker, and lists its runs.
  4. Run k0rtex service install to keep the worker running: it writes a launchd agent on macOS or a systemd user unit on Linux that starts k0rtex run at login and restarts it when it fails (on Linux, loginctl enable-linger keeps it running while you are logged out). k0rtex run in a terminal does the same in the foreground. It reconnects automatically. No inbound port is needed on the worker. Keep its data directory (~/.k0rtex-worker, or --data-dir PATH before the subcommand) across restarts. If the SSH endpoint uses a different hostname from the UI, set K0RTEX_SSH_PUBLIC_HOST on the server, or pass --ssh-host to the pairing command.
  5. Import a GitHub repository. In project settings, leave Required worker labels blank for random placement, or enter all labels the worker must have. A ticket can also be pinned before the first claim. Offline or busy workers leave work queued.

Once it runs, manage the worker from its own machine:

Command What it does
k0rtex status The connection, the session limit and every running agent session with what it is doing. --json for scripts.
k0rtex tui The same, live, in the terminal: stop a session, drain, edit settings, read the log. Needs the tui extra: uv tool install "./backend/packages/worker[opencode,tui]".
k0rtex config set max_sessions=4 Change a setting in worker.json. A session limit set here wins over the capacity saved on the board; max_sessions=null hands it back. provider_limits.opencode=2 caps one provider.
k0rtex drain / resume Finish what is running and take nothing new. drain --wait returns when the last session ended, which is the moment to upgrade or restart.
k0rtex stop <session> Stop one agent session; its run ends cancelled on the board.
k0rtex service status / uninstall Look at or remove the service.

The board learns a changed limit or a drain within about ten seconds. Stopping the service ends its agents with it and their runs show as interrupted; the worker’s log is logs/worker.log in its data directory.

Every worker belongs to an organization and to an owner: the organization (it serves all its projects), one project, or one person (it runs only the tickets that person requested). Choose the owner when adding the worker. Turning on sign-in changes nothing on the worker’s machine: workers pair with their link and connect over SSH as before, need no upgrade, and use their own Git access. See Workers on a board with sign-in.

The first claim binds a ticket to a worker in the same database transaction. All its runs reuse that worker and checkout, including explicit retries and reviews. Changing project labels affects new assignments only. A broken SSH session interrupts execution; reconnect and retry explicitly. Revoking a worker disconnects it and releases its tickets, so another worker can claim them with a fresh checkout.

For UI development with hot reload:

sh
mise run dev

Open http://127.0.0.1:5173. The development server proxies API requests to the Python backend.

Tasks are defined in mise.toml. Run mise tasks to list them.

Component releases #

Releases are drafted by Release Drafter (.github/workflows/draft-release.yml, configured in .github/release-drafter/). Every push to main updates one draft GitHub Release per component with the pull requests merged since that component’s last release. The pull request title, a Conventional Commit, picks the section and the version bump: feat and breaking changes (!) raise the minor version (while below 1.0), every other type the patch. A component with nothing merged since its last release gets no draft.

Review a draft and publish it by hand: publishing creates its tag (server-v*, worker-v* or chart-v*) on the commit it was drafted from and starts the Release workflow (.github/workflows/release.yml), which publishes that component from the release environment. To choose a different version, edit the draft’s tag and title before publishing. The tag is the only source of a release’s version: the build stamps it into the package manifests, so the versions committed in pyproject.toml, package.json and Chart.yaml are not kept current. To publish an existing release again, run the Release workflow by hand with its tag. Do not push release tags by hand, and publish from the GitHub UI or a personal token: a release published with the workflow’s own GITHUB_TOKEN starts no workflow.

The release environment must allow the tags server-v* and chart-v*, which the published releases run on, and the branch main, from which the workflow is run by hand. Its Azure federated credential needs the subject repo:k0rtex-io/k0rtex:environment:release.

CI runs backend and frontend checks on every pull request and push. Pull requests build the image without publishing; pushes to main publish the server image to ghcr.io/k0rtex-io/k0rtex, tagged main and sha-<full-commit>.

Component (tag) Paths Result
server (server-v0.1.2) everything except changes that touch only the worker and provider packages or the chart; backend/packages/protocol and codemode count for both server and worker Multi-platform server image acrplatweu01-fdeugvadguaahga0.azurecr.io/k0rtex:0.1.2 (Linux amd64 and arm64).
worker (worker-v0.1.0) backend/packages/ The k0rtex_worker, k0rtex_protocol, k0rtex_codemode, k0rtex_provider_opencode and k0rtex_provider_claude_code wheels on the GitHub Release, all at one version.
chart (chart-v0.1.2) charts/k0rtex/ OCI chart oci://acrplatweu01-fdeugvadguaahga0.azurecr.io/charts/k0rtex. Its appVersion, the default server image, is the latest published server release, whose image must already be in the registry: publish a server release before a chart that should default to it.
docs (with each server release) docs-site/ and the Markdown it publishes Image acrplatweu01-fdeugvadguaahga0.azurecr.io/docs:<server version> for docs.k0rtex.io, and a pull request in k0rtex-io/platform-gitops that deploys it.

Install a released worker on macOS or Linux with:

sh
gh release download worker-v0.1.0 -R k0rtex-io/k0rtex -p '*.whl'
uv tool install --find-links . 'k0rtex-worker[opencode]==0.1.0'

Workflow #

  1. Configure and install the GitHub App (docs/workflow.md), import a repository and connect a worker.
  2. Click + New and describe what you want. Intake classifies it as an epic or a story.
  3. Refine an epic into stories when you choose.
  4. Start build on a Ready story. A Developer implements it and a Code Reviewer reviews it.
  5. Publish the reviewed commit as a PR or push it to the base branch, then mark the story Done.
  6. Learn gives a verdict when an epic’s stories are finished.

No proposal takes effect and no build starts without you. The workflow covers every step, including GitHub setup, board sign-in, worktrees and recovery. The features cover agents, policies, scheduling, knowledge and more.

MCP #

Streamable HTTP endpoint: http://127.0.0.1:8765/mcp/

To connect an existing OpenCode installation:

sh
opencode mcp add k0rtex --global --url http://127.0.0.1:8765/mcp/
opencode mcp list

k0rtex automatically supplies its MCP connection when creating its own agent sessions.

/mcp/ acts as the board owner. Your own agents can run the whole workflow there without any k0rtex-managed session: record an intake with intake_submit, create stories with refinement_submit, comment, and move tickets to any status, Done included. Give the endpoint only to clients you trust with that. The K0RTEX_MCP_TOKEN bearer token opens /mcp/ and the project knowledge and GitHub mounts, never a run’s own mounts.

Available tools:

Area Tools
Projects and policies list_projects, get_project, github_list_repositories, github_import_repository, update_project, list_policies, list_review_rules
Review gates list_ticket_reviews, require_review, waive_review, accept_review, rerun_review
Tickets list_tickets, get_ticket, create_ticket, update_ticket, transition_ticket
Intake and refinement, run by you intake_submit, refinement_submit (no k0rtex agent runs)
Intake and refinement, run by k0rtex intake_start, intake_message, intake_answer, intake_decide, refinement_start
Workflow state list_intake, get_workflow
Discussion list_comments, add_comment, resume_ticket
Checklists list_steps, add_checklist_step, update_checklist_step, remove_checklist_step
Agent Tasks list_tasks, get_task, retry_task
Profiles list_profiles, create_profile, role_profiles, set_role_profile, role_settings, set_role_model
Agents catalog, create_agent, update_agent, select_agent
Execution start_run, get_run, list_runs, cancel_run, report_outcome

Creation and mutation tools use a typed data argument. List tools support pagination. Read ticket.version and pass it as expected_version when editing or transitioning. Supply a unique idempotency_key to start_run; reuse it only when retrying the same request.

For a hosted board use the HTTPS origin and owner authentication. The public board MCP endpoint acts as the owner; session MCP endpoints are scoped to the assigned run and project.

API and configuration #

  • Interactive REST documentation: http://127.0.0.1:8765/docs
  • OpenAPI schema: http://127.0.0.1:8765/openapi.json
  • Live events: /api/v1/events/stream (supports Last-Event-ID)
  • Health: /api/v1/health
Variable Default
K0RTEX_DATABASE_URL required, e.g. postgresql://k0rtex:[email protected]:5432/k0rtex (mise sets this one)
K0RTEX_KNOWLEDGE_DATABASE_URL the board’s database; the knowledge index lives in its schema knowledge
K0RTEX_DATA_DIR ~/.k0rtex (SSH host key, saved embeddings connection)
K0RTEX_HTTP_BIND 127.0.0.1 (Docker image: 0.0.0.0)
K0RTEX_PORT 8765
K0RTEX_SSH_BIND 127.0.0.1
K0RTEX_SSH_PORT 8766
K0RTEX_SSH_PUBLIC_HOST unset (the board’s hostname)
K0RTEX_AGENT_IDLE_TIMEOUT 7200 (seconds an agent may stay silent before its run fails; waiting for your answer does not count; 0 turns the limit off)
K0RTEX_FRONTEND_DIR Repository’s frontend/dist
K0RTEX_GITHUB_APP_ID, K0RTEX_GITHUB_PRIVATE_KEY (or _FILE) unset: no GitHub. The board’s public GitHub App (setup and permissions)
K0RTEX_QDRANT_URL unset (Compose: http://qdrant:6333); without it search matches words only
K0RTEX_QDRANT_API_KEY unset
K0RTEX_EMBEDDINGS_URL unset; OpenAI-compatible base URL, until one is saved in Settings
K0RTEX_EMBEDDINGS_MODEL unset
K0RTEX_EMBEDDINGS_API_KEY unset; only ever sent to K0RTEX_EMBEDDINGS_URL
K0RTEX_EMBEDDINGS_DIMENSIONS the model’s own size

The CLI also accepts uv run --project backend k0rtex-server --port 9000. Use K0RTEX_PORT=9000 mise run dev to change the port for both the API and Vite proxy.

Run one backend process per database. The server holds a PostgreSQL advisory lock, so a second one on the same database refuses to start. Its single connection runs short transactions one at a time; agents never open the database. On restart, queued attempts remain queued, and previously starting/running attempts become interrupted. There is no automatic replay or session resumption.

Back up the database with pg_dump (the server may keep running) and the data directory for the SSH host key. The knowledge schema is derived: DROP SCHEMA knowledge CASCADE and a restart rebuild it.

Upgrading to PostgreSQL #

Releases before PostgreSQL kept the board in <data-dir>/k0rtex.duckdb. To carry it over:

  • Compose, Helm or Docker with the same data volume: upgrade and start the server. On its first start, when the database holds no board yet, it imports k0rtex.duckdb and renames it to k0rtex.duckdb.imported. Each project then gets a full knowledge index pass.
  • By hand: stop the server and run k0rtex-server import-duckdb ~/.k0rtex/k0rtex.duckdb with K0RTEX_DATABASE_URL set. Outside the Docker image this needs the duckdb-import extra (uv sync --project backend --extra duckdb-import).

The file must be at the last DuckDB schema: if the board was not started on the last DuckDB release, do that once first.

Command names #

The server’s command is k0rtex-server and the worker’s is k0rtex. They were k0rtex and k0rtex-worker. Package names, data directories and service names are unchanged. After upgrading:

  • Change scripts and units that start the server with k0rtex: that name now runs the worker.
  • On each worker with an installed service, run k0rtex service install again. The old service still points at k0rtex-worker, which no longer exists.
  • In a checkout synced before the rename, backend/.venv may have no k0rtex at all. Run mise run worker:install.

Upgrading from Taskboard #

k0rtex was called Taskboard up to 0.1.0. Every name changed with it, and the old names are no longer read. Stop the server and all workers, upgrade them together, then start them again.

What happens by itself on the first start:

  • The server moves ~/.taskboard to ~/.k0rtex when you have not set a data directory and ~/.k0rtex does not exist. A taskboard.duckdb board must first be upgraded with a release before PostgreSQL, which renames it to k0rtex.duckdb; then see Upgrading to PostgreSQL.
  • The worker moves ~/.taskboard-worker to ~/.k0rtex-worker when you do not pass --data-dir, and repairs the ticket checkouts inside it. Its pairing is kept.
  • The board rewrites stored agent permissions, instructions and checkout paths to the new names. Saved branch templates and existing taskboard/… branches are kept; only new projects default to k0rtex/{ticket}.

What you change yourself:

Before Now
TASKBOARD_* environment variables, including those in .env, Compose and Helm values K0RTEX_*
taskboard, taskboard-worker commands and any service unit that starts them k0rtex-server, k0rtex
agent-taskboard, taskboard-worker, taskboard-protocol, taskboard-provider-opencode packages k0rtex, k0rtex-worker, k0rtex-protocol, k0rtex-provider-opencode
opencode mcp add taskboard … and permission rules for taskboard_* tools in your own agent setups k0rtex, k0rtex_*
Compose volume taskboard-data, mounted at /var/lib/taskboard k0rtex-data at /var/lib/k0rtex: copy the old volume’s contents across before the first start
Helm chart charts/taskboard, resources named taskboard-<release> charts/k0rtex, k0rtex-<release>: install it as a new release and copy the volume; an in-place helm upgrade cannot rename them

To copy a Compose volume (Compose prefixes both names with the project name, by default the checkout’s folder name; check with docker volume ls):

sh
docker compose down
docker compose up --no-start   # creates the new, empty volume
docker run --rm -v <project>_taskboard-data:/from -v <project>_k0rtex-data:/to alpine cp -a /from/. /to/

A worker started with --data-dir pointing at a directory named .taskboard-worker is not moved. Rename that directory and pass the new path, because the board now expects checkouts under .k0rtex-worker. A third-party provider must register under the k0rtex.providers entry point group and import k0rtex_protocol. You are signed out once, and a GitHub App registered as Taskboard-… keeps its name. The container image and the repository keep their rafaelherik/taskboard address.

Checks #

CI runs on pull requests and pushes to main. The backend job runs Ruff and pytest, then builds a wheel and source distribution. The frontend job runs ESLint, TypeScript, and Vite. To enable the local pre-commit hook after setup, run git config --local core.hooksPath .githooks once per clone. It checks staged Python and TypeScript changes without modifying them.

Dependabot checks GitHub Actions, frontend packages, and backend packages weekly. Minor and patch updates are grouped by ecosystem; major updates get individual pull requests.

sh
mise run check
pnpm --dir frontend exec playwright install chromium
mise run e2e

Backend tests cover transactional dispatch, competing edits, workspace serialization, restart recovery, MCP/REST parity, SSE replay, and actual agent subprocess communication. Browser tests exercise the complete human workflow, mobile layout, and development proxy. All execution tests use a deterministic fake agent and their own PostgreSQL database, cloned from a migrated template on the server in K0RTEX_TEST_DATABASE_URL (mise points it at mise run db:up), or on a throwaway initdb cluster when that is unset.

Structure #

text
backend/src/k0rtex/
  domain.py             Request models, errors, workflow vocabulary
  services.py           Shared application rules and transactions
  persistence/          Single-connection PostgreSQL store, SQL migrations, DuckDB import
  api.py                REST and SSE adapter
  mcp/                  Board and run-scoped MCP tools and session management
  tasks.py              Agent Task definitions, context and results
  runs.py               Execution attempts and atomic handoffs
  execution/agent.py    One agent turn on a worker and the human interaction bridge
  execution/coordinator.py
  main.py               Application lifecycle and local CLI
frontend/src/
  App.tsx               Overview, project boards, navigation, live refresh
  TicketDetail.tsx      Ticket editing, comments, history, execution UI
  AgentProfiles.tsx     Reusable profiles and global role defaults

See the architecture for lifecycle and consistency decisions.

This page is README.md in the k0rtex repository. Suggest a change.