Skip to content
Back to skills

Capsa Setup

FSecurity

Install and configure capsa — a memory and knowledge base for AI agents — as an MCP server for this user. Use when the user asks to set up capsa, install capsa, add persistent memory to an agent (Claude Code, Cursor, Cline, OpenCode, Claude Desktop), connect capsa MCP, import an OKF knowledge bundle or a directory of skills into capsa, use one capsa database from another machine, or troubleshoot a capsa server.

  • 46 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
ai-agentsrustgoshellbashdockergitapidatabasebackend

Works with

  • claude code
  • claude desktop
  • cursor
  • terminal
  • cli
  • api
  • mcp

Security analysis

F0/100
  • criticalPipes output to a shell interpreter
  • mediumUses curl or wget to download content
  • criticalModifies startup scripts or system services for persistence
  • criticalModifies startup scripts or system services for persistence
  • criticalSends environment variables or credentials to an external URL
  • criticalDownloads and executes remote scripts — classic supply chain attack

Pro shows the line behind each finding and how to fix it

Scanned December 5, 2026

npx -y skills add svetlovtech/capsa --skill capsa-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Capsa Setup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Capsa Setup
[![Security: F — Skills Directory](https://www.skillsdirectory.com/api/skills/svetlovtech-capsa-setup/badge)](https://www.skillsdirectory.com/skills/svetlovtech-capsa-setup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: capsa-setup
description: Install and configure capsa — a memory and knowledge base for AI agents — as an MCP server for this user. Use when the user asks to set up capsa, install capsa, add persistent memory to an agent (Claude Code, Cursor, Cline, OpenCode, Claude Desktop), connect capsa MCP, import an OKF knowledge bundle or a directory of skills into capsa, use one capsa database from another machine, or troubleshoot a capsa server.
---

# capsa setup

capsa keeps an agent's memory and knowledge base — OKF markdown bundles — in
one HelixDB server — a graph database with a vector index and BM25 over the
chunks' text — and serves them over MCP: search by meaning and by
words, whole-file reads, writes under a version check, a queue of remembered
notes an agent consolidates, tasks with a lease, skills with their files. It
stores plaintext in the database — there is no encryption setting and no key
(the key 0.1.0 could take was removed in 0.2.0). Nothing is hosted but the
server: one binary, or one `docker compose up`. When this skill ends the
user has: a running server on loopback, a token in their MCP client, and
(optionally) their knowledge imported and searchable.

Work through the steps in order and verify each one before the next. Ask the
user only where a step says so; everything else is deterministic.

## 0. Preflight (one minute)

Run and read:

```bash
uname -s -m            # OS and arch, for the release asset name
docker info >/dev/null 2>&1 && echo docker:yes || echo docker:no
go version 2>/dev/null || echo go:no
printenv | grep -E '^CAPSA_' | sed 's/=.*/=<set>/'   # settings already present
```

Then decide where the HelixDB server runs — the only thing capsa needs from
outside:

| the user has... | path |
|---|---|
| Docker, and "just make it work" | **A. Docker Compose** — one HelixDB server (the image capsa is tested on, `ghcr.io/helixdb/helixdb:v0.0.21`) + capsa in one command |
| a HelixDB server already running — theirs, a team's, or the compose file's `helix` service alone | **B. Binary + their server**. capsa is tested on v0.0.21 and builds a missing index at its start; what another version does was not verified — say so, and run `capsa doctor` (step 3) before anything else |
| no Docker at all, no server | **C. Fully native** — the binary, a HelixDB server on the host (the image's binary or a container), Ollama for embeddings, a service unit to keep it running |
Ask the user which one, in one sentence, unless the answer is obvious. Do not
install a server unasked: offer it, and let them choose. All three paths end in the same steps 2–8.

## 1. Install

### Path A — Docker Compose (recommended for a first setup)

```bash
git clone --depth 1 https://github.com/svetlovtech/capsa.git ~/capsa && cd ~/capsa
docker compose up -d --build     # builds the image from the clone (a Go build: a few minutes the first time)
docker compose ps                # helix running, capsa running
```

The clone is needed: the compose file builds the image from the checkout
(`build: .`), so a directory that holds only `docker-compose.yml` fails with
`failed to read dockerfile`. It starts `ghcr.io/helixdb/helixdb:v0.0.21` —
the HelixDB server capsa is tested on, its graph on the named volume `helixdata`,
telemetry off — and capsa on `127.0.0.1:8116`; the server itself is published
on `127.0.0.1:6969` (`CAPSA_HELIX_PORT` overrides the port), for a CLI on the
host. These settings reach the container from `~/capsa/.env`:
the embeddings block (`CAPSA_EMBEDDINGS_BASE_URL`, `CAPSA_EMBEDDINGS_API_KEY`,
`CAPSA_EMBEDDINGS_MODEL`,
`CAPSA_EMBEDDINGS_TIMEOUT_SECONDS`, the fallback pair,
`CAPSA_EMBEDDINGS_DATA_COLLECTION`; `CAPSA_EMBEDDINGS_QUERY_INSTRUCTION` only
when the host sets it), the four `CAPSA_RERANK_*`,
`CAPSA_TOOLS`,
`CAPSA_TASK_LEASE_SECONDS` and `CAPSA_LOG_LEVEL` — and no other does
(`CAPSA_EMBEDDINGS_DIM`, the document prefix, `CAPSA_RERANK_CANDIDATES` /
`CAPSA_RERANK_MIN_SCORE`, `CAPSA_INDEX_INTERVAL_SECONDS`,
`CAPSA_INSTRUCTIONS_FILE` and `CAPSA_MCP_MAX_RESULT_BYTES` keep the binary's
defaults: one of those needs its own line in the compose file, or the binary
of Path B). An Ollama on the host is reachable from the
container by `host.docker.internal` (on Linux too: the compose file maps
it), so a private, local setup is two lines in that file:

```dotenv
CAPSA_EMBEDDINGS_BASE_URL=http://host.docker.internal:11434/v1
CAPSA_EMBEDDINGS_MODEL=bge-m3
```

The container stores plaintext; nothing in that file can change it.
The rest of this skill uses `capsa ...` for the CLI: with compose that is
`docker compose exec capsa /capsa ...`, or install the binary alongside
(Path B) and point it at the same server —
`CAPSA_HELIX_URL=http://127.0.0.1:6969` — so the CLI and the server see the
same data. `import --dir` (step 7) is the one command `exec` cannot carry:
the directory it reads belongs to the machine the command runs on, and the
container does not see the host's paths — for an import run the host CLI
against `127.0.0.1:6969`, or `docker compose cp` the bundle into the
container first.

### Path B — Binary

Release assets are named `capsa_<version>_<os>_<arch>.tar.gz` (`.zip` on
Windows): linux amd64/arm64, darwin amd64/arm64 (Apple silicon is arm64),
windows amd64/arm64. Take the latest from
`https://github.com/svetlovtech/capsa/releases/latest`, verify it against
`checksums.txt`, unpack into a directory on `PATH`. With Go 1.27 installed,
`go install github.com/svetlovtech/capsa/cmd/capsa@latest` works too.

The shorter ways, when the user's system has them. Check the right column
before you promise a row: the assets of the latest release at
`https://github.com/svetlovtech/capsa/releases/latest`.

| System | Install | Available |
| --- | --- | --- |
| Linux, macOS | `curl -fsSL https://raw.githubusercontent.com/svetlovtech/capsa/main/scripts/install.sh \| sh` (downloads the latest archive, checks `checksums.txt`, installs to `/usr/local/bin` or `~/.local/bin`; `--version vX.Y.Z`, `--prefix DIR`, `--dry-run`) | from the release that pushes it — the script is in the tree, and its URL answered 404 on 2026-12-03 (0.1.0 was the latest release) |
| Debian, Ubuntu | `sudo apt install ./capsa_<version>_linux_amd64.deb` from the release | from the first release with Linux packages — 0.1.0 has archives only |
| RHEL, Fedora | `sudo dnf install ./capsa_<version>_linux_amd64.rpm` | the same |
| Alpine | `sudo apk add --allow-untrusted ./capsa_<version>_linux_amd64.apk` | the same |
| Windows | `scoop bucket add capsa https://github.com/svetlovtech/capsa` then `scoop install capsa/capsa` | when `capsa.json` is at the repository root — not before the first release that writes it back |
| macOS | `brew install --cask https://raw.githubusercontent.com/svetlovtech/capsa/main/Casks/capsa.rb` (the binary is not signed with an Apple Developer ID; the cask clears the quarantine flag) | when `Casks/capsa.rb` is at the repository root — the same |

Check before you offer a row of the right column: the release's assets at
`https://github.com/svetlovtech/capsa/releases/latest`, or a 200 from the
manifest URL. If they are not there yet, use the archive.

```bash
capsa version
```

### Path C — fully native (no Docker anywhere)

**A HelixDB server on the host: v0.0.21, the version capsa is tested on.** The
server is one binary, `helix-server`, and a directory that keeps its graph;
there is nothing to create inside it — capsa builds the graph's indexes at its
first start, and there are no migrations. How the binary gets onto the host,
by what the host has:

- **A container runtime once — Docker or Podman — then a plain process.** Take
  the server out of the image capsa is tested on and run it as the user; nothing
  of the container stays. Verified here on Linux amd64 (2026-12-05); the image
  is Linux amd64 and arm64 only.

  ```bash
  cid=$(docker create ghcr.io/helixdb/helixdb:v0.0.21)   # podman: the same commands, not tried here
  docker cp "$cid":/bin/helix-server ~/.local/bin/helix-server && docker rm "$cid"
  mkdir -p ~/.local/share/helix
  HELIX_HTTP_ADDR=127.0.0.1:6969 HELIX_GRPC_ADDR=127.0.0.1:8081 \
  HELIX_DATA_DIR="$HOME/.local/share/helix" \
  HELIX_TELEMETRY_LEVEL=off DO_NOT_TRACK=1 ~/.local/bin/helix-server
  ```

  It answers `/readyz` within a second of its start (`curl -s
  http://127.0.0.1:6969/readyz`: `"storage":"open"`) and keeps running in the
  foreground — Ctrl-C stops it; the service unit below runs it instead. Nothing
  in that line is optional. The two addresses: the bare binary listens on every
  interface by default — `0.0.0.0:8080` and `0.0.0.0:8081` — and the server has
  no authentication and no TLS of its own, so any machine that reaches the port
  reads and writes everything. `HELIX_DATA_DIR`: without it the graph is in
  memory and lost at the stop — `capsa doctor` warns. The last two variables
  turn the server's usage telemetry off (it is `basic` by default). Stop a
  server by its pid, never by a pattern: a `pkill -f` of it ends the shell that
  runs the command.

- **With Docker to stay, the shortest server is one service**: in the clone of
  path A, `docker compose up -d helix` — then path B, the binary against it.
  The engine's own CLI (`curl -sSL "https://install.helix-db.com" | bash`, then
  `helix init local --name capsa` and `helix start capsa --disk --persist`;
  docs.helix-db.com, "Local server", read 2026-12-05) is the same thing with
  more steps: it needs Docker or Podman too, it publishes the port on every
  host interface, and without `--disk` every stop discards the graph. Set
  `tag = "v0.0.21"` in `helix.toml`'s `[local.capsa]` block before starting
  it — a saved tag wins over the CLI's — and run `capsa doctor` (step 3).

- **No runtime at all, and never**: the engine's release page carries its CLI
  only (v3.9.0 on 2026-12-05: five `helix-*` binaries, no server), so the
  server binary is carried from a Linux machine that has one, or built from the
  engine's source — the build was not run here; say so. On macOS and Windows the
  image does not run natively either: path A or B, on Linux or with a container
  runtime.

Then `CAPSA_HELIX_URL=http://127.0.0.1:6969` — in the environment or the env
file of step 2 — and on to step 2. The server holds everything in plaintext and
has no authentication of its own: it stays on loopback or a private network,
behind an authenticating proxy where it must leave the host, with its data
directory on an encrypted volume and backups whose cipher is on. The README's
"The database's protection" section has the recipe, each setting's source
named.

**Embeddings without Docker: Ollama as a native app** (ollama.com — macOS,
Windows, Linux). Pull a 1024-dimension model so it matches the stored vectors:

```bash
ollama pull bge-m3               # or qwen3-embedding:0.6b — check the size first:
ollama show bge-m3 | grep embedding   # must say "embedding length 1024"
# without the CLI, the API says the same: bert.embedding_length
curl -s localhost:11434/api/show -d '{"model":"bge-m3"}' | grep -o '"bert.embedding_length":[0-9]*'
```

Then `CAPSA_EMBEDDINGS_BASE_URL=http://127.0.0.1:11434/v1`,
`CAPSA_EMBEDDINGS_MODEL=bge-m3`, no key. `bge-m3` wants no query instruction
and needs nothing set: leave `CAPSA_EMBEDDINGS_QUERY_INSTRUCTION` unset, and
capsa gives each model what it needs (the Qwen3 models get theirs). Warn
about speed when the machine has no GPU: a local model on a CPU can be
slower than the 30 s an embeddings request gets by default (on a CPU-only
Ollama here `bge-m3` took 4–6 s a chunk, 2026-12-03). A batch that runs out
of the time is split in halves down to one text, so the chunks go through a
few at a time; a chunk the model cannot embed in time on its own still ends
an import with `context deadline exceeded`, and `CAPSA_EMBEDDINGS_TIMEOUT_SECONDS`
gives more time — the troubleshooting table has the rows.

**Keep it running without Docker.** Offer a service unit once `capsa serve`
works in the foreground; ask before installing one. A server started by hand in
path C wants one first — `~/.config/systemd/user/helix.service`, the variables
of its command line (the two units passed `systemd-analyze --user verify` on
2026-12-05; neither was installed here):

```ini
[Unit]
Description=HelixDB — the database capsa talks to

[Service]
Environment=HELIX_HTTP_ADDR=127.0.0.1:6969
Environment=HELIX_GRPC_ADDR=127.0.0.1:8081
Environment=HELIX_DATA_DIR=%h/.local/share/helix
Environment=HELIX_TELEMETRY_LEVEL=off
Environment=DO_NOT_TRACK=1
ExecStart=%h/.local/bin/helix-server
Restart=on-failure
RestartSec=3

[Install]
WantedBy=default.target
```

Then capsa's systemd user unit (`~/.config/systemd/user/capsa.service`, then
`systemctl --user daemon-reload && systemctl --user enable --now capsa`;
`loginctl enable-linger "$USER"` so it survives logout; with the unit above,
`After=helix.service` and `Wants=helix.service` in its `[Unit]` block):

```ini
[Unit]
Description=capsa — memory and knowledge base for AI agents
After=network-online.target

[Service]
EnvironmentFile=%h/.config/capsa/.env
ExecStart=%h/.local/bin/capsa serve
Restart=on-failure
RestartSec=3

[Install]
WantedBy=default.target
```

launchd (`~/Library/LaunchAgents/dev.capsa.plist` with
`EnvironmentVariables` holding the settings, `ProgramArguments`
`[capsa, serve]`, `KeepAlive` true, `RunAtLoad` true; then
`launchctl load` it). On Windows, a Task Scheduler entry "at logon" running
`capsa serve`, or the `sc create` wrapper of the user's choice.

## 2. Configure

Settings are environment variables with the `CAPSA_` prefix, or an env file
(a `.env` in the working directory, or the file named by `ENV_FILE`; the file
wins over the environment). Write the env file **next to the data** (the
compose directory, or `~/.config/capsa/.env`), never into a git repository.

| variable | required | value |
|---|---|---|
| `CAPSA_HELIX_URL` | yes | `http://127.0.0.1:6969` — the HelixDB server capsa talks to; the binary builds a missing index at its start, and there are no migrations. Give the server a data directory (`HELIX_DATA_DIR`, a volume): without one it keeps its graph in memory and loses it at its stop |
| `CAPSA_HTTP_ADDR` | no | `127.0.0.1:8116` (loopback). Keep it loopback unless the user runs a reverse proxy with TLS in front |
| `CAPSA_HELIX_API_KEY` | no | the bearer key of an authenticating proxy in front of the server; empty for a server reached directly |
| `CAPSA_LOG_FORMAT` | no | `text` for a terminal, `json` for a log pipeline |
| `CAPSA_EMBEDDINGS_BASE_URL` | no | see below; empty = search on the words alone (the fallback) |
| `CAPSA_EMBEDDINGS_API_KEY` | no | needed by a hosted provider, never by a local endpoint |
| `CAPSA_EMBEDDINGS_MODEL` | no | `qwen/qwen3-embedding-8b` by default; recorded with every vector, so switching it is this changed and `capsa index` run |
| `CAPSA_EMBEDDINGS_QUERY_INSTRUCTION` | no | unset: what the named model needs (`bge-m3` gets none, a Qwen3 embedding model gets Qwen's); an explicit value is sent as written |
| `CAPSA_EMBEDDINGS_FALLBACK_URL`, `CAPSA_EMBEDDINGS_FALLBACK_API_KEY` | no | a second endpoint serving the same model, asked once when the first fails in a way that can change; it sees every text the first one does |
| `CAPSA_EMBEDDINGS_TIMEOUT_SECONDS` | no | `30`: how long one embeddings request gets, in seconds (at least 1). A batch that runs out of it is split in halves down to one text, so a slow local model embeds a few chunks at a time; raise it for a slow model |
| `CAPSA_EMBEDDINGS_DATA_COLLECTION` | no | `deny` with OpenRouter: asks its providers not to keep the text (a request, not a guarantee); leave empty for any other endpoint |
| `CAPSA_EMBEDDINGS_DIM` | no | `1024` by default, or the model's own width from 64 to 4096: the vector indexes and every stored vector take it, and a vector's identity carries it beside the model and the recipe (`<model>@512`; the bare name is 1024). Set it before the first import on a fresh server: a change of width on a graph that already holds vectors is not supported yet (the README says why) |
| `CAPSA_EMBEDDINGS_RECIPE` | no | `v1` by default (the breadcrumb and the chunk's text); `v2` embeds the concept's title before each chunk's text. A vector's identity is the model and the recipe, so switching it is this changed and `capsa index` run, like a model switch |
| `CAPSA_FTS_NORM` | no | `0` by default: the word search is the engine's own (a word matched whole). `1` stores each chunk's normalised words — a Russian word as its stem — under an index of their own, and the word search reads it; chunks stored before it was turned on need `capsa index` once. |
| `CAPSA_RERANK_BASE_URL` (+ `CAPSA_RERANK_API_KEY`, `CAPSA_RERANK_MODEL`, `CAPSA_RERANK_API`) | no | a rerank endpoint; empty = no reranker (see below) |
| `CAPSA_RERANK_CANDIDATES` / `CAPSA_RERANK_MIN_SCORE` | no | 20 / 0 |
| `CAPSA_INDEX_INTERVAL_SECONDS` | no | 120 — how often the worker embeds what a write left pending and returns expired task leases |
| `CAPSA_TASK_LEASE_SECONDS` | no | 900 — how long a claim holds a task; an agent that goes silent loses it once the lease runs out |
| `CAPSA_TOOLS` | no | empty = all five tool groups — `memory`, `consolidate`, `tasks`, `skills`, `lint`; `memory` is always on, an unknown name is refused at start, and a token sees the enabled groups its scopes allow. `CAPSA_TOOLS=memory` makes a memory server that is only a memory |
| `CAPSA_MCP_MAX_RESULT_BYTES` | no | 32768 — no MCP answer is larger as JSON; a longer one is cut and says so (`truncated`, `next_offset`, `next_cursor`); at least 1024 |
| `CAPSA_INSTRUCTIONS_FILE` | no | empty = the built-in instructions every client reads; a file must hold something (at most 16 KiB) |

**Embeddings — any OpenAI-compatible `/embeddings` endpoint. Ask the user
which, with these options (the stored vectors are 1024-wide; the `dimensions`
parameter is sent, so MRL models like OpenAI's `text-embedding-3-*` and
Qwen3 fit; a model with another size is refused, and the message says what another
width would take — the two vector indexes dropped and every vector made
again):**

| option | `CAPSA_EMBEDDINGS_BASE_URL` | `CAPSA_EMBEDDINGS_MODEL` | key | notes |
|---|---|---|---|---|
| OpenRouter — one key, every model | `https://openrouter.ai/api/v1` | `qwen/qwen3-embedding-8b` (default, the benchmark winner: strict R@5 93 %) or `perplexity/pplx-embed-v2-context-0.6b` (90 %; also embeds images) | `CAPSA_EMBEDDINGS_API_KEY` | $0.010 per 1M tokens for the default (OpenRouter's catalogue, 2026-12-03); the provider sees the text it embeds — `CAPSA_EMBEDDINGS_DATA_COLLECTION=deny` asks it not to keep the text; `CAPSA_EMBEDDINGS_INPUT_TYPE=true` (default) |
| OpenAI | `https://api.openai.com/v1` | `text-embedding-3-small` or `-large` | key | `dimensions=1024` is sent for you |
| Ollama — native app or Docker, private | `http://127.0.0.1:11434/v1` | `bge-m3` (the measured local model: strict R@5 91 %) or `qwen3-embedding:0.6b` (1024 dims; not in the benchmark reports) | none | no query instruction to set; slow on a CPU (above) |
| Text Embeddings Inference — private, fastest local | `http://127.0.0.1:8080/v1` | whatever TEI serves | none | `CAPSA_EMBEDDINGS_INPUT_TYPE=false` if the endpoint rejects the field |
| vLLM — private | `http://127.0.0.1:8000/v1` | whatever vLLM serves | none | same |
| none for now | *(empty)* | — | — | search runs on the words alone, in any script — BM25 on the engine's own index; a fallback, not a peer: on the benchmark corpus, through the product, the word search finds 59 % R@5 on the graph (56 % before the move to HelixDB) where the product's vectors find 80 % and 90 % with `rerank-3-lite` (`docs/eval/helixdb.md`). Stored chunks are embedded by the worker once a provider appears (`capsa index`) |

Check a local model's size before committing to it: `ollama show <model> |
grep embedding` must say 1024. After the first import with embeddings on,
`capsa stats` must show `pending_chunks: 0`; a search through MCP answers
with `"mode": "vector"`.

**Reranker — optional, the second stage of search; off by default, and only
when the user asks for it.** The cross-encoder stage has no benchmark report
under `docs/eval`: expect no measured gain, and the provider sees the query
and the candidate texts in plaintext. Any rerank endpoint; the request shape
is inferred from the host unless `CAPSA_RERANK_API` says otherwise:

| provider | `CAPSA_RERANK_BASE_URL` | `CAPSA_RERANK_MODEL` | notes |
|---|---|---|---|
| OpenRouter | `https://openrouter.ai/api/v1` | `qwen/qwen3-reranker` or `voyage/rerank-3-lite` | `CAPSA_RERANK_API_KEY`; generic shape |
| Voyage | `https://api.voyageai.com/v1` | `rerank-3-lite` | `CAPSA_RERANK_API_KEY`; `x-api-key` is sent for you |
| Cohere | `https://api.cohere.com/v2` | `rerank-v4.0-fast` | `CAPSA_RERANK_API_KEY` |
| Jina | `https://api.jina.ai/v1` | `jina-reranker-v2-base-multilingual` | key |
| Text Embeddings Inference (local) | `http://127.0.0.1:8080/v1` | the model TEI serves | no key; e.g. `ghcr.io/huggingface/text-embeddings-inference:cpu-1.8` with `--model-id Qwen/Qwen3-Reranker-0.6B` |
| vLLM (local) | `http://127.0.0.1:8000/v1` | the model vLLM serves | no key |

Ollama has no rerank endpoint, so a local reranker is TEI or vLLM. A CPU
reranker takes seconds per query (tens of seconds with long documents): for a
laptop, recommend none. `CAPSA_RERANK_CANDIDATES` (20) is how many concepts
it sees — the best chunk of each; `CAPSA_RERANK_MIN_SCORE` (0 = off) drops reranked hits below a
relevance. When the reranker fails, search still answers in the vector order
and the result carries `"fallback_reason": "reranker failed: ..."`. Verify: a
search answers with `"mode": "vector+rerank"` and a `"reranker"` name.

**Plaintext — say it first.** capsa has no encryption and takes no key: the
content is stored as plaintext and is as safe as the one HelixDB server that
holds it — on loopback or a private network (it has no authentication of its
own), behind an authenticating proxy where it must leave the host, its data
directory on an encrypted volume, TLS between capsa and the server when they
are not on one host, and backups encrypted by the operator. Then one thing to
look for: a database of capsa 0.2.x or 0.1.0 does not carry over to the graph
except through files — `capsa export` there, with that version's binary (its
`capsa decrypt --yes` first, when 0.1.0 ran with a content key), `capsa
import` here (step 7). Nothing here reads such a database directly. Record
in the final report that the installation stores plaintext and is protected
by its server's settings.

## 3. Verify the server

```bash
export ENV_FILE=/path/to/.env     # or have the variables in the environment
capsa doctor
```

`doctor` examines the HelixDB server the way every process of capsa will use
it, and prints one JSON document. Its rows: `server` — reached, and ready;
`mode` — capsa writes, and needs the writer; `indexes` — the graph's indexes,
a missing one built here as at every start; `storage` — a server that keeps
every write in memory only gets a `warn` (the server's own device check may
surface beside it as `storage.data_device`: a data directory on a rotating
device — a warn, never a failure); then the server's own diagnostics,
each a row of its own. `--fix` is accepted and adds nothing. An index that
exists with another definition is a failure and is never dropped: that is a
person's decision, and the row's `fix` says so. A row with `"status": "warn"`
leaves `"ready": true`: read its `fix` (the troubleshooting table has them).
When `"ready": true`, continue.

## 4. Run the server

```bash
capsa serve &            # or: docker compose up -d
capsa ready              # prints ok when /readyz answers
curl -s http://127.0.0.1:8116/healthz
```

Routes: MCP at `/mcp` and over stdio (`capsa mcp`), admin API at
`/api/admin`, the admin console at `/admin/`, health at `/healthz` and
`/readyz`. Everything but health and the
console's static page needs a bearer token. The console works by task — a
status strip (health, version, how the stored content sits, vector search, pending
chunks, the episodes waiting), browsing and editing concepts, a search
preview, the episode queue with its mark, tokens, the query
log and the audit log — and takes the admin token in the browser tab; a
bundle-restricted admin token gets Browse and Search only. The admin API
also has the lint, task and skill routes (`docs/lint.md`,
`docs/tasks-skills.md` §5), which the console does not show yet. For a
long-lived install without Docker, use the service unit from Path C; compose
has `restart: unless-stopped`.

## 5. Tokens

Two kinds, both made once and shown once:

```bash
capsa token create --name admin --scopes admin                       # for /api/admin and /admin/
capsa token create --name <client>-<user> --scopes read,write        # for the MCP client
```

`--client <name>` makes `token create` print the client's entry too, in the
answer's `client_config`: `--client opencode|claude-code|claude-desktop|cursor|codex`,
over HTTP by default (`--transport http`: `--url`, or
`http://<host>:<port>/mcp` from `CAPSA_HTTP_ADDR`) or as a process
(`--transport stdio`: `capsa mcp`, handed the configuration by reference —
the entry carries `ENV_FILE`, the env file in use as an absolute path, and
the token; there must be one: `capsa config export --out FILE` first, a
usage error otherwise — so no secret of the configuration enters a client's file).
`claude-desktop` takes stdio only. Prefer it to the JSON blocks of step 6.

Optional `--bundles kb,ops` limits a token to those bundles. The slugs must
exist already — capsa resolves them to bundle ids at creation and answers
`capsa: bundle not found` otherwise — so a restricted token is minted after
step 7 (the import), or after the bundle is created in the admin console.
Scopes are `read`, `write`, `skills`, `admin`; an MCP client needs
`read,write` to remember things, and `skills` (a separate scope — `write`
does not imply it, and neither does `admin`) only for a client that may
change the skills it runs under. Hand each secret to the user through the channel they choose
(a password manager, the client's config file) — never into a repository, a
commit, a shared chat log, or a file other users can read. Do not reuse the
admin token in an MCP client.

## 6. Connect the MCP client

Server address `http://127.0.0.1:8116/mcp`, header
`Authorization: Bearer <token>`. Streamable HTTP. `capsa token create
--client <name>` (step 5) prints each entry with the token in it; by hand:

Claude Code:

```bash
claude mcp add --transport http capsa http://127.0.0.1:8116/mcp --header "Authorization: Bearer <token>"
```

Claude Desktop (`claude_desktop_config.json`), Cursor / Windsurf
(`.cursor/mcp.json`), Cline — clients differ on the type name; use what the
client's docs call Streamable HTTP (`"type": "streamable-http"` or `"http"`,
or no type with `"url"`):

```json
{
  "mcpServers": {
    "capsa": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:8116/mcp",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}
```

OpenCode V2 (`~/.config/opencode/opencode.json` or the project's
`opencode.json`) keeps its servers under `mcp.servers`; V1 takes the same
object directly under `mcp`:

```json
{
  "mcp": {
    "servers": {
      "capsa": {
        "type": "remote",
        "url": "http://127.0.0.1:8116/mcp",
        "oauth": false,
        "headers": { "Authorization": "Bearer {env:CAPSA_TOKEN}" }
      }
    }
  }
}
```

A client on the same host can also run the server as a process — `capsa mcp`
over stdio, every call made as the token in `CAPSA_TOKEN` (exit 2 without
it, exit 1 for a token that is not active) and the service's configuration
read as every command reads it. The entry `capsa token create --client
opencode --transport stdio` prints, with `ENV_FILE` set, is this shape:

```json
{
  "mcp": {
    "servers": {
      "capsa": {
        "type": "local",
        "command": ["/usr/local/bin/capsa", "mcp"],
        "environment": { "ENV_FILE": "/home/me/.config/capsa.env", "CAPSA_TOKEN": "<token>" }
      }
    }
  }
}
```

The token is in the process's environment, so give a stdio server the least
token that suffices. Over stdio a client initializes the session before its
first call — a `tools/list` sent first is refused as "invalid during session
initialization"; the clients above do it in their own order.

Then prove it without the client, so a later client problem is the client's:

```bash
curl -s http://127.0.0.1:8116/mcp \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

`tools/list` answers with the tools the configuration enables and the
token's scopes allow: with every group on, a `read,write` token sees 18
tools (20 for every scope, 10 for `read`); with `CAPSA_TOOLS=memory`, 9 for
`read,write`. The catalog is printed into the model's context on every turn
in a Code Mode client: 23 936 B for that `read,write` token with every
group, 26 190 B with every scope, 11 001 B for a memory-only `read,write`
token (measured 2026-12-03), which is the reason to set `CAPSA_TOOLS`. The
tools the user will see:

| tool | does | scope |
|---|---|---|
| `memory_search` | find concepts by meaning — or by words, when no embeddings provider answers (`mode: fts`); `bundle`, `type`, `tags`, `limit`, `include_deprecated`, `fields` (the keys each hit carries: `path`, `score` is the search-then-get pattern) | read |
| `memory_get` | one concept by `bundle` + `path`, with content, frontmatter and neighbours; `offset`, `limit` when the byte budget cut it | read |
| `memory_list` | concepts of a bundle by `prefix`, pages of 100 behind a cursor; `fields` as on the search | read |
| `memory_put` | store or replace a concept from a markdown document (needs `type:` in the frontmatter); `expected_version` (absent: no check, `0`: create only, `n`: must match); `derived_from` names the episodes it consolidates | write |
| `memory_edit` | replace, append, delete or rename one section of a concept by its heading, with `expected_version`; the frontmatter is left as it is; a task is refused | write |
| `memory_deprecate` | mark a concept deprecated, optionally `superseded_by` another path; `expected_version` | write |
| `memory_remember` | append a raw note to the bundle's episode log — the cheap way to remember; not searched; an agent consolidates the queue | write |
| `memory_inbox` | the bundle's waiting episodes, grouped by likeness, each group with its nearest concepts as candidates — suggestions, not decisions; `cursor`, `limit`, or one `episode` with `offset` | read |
| `memory_consolidate` | mark episodes consolidated — `applied` with the `paths` written, `noop`, or `review` with a `task` — so the inbox stops listing them; changes no concept | write |
| `memory_changes` | what changed since a cursor (the audit log's row id) — identifiers and versions only, no content; an absent `since` is a baseline at the head | read |
| `memory_whoami` | this token: name, scopes, bundles, the server's `version` and `catalog_hash` | any valid token |
| `okf_lint` | check a stored bundle, one concept, or a draft against OKF v0.3; `fix: none`, `dry_run` or `apply` | read; `write` for `apply` |
| `task_create` | a task: `title`, `description?`, `path?`, `depends_on?[]`, `body?`, `derived_from?[]` (episodes it comes from) | write |
| `task_list` | a bundle's open tasks by default (`status` for another one, `all` for every): status, dependencies, `ready`, the live lease | read |
| `task_claim` | take the lease of a task by `path` (again, to renew it), or of the next ready one with `next: true` and `prefix?` | write |
| `task_update` | `action: complete`, `fail` or `release`, with `reason?` | write |
| `skill_list` | the current skills of a bundle, by name | read |
| `skill_get` | one skill by `name` — `content` is its `SKILL.md` and `files` its other files; with `file`, that file's text, windowed | read |
| `skill_put` | store or update a skill under `skills/<name>`: `name`, `description`, `body`, `files` (the whole set of its files — omitted leaves them, `[]` removes them), `expected_version?`; one transaction | skills |
| `skill_deprecate` | retire a skill, optionally `superseded_by` | skills |

When several agents write to the same memory, tell the client's agent what
holds today — nothing is pushed, it is all pull (`docs/mcp.md` §6a):
`memory_changes` lists what changed since a cursor, identifiers and
versions only, and the agent refetches those paths and compares versions;
`memory_whoami`'s
`catalog_hash` changes when the server's catalog did — after an upgrade or
an edited `CAPSA_TOOLS` — which means `tools/list` again; and for a client
that should act on a change by itself, an OpenCode automation — a Code Mode
script on an interval that polls and steers the session (the scripts are in
`docs/mcp.md` §6a for the feed and §6b for the inbox, both verified end to
end on 2026-12-03). Server push waits for the SDK; do not promise it.

## 7. Bring the knowledge in

A bundle is a directory of markdown: each concept file carries YAML
frontmatter with a `type:` (Fact, Decision, Playbook, How-to, Reference —
any string is allowed), an optional `status` (`draft`, `stable`,
`deprecated`), `tags`, and links to other concepts by path. Plain markdown
without frontmatter can be imported too with `--wrap`, which synthesizes the
frontmatter. Through compose, `import --dir` runs on the host against
`127.0.0.1:6969` (Path A): the container sees none of the host's
directories, and `docker compose exec capsa /capsa import --dir ~/notes/kb`
fails with `open bundle root: ... no such file or directory`. Two types mean
more: `type: Task` (a lifecycle in `status`:
open, in_progress, done, failed, cancelled; dependencies in
`x-capsa-depends-on`) and `type: Skill` (`name`, `description`; the body is
the instruction text). A skill is a folder: `<name>/SKILL.md` and the files
it needs travel together (UTF-8 text, at most 64 KiB a file and 64 files a
skill) — so `capsa import --dir <skills-root> --slug SLUG --skills` brings a
directory of Agent Skills in, and `capsa export --slug SLUG --dir DIR
--skills` writes the folders back (`docs/skills.md`).

```bash
capsa lint --dir ~/notes/kb                       # 46 rules against OKF v0.3; an error means not conformant
capsa import --dir ~/notes/kb --slug kb            # --prune drops concepts deleted from the directory
capsa stats                                       # concepts stored; pending = chunks still waiting for an embedding
capsa index                                       # embeds pending chunks (needs an embeddings endpoint)
capsa eval run --corpus ~/notes/kb --questions ~/qa/set.json --slug eval-kb   # retrieval measured: the answers scored, a JSON of aggregates under -o
capsa eval compare ~/qa/runs/before.json          # a run against the last one beside it; exits 1 when R@5 or MRR@10 dropped
```

`capsa eval` reads a question set by path — it references private documents, so
it is never written into the bundle — and `capsa eval score` and `capsa eval
compare` read files alone: no server. `capsa lint` exits 0 without errors;
`capsa lint --dir DIR --fix` is a dry
run that says what it would change and exits 1 when something would (add
`--yes` to write). The import reports `lint: {errors, warnings}` too and is
never blocked by them. A claimed task is left alone: a file that differs
from a task a live lease sits on is not written and `--prune` does not
delete it — the document counts them (`claimed_left`) and stderr names the
paths; import again once they are free. `capsa import` prints one JSON
document: the statistics of the import with its indexing step inside
(`embedded`: how many pending chunks were embedded; `failed`: how many the
provider refused, each tried alone — they stay pending; `pending_chunks`:
how many still wait).
A large bundle on a slow local model: `--index=false` stores it at once and
leaves every chunk pending. Re-importing is cheap: unchanged concepts (same
content hash) are skipped, changed ones get a new version. To get the
knowledge back out: `capsa export --slug kb --dir /tmp/kb` — the same
files, plus a regenerated `index.md`, into an empty directory (a non-empty
one is refused: `--yes` writes into it).

A token limited to the new bundles is minted now, not before: `capsa token
create --name <client>-<user> --scopes read,write --bundles kb`.

**The notes agents remember are a queue, not knowledge.** `memory_remember`
appends raw notes to a bundle's episode log; an agent consolidates them —
reading the queue, writing a draft, an edit or a review task, and marking
the notes handled — with the skill `skills/capsa-consolidate/SKILL.md`. Two
things make it happen:

- Give the skill to the agent that will do the work. It is in the
  repository's `skills/` directory, and `capsa import` stores it as a Skill
  of the bundle (it takes the `skills` scope to write, so no consolidator
  can rewrite it):

  ```bash
  capsa import --dir ~/capsa/skills --slug kb --skills      # capsa-setup and capsa-consolidate, as skills/<name>
  capsa stats                                               # the bundle's skills are concepts
  ```

- Poll the queue on a schedule: an OpenCode automation reads
  `memory_inbox` with `limit: 1` — one small read, `remaining` and
  `oldest_at`, no model call — and steers a session when episodes wait (the
  script is in `docs/mcp.md` §6b). Without a scheduler, consolidation
  happens when the user asks for it.

The token for the pass is `read,write`, never `skills`.

## 8. Hand over

End with a short report: what was installed and where, the server address,
**where the tokens are stored** (not their values), that the content is
stored as plaintext, which embeddings option is active, what was imported,
and the one command to check it is alive (`capsa ready`). Mention the
operation the user will need eventually: backups — an unencrypted backup is
the whole knowledge base in the clear — a copy of the server's data directory
is the knowledge base itself — so the backup's cipher must be on.

For a second machine on the same server — the user asks for one, or the
client will run elsewhere — the configuration travels as one file:
`capsa config export --out FILE` here (it holds the server's address and
the API keys: mode 0600, never into a repository), carry the file and the
binary, then there `ENV_FILE=FILE capsa config check` (the server reached and
ready, its indexes built, `"ok": true`; a warning asks to compare the
embeddings block — the model is recorded per chunk, so another model's
vectors are not ranked there and `capsa index` makes them again, but the
instruction and the prefix are not recorded), `ENV_FILE=FILE capsa serve` if
that machine serves too, and `ENV_FILE=FILE capsa token create --client
<name>` for its client — minted where the client runs, since a stdio entry
names that machine's env file.

## Troubleshooting

| symptom | cause | fix |
|---|---|---|
| `401` from `/mcp` | no or malformed `Authorization` header | `Authorization: Bearer <token>` exactly |
| `403` from `/mcp` | token revoked, unknown, or lacking the scope the tool needs | `capsa token create ... --scopes read,write` |
| `403` from `/api/admin` | the token has no `admin` scope | use the admin token |
| `403` from `/api/admin/status`, `/stats`, `/queries`, `/audit`, `/tokens` | the admin token is restricted with `--bundles`: the routes of the whole installation need an unrestricted one | by design; mint `capsa token create --name admin --scopes admin` without `--bundles` for the whole installation |
| any command exits 1: `... CAPSA_HELIX_URL is required (http://host:6969, the HelixDB server)` | no server is named | set `CAPSA_HELIX_URL` in the environment or the env file, then the command again |
| doctor: `server`, `"status": "failed"`, `the server did not answer: ...` | the address or the port is wrong, the server is down, or a proxy in front of it refuses the request | read the reason after the colon — a connection refused is a server not listening on that port, an authentication error a proxy that wants `CAPSA_HELIX_API_KEY`; the row's `fix` says: check `CAPSA_HELIX_URL` and that the HelixDB server runs |
| doctor: `server`, `"status": "failed"`, `the server answers but is not ready: ready=false, storage=...` | the server is up and still loading, or its storage is not what it reports | wait and run again; a storage that stays not ready is the server's own problem — its log says why |
| doctor: `mode`, `"status": "failed"`, `the server is a "...": capsa writes, and needs the writer` | the address points at a server that is not the writer — its mode says which | `point CAPSA_HELIX_URL at the writer`, as the row's `fix` says |
| doctor: `indexes`, `"status": "failed"`, an index `exists with another definition` | the graph holds an index of that name with another definition — a vector index of another width, or a unique one where capsa wants it plain: a server shared with something else | the doctor never drops it: that is a person's decision. Read what the server has (`/v2/diagnostics`), then drop that index on the server and run again — what it indexed is made again |
| doctor: `indexes`, `"status": "failed"`, `an index could not be built: ...` | the server refused or could not finish the build | read the server's `/v2/diagnostics` for the blocked build; its log says why |
| doctor: `diagnostics` or a row of the server's own, `"status": "warn"` | the server's own checks could not be read, or one of them warns | `ready` stays true: read the row's `fix`; the server's log has the detail |
| doctor: `storage`, `"status": "warn"`, `the server keeps every write in memory only: all of it is lost when the server stops` | the server runs with no data directory — a throwaway one, or the compose file's volume removed | by design for a try-out: nothing survives a stop. For a setup that keeps its data, give the server `HELIX_DATA_DIR`, a volume, as the row's `fix` says — the compose file already does |
| doctor: `storage.data_device`, `"status": "warn"`, `HELIX_DATA_DIR is on a spinning disk` | the server's own device check: the data directory sits on a rotating device (a VM often reports one behind an SSD) | `ready` stays true: reads and writes pay the disk's latency. Move `HELIX_DATA_DIR` to an SSD when the machine has one |
| `capsa stats` shows `stale_embeddings: N` | N chunks carry a vector the configured model did not make — another model's (not ranked), or one made before the model was recorded per chunk | `capsa index` makes them again; if the model was changed, run it first and search again after |

| search finds nothing after an import | no embeddings endpoint → the words alone (a fallback), or chunks still pending; and the words are whole — an inflected form, a part of an identifier (`backend_runet_ip` is three terms: `backend` finds it, `runet_ip` does not), or a translation of the answer's words is not found | `capsa stats` shows `pending`; `capsa index`; or set an embeddings endpoint for those and restart |
| search answers `"mode": "fts"` though an endpoint is configured, with a `fallback_reason` | the endpoint was down, slow, or refused the model for that call | read the reason; a local model on a CPU may be too slow for the time a request gets (next row) |
| `capsa import` exits 1 with `context deadline exceeded` — or the server logs `indexing pending chunks` with the same error every interval | the model cannot embed *any* chunk within `CAPSA_EMBEDDINGS_TIMEOUT_SECONDS` (30 by default): a batch that runs out of the time is split in halves down to one text, the first eight are then tried alone, and when none is stored the provider is taken for down — one slow chunk alone does not end the pass (next row); the bundle is stored, its chunks are pending (on a CPU-only Ollama here `bge-m3` took 4–6 s a chunk, 2026-12-03) | raise `CAPSA_EMBEDDINGS_TIMEOUT_SECONDS` for a slow model; or give the model a GPU, use a smaller one (`qwen3-embedding:0.6b`) or a hosted endpoint, then `capsa index` — the worker retries on its own at every `CAPSA_INDEX_INTERVAL_SECONDS` |
| the server logs `chunks the provider did not embed stay pending` with `failed=N paths=[…]`, or `capsa import`'s document shows `"failed": N` | N chunks the model cannot take — alone, after the batch that carried them was split to them — while it embeds the rest; they stay pending, and every pass tries them again, once | by design: everything else is embedded. The provider's reason is in the line (`error=…`): raise `CAPSA_EMBEDDINGS_TIMEOUT_SECONDS` for a timeout, or change the chunk's text; `capsa index` exits 1 while any stays pending |
| `capsa index` exits 1: `no embeddings endpoint configured ... N chunks are pending` | no endpoint is set; the document on stdout says `"embedded": 0` | by design; the chunks wait for an endpoint |
| `address already in use` | 8116 taken | the binary: `CAPSA_HTTP_ADDR=127.0.0.1:<other port>`. Compose: the published port is the compose file's `ports` line for the `capsa` service — edit it there (or stop what holds 8116) |
| server log: `embedding provider failed, searching by words` | the embeddings endpoint is down, refuses the model, or returns another size | `curl` the endpoint's `/embeddings` with the model name; check `ollama show <model> \| grep embedding` says 1024 |
| the endpoint answers `model not found` under Docker Compose | the model name does not reach the container, or the host's Ollama is not reachable from it | in the `.env` next to the compose file: `CAPSA_EMBEDDINGS_BASE_URL=http://host.docker.internal:11434/v1` and `CAPSA_EMBEDDINGS_MODEL=<model>`; both pass through the compose file |
| search answers `"mode": "vector"` though a reranker is configured, with a `fallback_reason` | the reranker failed (key, model name, endpoint down) | read the reason; `curl -X POST $CAPSA_RERANK_BASE_URL/rerank ...` by hand |
| `embeddings API returned N dimensions, want 1024` | the model's size differs | pick a 1024-dimension model; another width takes the two vector indexes dropped and every vector made again — a person's decision, not a setup step |
| `capsa export` exits 1: `directory is not empty: ... holds N entries and nothing was written` | the output directory is not empty — the plain export and `--skills` alike refuse to overwrite silently | an empty directory, or `--yes` to write into it (replacing the files of the same name) |
| `capsa lint --fix` exits 1 | a dry run found something to change; nothing was written | `capsa lint --fix --yes` to write it |
| `capsa lint --fix --yes`, `okf_lint` with `fix: apply` or the admin lint route stop with `fix <path>: the task is held by another token: <path> is held by <holder> until …` | a task of the bundle is claimed: a claimed task is its holder's to write, and the fix writes as a token — or, from the CLI, with none, which holds no lease | by design; the fixes before it stand. The fix lands when the lease ends or is released, or run it as the holder |
| `capsa import` logs `import left claimed tasks alone` and its document shows `"claimed_left": N` | N tasks of the bundle are claimed and the directory's files for them differ — a claim rewrites the status, so an unchanged directory counts too | by design; everything else was imported and the exit is 0. Import again once the tasks are free |
| `capsa lint` prints `error [OKF-E…]` | the bundle is not conformant to OKF v0.3 | read `path:line`; `capsa lint --rules` says what each rule means; `docs/lint.md` has the table |
| `memory_put` answers `writing a Skill needs the "skills" scope` | the token has `write` but not `skills` | by design; `capsa token create ... --scopes read,write,skills` for a client that may change skills |
| `memory_put` answers `... exists, at version N; memory_get it, then put with expected_version N — or another path` | `expected_version: 0` (create only) on a path that is taken | `memory_get` it and put with its version, or choose another path |
| `memory_put` or `memory_edit` answers `... is at version 4, not 3` | a version conflict: the concept moved on since it was read | `memory_get` it, re-apply the change, write with the new version; nothing was changed |
| `memory_put` answers `the task is held by another token: <path> is held by <holder> until …` | the path is a task another token has claimed: while a lease is live, no write changes the task but its holder's | wait for the lease (`CAPSA_TASK_LEASE_SECONDS`, 900 s), or claim it yourself when it is free |
| `memory_edit` answers `... is a task: its body is written by the task tools` | a section edit on a `type: Task` | `task_update` (with a claim) or `task_create` write a task; `memory_edit` never does |
| `memory_put` or `memory_edit` with `derived_from` answers `a human-reviewed concept is not rewritten by a write that cites episodes: <path>; write the new claim as a draft beside it ...` | the write would change a concept a person verified | write a new draft linked to it and a review task (`memory_consolidate` with `outcome: review`), as the answer says |
| `memory_put` answers `a verified event is added or changed, and only an "admin" token writes one` | the file carries a `verified` event that is new or changed, and the token is not an admin | by design: a person's badge is an admin's to write; drop the event from the file |
| `task_claim` answers `task is claimed by another holder` | another token holds a live lease | wait for the lease (`CAPSA_TASK_LEASE_SECONDS`, 900 s), or claim the next ready task |
| `task_update` answers `task is not claimed by this token` | the lease ran out and the server returned the task to `open`, or another token holds it | claim it again, then update |
| `memory_changes` answers `{"changes": [], "next_cursor": N}` on the first call | `since` was absent: a baseline at the head, nothing replayed — not an error | store `next_cursor` and ask again with `since: N`; `since: 0` for the whole history |
| `memory_inbox` answers `"mode": "time"` with a `fallback_reason` | no embeddings provider (or it failed): episodes in time order, one cluster each, no candidates | set an endpoint for clusters and candidates; the agent can still read and consolidate the notes |
| MCP client says the server is unreachable | the server binds loopback and the client runs elsewhere (container, VM, WSL) | expose it deliberately: a reverse proxy with TLS in front, or `CAPSA_HTTP_ADDR=0.0.0.0:8116` on a trusted network — tokens still gate every route |
| `capsa mcp` exits 2: `CAPSA_TOKEN is required` | the stdio server has no token to act as | `capsa token create --name <client>-<user> --scopes read,write`, and set it in the server's environment; never run a stdio server with the admin token |
| `capsa mcp` exits 1: `CAPSA_TOKEN is not an active token` | revoked, unknown, or mistyped | mint a new one; the error never echoes the value |
| a stdio client answers `method "tools/list" is invalid during session initialization` | a request was sent before `initialize` (over stdio the session is initialized first) | the client's own order does it; a hand-made probe sends `initialize` first |
| `capsa token create --transport stdio` exits 2: `a stdio entry points the server at the env file in use, and there is none (ENV_FILE, or .env here)` | a stdio entry names an env file by reference and none is in use | `capsa config export --out FILE`, then run again with `ENV_FILE=FILE` |
| a tool call answers `this token (…) has no "write" scope` | the token's scopes leave the tool out; the client cached a list from before the token changed | mint the token with the scope it needs; the client runs `tools/list` again |
| a tool call answers `unknown tool "task_list"` | the tool's group is off in `CAPSA_TOOLS` | add the group to `CAPSA_TOOLS` and restart, or drop the tool from the client's instructions |
| the client keeps calling a tool the server no longer offers | a stale catalog: the server was upgraded or `CAPSA_TOOLS` edited | `memory_whoami.catalog_hash` differs from the one the client saw: run `tools/list` again (the list is cached for a minute) |
| an answer ends with `truncated: true` | the byte budget (`CAPSA_MCP_MAX_RESULT_BYTES`) cut it | call again with `next_offset` (a file) or `next_cursor` (a page); raise the setting if the model should see more at once |

## Rules for the agent

- Never write a token, the key of an authenticating proxy, or a server
  address that carries a password into a repository, a commit message, a log you share, or any file with wider
  permissions than the user's own.
- Never set or ask for a content key: capsa has none. A database of 0.1.0 or
  0.2.x comes over through files — `capsa export` there with that version's
  binary, `capsa import` here — and nothing here reads it directly.
- Never publish the server's port: a HelixDB server has no authentication of
  its own — loopback or a private network, an authenticating proxy where it
  must leave the host.

- Default to loopback and to least privilege: a `read,write` token for the
  client, the `admin` token only for administration, `-bundles` when the user
  names one knowledge base, `skills` only for a client that must change them.
- Say whether the backups are encrypted: an unencrypted backup is the whole
  knowledge base in the clear — a copy of the server's data directory is the
  knowledge base itself.
- Verify each step's output before moving on; when a step fails, show the
  user the exact error and the fix, not a guess.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.