# 1ctx
[](https://github.com/stefanprodan/1ctx/actions/workflows/test.yml)
[](https://github.com/stefanprodan/1ctx/releases)
[](https://bun.com)
[](LICENSE)
[](https://github.com/stefanprodan/1ctx/attestations)
1ctx brings people and AI agents together in shared projects. Give each
agent a model, instructions and tools. Work with them in team chats, run
them on schedules, or hand work to the coding agents you already run,
such as Claude Code, Codex or OpenCode.
Context stays with the project. Working memory keeps compact project
notes in context across chats and automations. The shared knowledge
base provides long-term memory that agents consult and update as needed.
Long conversations continue through summaries. Optional deciders use
models such as [Jev](https://typesafe.ai/) to flag run results that need
human attention.
Agents run commands in a sandbox. You control their tools and network
access. The server, web UI and scheduler ship in one binary, with project
data kept on your server.
## Highlights
- **Memory with provenance.** Every knowledge revision records who wrote
it and in which chat or run. See its changes, roll back, or undo a
project note. Automations pick up where the last run left off.
- **Automations.** Run an agent on a cron schedule in your time zone,
or start a run by hand. Set deadlines and let agents flag results that
need your attention.
- **Delegate to your coding agents.** Hand an external task to an agent
you run outside 1ctx. It connects over MCP with a personal access
key, claims the task, reads the linked knowledge, asks when it is
stuck and reports back on the task's timeline. The same endpoint lets
it search the project's knowledge and chats and update the knowledge
base.
- **Conversations that continue.** Long chats are summarized with recent
turns kept in context. Fork a chat or bring another agent into a turn
with `@name`.
- **MCP and skills.** Connect [MCP](https://modelcontextprotocol.io/)
servers and install [Agent Skills](https://agentskills.io/). Choose
which capabilities a chat or automation can use.
- **Sandboxed commands.** Agents use a built-in shell with a virtual
filesystem, or a Linux sandbox per chat on
[OpenShell](https://github.com/NVIDIA/OpenShell). They can call HTTP
APIs with managed credentials.
- **Repository context.** Mount GitHub and GitLab repositories read-only
so agents can inspect code alongside the project's knowledge.
- **Web and visuals.** Agents can search the web, fetch pages and create
HTML or SVG visuals inside the chat. You control their network access.
- **Model providers.** Use OpenRouter, OpenAI-compatible APIs, Gemini,
OpenCode Go or Azure. Each agent has its own model and instructions.
- **Self-hosted.** Run the Bun-based binary, use Docker Compose, or
deploy on [Kubernetes](deploy/charts/onectx/README.md). Project data is
stored in SQLite, and API keys are read from secret mounts.
## Quick Start
You need Docker and an [OpenRouter](https://openrouter.ai) API key.
From a clone of this repository, build the image and write the secrets:
```sh
cd deploy/docker && (
set -e
mkdir -p secrets provision
ONECTX_VERSION=dev docker compose -f compose.yaml -f compose.dev.yaml build
key=$(mktemp)
trap 'rm -f "$key"' EXIT
docker run --rm ghcr.io/stefanprodan/1ctx:dev admin-key admin --stdout > "$key"
grep -q '^1ctx-admin-' "$key" || { echo "no admin key was made" >&2; exit 1; }
chmod 644 "$key"
mv -n "$key" secrets/user-admin.key
printf '%s' '<your OpenRouter key>' > secrets/provider-openrouter.key
chmod 644 secrets/*.key
)
```
The key goes into place only when it was made and no `user-admin.key`
is there already, with the mode the container's user can read; a key
is never written over. Any failed step stops the whole block before
the next.
`user-admin.key` holds the admin key of the first admin, `admin`. There
are no passwords: an admin signs in with their own key file,
`user-<username>.key`, made the same way with `admin-key <username>`, and
members sign in by email once SMTP is set up. The files must be
readable by the container's user, 65532; on a shared machine make them
mode 600 and owned by 65532 instead.
Add a provider and an agent in `provision/instance.yaml`:
```yaml
apiVersion: config.1ctx.dev/v1
kind: Provider
metadata:
name: openrouter
spec:
wire: openrouter
baseUrl: https://openrouter.ai/api/v1
keyFrom: provider-openrouter
---
apiVersion: config.1ctx.dev/v1
kind: Agent
metadata:
name: assistant
spec:
provider: openrouter
model: openrouter/free
prompt: You are a helpful teammate. Answer directly.
```
Start it:
```sh
ONECTX_VERSION=dev docker compose -f compose.yaml -f compose.dev.yaml up -d
```
Open <http://localhost:11236> and sign in with the admin key, the
content of `secrets/user-admin.key`.
The YAML in `provision/` is applied at every start. After editing it,
restart the container:
```sh
ONECTX_VERSION=dev docker compose restart
```
To run a release, omit `compose.dev.yaml` and replace `<release-tag>`
with a tag from [Releases](https://github.com/stefanprodan/1ctx/releases),
making the admin key as above with that image
(`ghcr.io/stefanprodan/1ctx:<release-tag>`):
```sh
ONECTX_VERSION='<release-tag>' docker compose up -d
```
## License
1ctx is licensed under the [Apache License 2.0](LICENSE).
See [third-party licenses](THIRD_PARTY_LICENSES.md) for bundled dependencies.