Get started

Installing and upgrading

Every way to install contextlake, pip, uv, pipx, Docker, or a standalone binary, plus the extras table, upgrading safely, and a clean uninstall.

On this page

For anyone who installs, upgrades or removes contextlake.

Every way to get contextlake onto a machine, what each channel is good for, and how to upgrade or remove it later. This is the single source for install commands: other pages link here rather than repeating them, so there is one place to fix when a command changes.

Pick a channel, run one command, then jump to Quickstart for your first real result. Which channel is yours comes down to two or three questions:

flowchart TD
  S(["which install route is mine?"]) --> P{"is there a Python 3.10
or newer on the machine?"} P -->|"no"| B["the standalone binary,
or the Docker image"] P -->|"yes"| W{"installing it, or trying
it once?"} W -->|"trying it once"| U["uvx, no install at all"] W -->|"installing it"| C{"working on contextlake
itself?"} C -->|"no"| PX["pipx, its own environment
and still on your PATH"] C -->|"yes"| SRC["a source checkout
installed editable"]
a rounded box is a start or an end point a rectangle is a step or an option you can take a diamond is a decision

pip works everywhere pipx does and is the answer when you want contextlake inside an environment you already manage.

Prerequisites#

None of the channels below need a C or C++ compiler. If an install starts building from source anyway, it is a tree-sitter grammar with no wheel for your platform. It builds from its source archive, which needs a compiler. The Dockerfile grammar ([kb-dockerfile]) has no source archive, so on such a platform it fails to install. The remedy is in The knowledge layer will not install.

Pebble on a jetty, where lines of light from several directions meet at the glowing pebble: several install routes reach the same place.

Install#

pipx install "contextlake[kb-full]"
pip install "contextlake[kb-full]"
uv tool install "contextlake[kb-full]"
# or run it once, without installing:
uvx --from "contextlake[kb-full]" contextlake --help
docker run -v "$PWD:/work" ghcr.io/sayak-sarkar/contextlake doctor
# download the asset for your platform from
# https://github.com/sayak-sarkar/contextlake/releases/latest
chmod +x contextlake-linux-x86_64
./contextlake-linux-x86_64 doctor

pipx is the recommendation: it gives contextlake its own environment and still puts the command on your PATH, which is what you want for a tool rather than a library.

[kb-full] is the full bundle. A plain pip install contextlake gives you the mirror only, and it pulls exactly one dependency (argcomplete, for shell completion), so it stays viable on a locked-down machine.

However you install it, contextlake and python -m contextlake are equivalent entry points. python3 run-contextlake.py is a third one, but it only exists in a source checkout: the wheel declares a single console script and ships no top-level launcher, so it is not there after a pip, pipx or uv install.

The extras, and which one you want#

Start from what you want to do, and follow the arrow to the extra:

flowchart LR
  G(["what do you want to do?"]) --> M["mirror repositories only"]
  G --> CG["build the code graph"]
  G --> SS["search by meaning"]
  G --> OC["read text in images
and screenshots"] G --> VD["read a video"] M --> N(["no extra: the plain install"]) CG --> KB(["install [kb]"]) SS --> KF(["install [kb-full]"]) OC --> KO(["install [kb-ocr]"]) VD --> KV(["install [kb-video]"]) KV -.->|"add the spoken track"| KT(["install [kb-transcribe]"])
a rectangle is a step or an option you can take a rounded box is a start or an end point: the question, or the extra to install

A scanned PDF has no text layer, and OCR does not cover it. See Document sources.

Extra Adds When you need it
[kb] The knowledge layer: parse to graph to wiki to MCP server Anything beyond mirroring
[kb-full] [kb] plus the built-in CPU embedder and the sqlite-vec ANN backend The default choice: local semantic search with no Ollama and no API key
[kb-vec] The sqlite-vec ANN backend Faster vector search than the pure-Python exact scan
[kb-local] The built-in CPU embedder (model2vec, about 30 MB) Semantic search with no Ollama and no API key
[kb-fastembed] A higher-quality ONNX embedder (model about 67 MB). It installs onnxruntime, tokenizers, huggingface_hub and numpy, not the fastembed library Better semantic ranking, at a larger download. The vectors are the same ones the fastembed library gave, so a store built before needs no re-embed
[kb-pdf] The PDF text-layer reader for ingest (pypdf, pure Python) Design docs, RFCs and decision records that arrive as PDFs
[kb-ocr] Local OCR for ingesting images (rapidocr-onnxruntime, about 390 MB) Screenshots, exported diagrams and whiteboards. Models ship inside the wheel, so nothing is downloaded and no image leaves the machine
[kb-video] Decode a video and OCR its frames (av, about 115 MB on top of [kb-ocr]) Recorded demos and walkthroughs. av bundles ffmpeg, so there is no system package to install, and nothing is downloaded at runtime
[kb-transcribe] The spoken track of a video (faster-whisper, about 438 MB on top of [kb-video]) Recorded design reviews, where the decision is spoken rather than shown. The speech model is fetched once and cached, like [kb-local]'s embedder
[kb-dockerfile] The Dockerfile grammar Indexing Dockerfiles. Optional only because the grammar ships wheels for macOS arm64 and Linux x86_64 and no source distribution, so requiring it would break installation everywhere else. Without it, Dockerfiles are skipped and the run says so and names this extra
[llm-local] A built-in CPU model for the wiki (openvino-genai) kb wiki --llm builtin with no Ollama and no API key

[kb-ocr], [kb-video] and [kb-transcribe] need Pillow 13, which has the fixes for eight security advisories in Pillow 12. Pillow 13 needs Python 3.11 or newer. On Python 3.10 these three fail to install, because no Pillow 13 exists for 3.10. Use Python 3.11 or newer for them. See SECURITY.md.

Contributors also have [dev] (pytest, ruff, pre-commit) and [release]. See CONTRIBUTING.md.

The built-in wiki LLM is one extra#

[llm-local] is an ordinary extra. Let contextlake install it into the right interpreter:

contextlake doctor --fix llm-local     # --dry-run prints the exact command and stops

That runs pip in the interpreter contextlake is running in, and prints the command before it runs it. By hand it is:

pip install "contextlake[llm-local]"

No compiler, no wheel index and no --only-binary pin, on Linux with glibc 2.28 or newer on x86-64 (2.31 on arm64), Windows x86-64 and Apple silicon Macs. Current openvino-genai releases have no wheel for Intel Macs or for musl Linux (such as Alpine), and no source archive. The standalone binary installs it on first run, and the full Docker image ships the runtime and the 0.5B model baked in.

The model itself downloads on the first wiki run, not at install time. With no model set, that run picks a size from the free RAM and prints the download size before it starts: 349 MB (Apache-2.0) for the 0.5B, up to 8.5 GB for the largest. For which backend to choose and why, see Installing the built-in LLM.

Docker#

The published image at ghcr.io/sayak-sarkar/contextlake carries the knowledge layer plus the built-in CPU models (the embedder and the 0.5B wiki LLM), so it runs with no Ollama and no API key. Reach for it on locked-down or offline machines; the PyPI wheel stays the primary install. It runs as a non-root user.

The image holds only the 0.5B. A kb wiki run with no model set picks the largest size that fits the free RAM and does not prefer the copy on disk, so it can download a larger one. To stay on the baked model, pass --llm-model OpenVINO/Qwen2.5-Coder-0.5B-Instruct-int4-ov, set CONTEXTLAKE_OFFLINE=1, or set [llm] builtin_model to that id. See The first run picks a size.

One thing the default image does not carry is the sqlite-vec ANN backend ([kb-vec]): it is built from [kb,kb-local,llm-local]. Semantic search still works there, on the pure-Python exact scan, which is the slower path on a large store. If that matters more to you than a baked-in wiki LLM, :slim is the tag that ships kb-vec.

docker run -v "$PWD:/work" ghcr.io/sayak-sarkar/contextlake doctor
docker run -v "$PWD:/work" ghcr.io/sayak-sarkar/contextlake kb index

The -v mount is what makes the run worth doing. Everything contextlake persists, the knowledge store included, is written under it as .contextlake/, so it is still on the host after the container exits. Drop the -v and the run is ephemeral.

That bare kb index indexes the mount as one repository, which is right when you mount a repository. Mount a directory that holds repositories and it is refused, telling you to run kb index --workspace . instead (. being the mount, since that is the container's working directory). See Which command for which directory.

The container runs as uid 1000, and a bind mount keeps the host's ownership, so if your host account is not uid 1000 the write fails with a permission error. Pass your own ids:

docker run -u "$(id -u):$(id -g)" -v "$PWD:/work" ghcr.io/sayak-sarkar/contextlake kb index

It fails rather than falling back on purpose. Before 5.1.0 the store was written inside the container instead, so the run appeared to succeed and the index was gone the moment the container exited.

A :slim tag is also published, built from [kb,kb-local,kb-vec]: no openvino-genai, no baked wiki-LLM model, a smaller pull, and the sqlite-vec ANN backend the default image leaves out. Semantic search still works, because the embedder is pure Python. Point the wiki tier at Ollama, OpenAI, Anthropic or cli instead of the built-in LLM.

docker run -v "$PWD:/work" ghcr.io/sayak-sarkar/contextlake:slim doctor

The standalone binary#

If the machine has no Python at all, the release assets are self-contained launchers built with PyApp. The launcher bootstraps a private Python plus contextlake[kb-full,llm-local] into its own cache on first run, which needs network once; every run after that is instant. The openvino-genai package it installs comes from a prebuilt wheel on PyPI on each of the three platforms below, so there is no compiler to install for it and nothing for you to pass.

Three assets are published per release, one per build platform:

Asset Platform
contextlake-linux-x86_64 Linux, x86-64
contextlake-macos-arm64 macOS, Apple silicon
contextlake-windows-x86_64.exe Windows, x86-64

On Linux and macOS, chmod +x the file and run it with ./. On Windows, run the .exe directly. If your platform is not in that table, for example macOS on Intel or Linux on arm64, use pipx or uv instead; there is no binary for it.

Checking a download is the one we published#

Each launcher is signed at release time with a build provenance attestation, so you can check a download came from this repository's release workflow and not from somewhere else:

gh attestation verify contextlake-linux-x86_64 --repo sayak-sarkar/contextlake

That needs the gh CLI and no key material: the signature is verified against a public transparency log.

What it proves, and what it does not. It proves the file you have is byte-for-byte the file this repository's workflow built and uploaded. It says nothing about the Python payload, because the launcher downloads contextlake and its dependencies from PyPI on your machine at first run, which happens after any signature here. If you want the payload checked too, install with pipx or uv instead and check the release yourself. Each release publishes two supply-chain records for that install:

pip install, uv pip install and uv tool install do not check the attestation. None of them has an option for it (--help in pip 26.1.2 and uv 0.12.3 lists none), so an install from PyPI does not prove who built the wheel. To check it yourself, use the separate pypi-attestations tool. It downloads the file and its attestation from PyPI and fails if a different repository built it:

pip install pypi-attestations
pypi-attestations verify pypi --repository https://github.com/sayak-sarkar/contextlake \
  pypi:contextlake-X.Y.Z-py3-none-any.whl

Replace X.Y.Z with the release you installed. Use the .tar.gz file name to check the sdist.

The SBOM does not cover the launcher's whole payload. Its subject is contextlake[kb-full], while the launcher installs contextlake[kb-full,llm-local], so the wiki-LLM runtime and everything under it is outside what the SBOM enumerates.

From source#

git clone https://github.com/sayak-sarkar/contextlake && cd contextlake
python -m venv .venv && . .venv/bin/activate
pip install -e ".[kb]"

Contributors should use pip install -e ".[dev,kb]" and read CONTRIBUTING.md for the test loop.

Verification#

contextlake --version
contextlake doctor

--version should print the version you just installed. doctor checks the whole knowledge layer in one pass (SQLite FTS5, git and glab on PATH, config, the store's real counts, the built-in embedder, the ANN index, shard freshness) and prints a line per check.

Each configured source gets its own line, and the mark says which of three things happened. ✓ means doctor dialled it and it answered. ⚠ means doctor dialled it and it did not. ⊘ means nothing was dialled: either the type has no reachability check (gitlab, zendesk), or the source is switched off with enabled = false. None of the three changes the exit code.

Read the output, do not gate on the exit code alone. doctor exits non-zero only when the environment cannot support a run at all:

Everything else is reported and does not fail the command, including shard staleness and the optional tiers (glab, embeddings, the ANN index, the wiki model).

That matches kb lint, which deliberately keeps staleness out of its exit code for the same reason: a stale shard is a thing to act on, not a broken install, and failing a build over one would make the check unusable on any workspace mid-migration.

The consequence is worth stating plainly, because it is the opposite of what an exit code usually implies: a store full of stale shards prints a red mark for each and still exits 0. If you want a build to stop on that, parse the output or use kb lint's report, and see the upgrade section below.

A fresh machine with no store yet is expected to report a missing config as a warning, not a failure.

If doctor names something missing, contextlake doctor --fix installs it. That is the next section.

Installing what is missing#

doctor reports; doctor --fix repairs. With no value it installs only what your resolved configuration calls for, so a [llm] block that is disabled or set to ollama never pulls the local built-in runtime. Name a capability to install it regardless of config.

Flag Effect
--fix Install every missing dependency the resolved config calls for
--fix <capability> Install one: git, embedder, vectors, llm-local (embedder resolves against your config: [kb-fastembed] when engine = "fastembed", fastembed itself for another fastembed model, [kb-local] otherwise)
--dry-run (-n) Print the full plan, exact commands included, and change nothing
--skip-interactive Never prompt: privileged commands are printed, not run

Two privilege tiers, and the split is deliberate:

--fix also explains, rather than re-raising, the failures that happen: a PEP 668 externally-managed environment (use a venv or pipx), a proxy timeout, an untrusted intercepting CA, or no matching distribution. Nothing planned is ever run before it has been printed.

--fix can still exit non-zero after installing everything it planned, if the diagnostic report also found a problem --fix has no remedy for. The exit code reflects the report, not the installs.

Upgrade#

pipx upgrade contextlake                       # pipx
pip install --upgrade "contextlake[kb-full]"   # pip
uv tool upgrade contextlake                     # uv
docker pull ghcr.io/sayak-sarkar/contextlake   # image

Your store and config carry forward. Confirm with contextlake --version, then run contextlake doctor.

doctor is load-bearing after an upgrade, not a formality.

A release that changes how code is parsed leaves every existing graph shard describing the old parse. No repository's HEAD moved, so nothing about the repositories themselves signals it.

doctor compares the parser version recorded in each shard against the running one, and names the repos that are out of date. See src/contextlake/kb/cmds/doctor.py, the "shards up to date with the current parser" check.

Re-index those with a plain index run, using whichever of the two forms you built the store with:

contextlake kb index                     # one repository
contextlake kb index --workspace ~/work   # a directory of repositories

Since 5.1.0 that is enough. kb index re-indexes a repository whose recorded parser version differs from the running one even though its HEAD has not moved, and says so in the log (src/contextlake/kb/cmds/index.py, the stale_parser path). Before 5.1.0 it skipped those repositories silently and --force was the only way through, which is why older instructions insist on it.

contextlake kb index --force still exists and still rebuilds everything unconditionally. Use it when you want a full rebuild, not because an upgrade requires one.

Versioning and compatibility#

contextlake follows Semantic Versioning. From 8.0.0, no breaking change lands without a major version bump. Breaks before 8.0.0 are named in the changelog, with what to change.

Four surfaces are covered. A change is breaking when it would stop something you wrote from working:

PARSER_VERSION is not on that list. Bumping it stops nothing: your store stays readable, every command keeps running, and nothing you wrote needs editing.

A bump means that repositories indexed by an older parser carry less than the current parser would extract. So kb index rebuilds them instead of reporting them unchanged. doctor reports that as an advisory, not a fault, because a parser bump would otherwise turn every upgrade into a red check for something that works.

Parser version 14 rebuilds every store built with parser 13 or older#

PARSER_VERSION is now 14 (src/contextlake/kb/parse.py). It moved from 12 to 14 in the 10.0.0 release line: 13 in 10.0.0rc1 and 14 in 10.0.0rc5. So every store built with 9.8.3 or earlier, or with 10.0.0rc1 to rc4, reports stale, both under doctor and in kb lint's advisory line. The next contextlake kb index rebuilds all of it. A store older than that also missed the earlier bumps, and the same run catches it up on all of them. The changelog names each one.

Nothing is broken, and no flag is needed. It is one index run that costs what your first one did, once, instead of the near-instant no-op an unchanged workspace usually gets.

Budget for that before you run it inside a hook or a CI job on a large mirror.

The two latest bumps change what the parser produces:

Ids change, so after the index run:

  1. Run contextlake kb embed again if you use semantic search.
  2. Run kb connect and kb enrich again if you use them. Links they stored to a changed symbol point at the old id until then, and kb lint reports them as dangling edges.
  3. Expect kb wiki to regenerate the wiki pages for those repositories. On a hosted model, that costs model time.

An id you saved outside the store stops resolving: an MCP client that kept node ids, an eval golden set with match: "id", a dashboard #/symbol/<id> link, or a GraphML or Cypher export.

The catch: all of it lives in the parser, so it reaches an already-built store only when the shards are rebuilt.

A version bump is what makes that happen without you having to know it was needed. Every change above is invisible to a commit-keyed check. A graph carried forward untouched would keep answering with ids this build no longer produces, and every surface would keep calling it healthy.

Uninstall#

Remove the tool:

pipx uninstall contextlake                     # or:  pip uninstall contextlake
docker rmi ghcr.io/sayak-sarkar/contextlake    # if you pulled the image

That leaves your data in place. contextlake never writes inside your repositories, so uninstalling it cannot touch your source. To also remove what it created, delete only what you do not want to keep:

rm -rf ~/.contextlake        # store, kb.toml, downloaded CPU models, graph/wiki exports
rm -f  ~/.contextlake.ini    # mirror config
rm -rf ~/.cache/contextlake  # the mirror's repository-list cache
# your mirrored repos live in your work_dir (default ~/work); delete only if unwanted:
# rm -rf ~/work

~/.cache/contextlake is only the default. If XDG_CACHE_HOME is set in your shell, the cache is at $XDG_CACHE_HOME/contextlake instead, so remove that path:

rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/contextlake"

~/.contextlake covers the built-in CPU models too: they download to ~/.contextlake/models (DEFAULT_CACHE_DIR in src/contextlake/kb/embeddings/builtin.py and src/contextlake/kb/llm/builtin.py), which is a sibling of the store rather than a separate cache elsewhere in your home directory.

Two leftovers a package manager cannot remove for you:

Install scenarios#

Real setups and the exact command for each.

Your situation Command
"Just mirror my repos, nothing else." pipx install contextlake
"Full knowledge layer, zero config." pipx install "contextlake[kb-full]"
"Try it once without installing anything." uvx --from "contextlake[kb-full]" contextlake kb index --source .
"Upgrade to the latest." pipx upgrade contextlake, or pip install -U "contextlake[kb-full]"
"No compiler, and a source build just failed." pip install -U --only-binary :all: "contextlake[kb-full]"
"I want the built-in wiki LLM, installed with pip." contextlake doctor --fix llm-local
"I don't want a local toolchain at all." The standalone binary, or docker pull ghcr.io/sayak-sarkar/contextlake

The flags worth knowing when you write one of these by hand:

See also#

Next steps