Omics-OSDocs
Guides

Optional: LaminDB catalog

Record sessions, saved datasets and exported notebooks in a LaminDB catalog inside your workspace. Off by default.

Available from Lobster AI 1.3.0.

What it does

When the catalog is on, Lobster records its work in a LaminDB catalog as it goes:

  • each session,
  • each dataset you save,
  • each notebook you export.

By default the catalog is a local SQLite database inside your workspace, so it needs no account, no server and no network.

The catalog is off by default. With it off, Lobster behaves exactly as it does without the extra installed.

Install

The catalog needs the lamin extra:

# uv tool
uv tool install --python 3.12 'lobster-ai[lamin]'

# in a virtual environment made with uv venv
uv pip install 'lobster-ai[lamin]'

Or let lobster init do it. lobster init ~/my-study --lamin installs the extra where Lobster runs (under uv tool or in a virtual environment) and switches the catalog on for that project. Then cd ~/my-study: Lobster finds the project from the folder you run it in. --skip-extras skips the install. Installing by hand under uv tool, list the --with packages again, because the command replaces the tool's environment.

The extra installs lamindb-core (not the full lamindb package) and pandera. It is not part of [full] or [all]; request it explicitly.

  • Dependency change: a LaminDB dependency requires websockets below 16, so installing the extra moves websockets to 15.x in that environment.
  • Upgrades: uv tool upgrade --python 3.12 lobster-ai keeps the extras you installed. If you upgrade with pip in a virtual environment, include [lamin] again.

Turn it on

Set LOBSTER_LAMIN to 1 (also accepted: true, yes, on). The first setting found wins:

  1. your shell environment: export LOBSTER_LAMIN=1
  2. the workspace's .env file: LOBSTER_LAMIN=1
  3. the global Lobster config: "lamin_enabled": true in providers.json. On Linux and macOS that is $XDG_CONFIG_HOME/lobster/providers.json when XDG_CONFIG_HOME is set, otherwise ~/.config/lobster/providers.json; on Windows, %APPDATA%\lobster\providers.json.

A value in your shell wins over the workspace .env in both directions: LOBSTER_LAMIN=0 in the shell turns the catalog off for a workspace whose .env turns it on. LOBSTER_LAMIN=0 at any level turns it off, even when a lower level turns it on.

With the catalog off, a Lobster session does not import LaminDB and creates no .lamindb folder. lobster lamin status and lobster lamin ls still read an existing workspace catalog, so you can look at what was recorded.

You can set it in three ways:

  • lobster init asks whether to keep a LaminDB catalog (the answer starts at the workspace's current setting, which is No for a new workspace) and writes LOBSTER_LAMIN to the workspace .env. A new .env is created readable only by you. Without a prompt, use lobster init --lamin or --no-lamin. With --global, the answer goes to lamin_enabled in the global config instead. Running lobster init again keeps the setting unless you change the answer.
  • lobster lamin init turns it on for one workspace and creates the catalog (see Commands).
  • By hand, in the shell, the .env or providers.json as above.

If the catalog is on but the lamin extra is not installed, Lobster logs a warning and runs without recording.

Where the catalog lives

By default each workspace gets its own catalog in <workspace>/.lamindb/:

PathContents
.lamindb/lamin.dbThe catalog (SQLite)
.lamindb/settings/LaminDB's settings for this catalog
.lamindb/lobster.jsonThe catalog's instance name, used to reopen it
.lamindb/storage_uid.txtLaminDB's storage mark for this catalog
.lamindb/versions/Older versions of files you saved again under the same name, at versions/<key>/v<version><suffix> (for example versions/data/proc.h5ad/v0000.h5ad)
.lamindb/cache/LaminDB's cache, once it caches something, unless you set LAMIN_CACHE_DIR

The workspace catalog registers your files where Lobster wrote them. It does not copy the current version anywhere.

Lobster does not change your own LaminDB setup:

  • your ~/.lamin directory is untouched;
  • your default LaminDB instance is untouched;
  • no .lamin marker is written to your current directory.

The instance is named anonymous/lobster-<folder>-<6 hex>: <folder> is the workspace folder name, lower-cased, with other characters replaced by - (at most 30 characters), and <6 hex> comes from a hash of the workspace's absolute path. The owner is always anonymous: the catalog keeps its own LaminDB settings in .lamindb/settings/, so a lamin login in your own settings does not apply to it, and with LAMIN_API_KEY set in your environment the workspace catalog still does not log in.

What is recorded

Lobster actionRecorded as
A chat or query sessionA run, named after the session ID, with start and finish time, status and Lobster version (see How a run ends)
A lobster command … invocationA run of its own
Saving a dataset (AnnData or MuData) inside the workspaceAn artifact, keyed by its path relative to the workspace (for example data/proc.h5ad) and linked to the run that saved it. A save to a workspace path outside data/, such as <workspace>/results/x.h5ad, is written under data/ (data/results/x.h5ad), as without the catalog, and recorded there
Loading a file whose content the catalog already recordedThat artifact is linked as an input of the current run
Creating a data packageAn artifact
Exporting a notebookA transform of kind notebook, with the notebook's source. Exporting again under the same name makes a new version of the same transform (each export carries its own creation time)
The end of a runThe run's environment and its step log (see below)

How a run ends

A run ends the way its command did:

  • completed only when the command succeeded.
  • errored when it failed. The reason is the exit code or the error class, for example [exit code 1] in lobster lamin ls --runs, and end_reason in --json.
  • aborted when it was stopped by Ctrl-C, a cancelled MCP turn or SIGTERM.
  • not finished when the process ended without saying how, for example when it was killed, or a turn was still running. The run stays open: ls --runs shows not finished, and in --json the status is LaminDB's started and finished_at is null.

A chat ends as its last turn did; a chat with no turn is completed. Switching sessions inside a chat does not complete the run it leaves.

Runs from the Textual dashboard, Lobster used as a Python library, and an MCP run left waiting for an answer when the server stops are shown as "not finished", also when they ended normally.

Lobster recognises files by content. A save whose bytes the catalog already holds adds no new record:

  • the same bytes as an earlier version of the same name bring that version back: it becomes the file at the name again, and the latest;
  • the same bytes under a different name are not recorded again while the first file is intact.

Versions

Saving again under a name that already holds a recorded version creates a new version of the same key:

  • The file name always holds the newest data. For example, data/proc.h5ad is the latest save.
  • The previous bytes are kept in .lamindb/versions/. Right before Lobster overwrites the file, it keeps the old bytes there (a hard link when the file is replaced, otherwise a copy), and they stay in the catalog as an earlier version of that key. Copies take disk space. Exactly one version of each key is marked as latest: the one the file name holds, as long as every save was recorded.
  • When a version cannot be kept. If the file was changed outside Lobster, it is overwritten as usual and the older records are marked as no longer on disk. If the catalog does not answer within about 5 seconds, the save goes ahead unrecorded: the previous bytes are not kept, and the latest record is marked as no longer on disk. A save made while the catalog is still starting is recorded once it is ready, but the previous version is not kept. The marks show in the notes column of lobster lamin ls.
  • Lobster sees one dataset. Your data/ folder and the dataset list show proc once.

Deleting .lamindb/ deletes the catalog and the earlier versions kept in it. The current files in your workspace stay.

Environment

The first time a run ends in a process, the catalog records the run's environment:

  • the installed packages, as name==version, sorted;
  • the Python version, the platform and the Lobster version.

It lists versions only, no paths. An editable install shows the version it was installed at, not later edits to its files. A package whose metadata cannot be read is left out. Later runs of the same Lobster version in that process reuse the record, so a package you install during a session is not seen.

Runs with the same environment share one record. The file is <workspace>/.lobster/environments/<hash>.txt.

Step log

When a run ends, a copy of the session's provenance.jsonl, as it was at that moment (up to its last complete line), is recorded as the run's report, at <workspace>/.lobster/reports/<run id>.jsonl. When you switch to another session in the same process, the run you leave ends with its own step log.

  • Size limit. A log above 8 MiB is not copied, and Lobster logs why.
  • Secrets scan. The log can hold tool parameters, file paths and the code a tool ran, so Lobster first scans it for text that looks like a secret: AWS access keys (including temporary ones), sk- and Anthropic keys, GitHub personal access tokens (ghp_, github_pat_), Slack tokens, private-key headers, bearer tokens, and key=value assignments of names such as api_key, secret_key, access_token, password or secret.
  • On a match, nothing is copied and the run has no report. Lobster logs which kind of pattern matched, never the text. The log in your workspace is not changed.
  • The scan works on patterns. It can miss a secret that matches none of them, such as a short password or one with spaces. It can also refuse a log that holds no secret: the key=value pattern reads the name, not the value, so a line of code such as token = tokenizer.encode(text) counts too. Rename the variable, or accept that the run has no report.

Exported notebooks

The same scan runs on a notebook's source before it is recorded. On a match, the notebook is not recorded, the file in your workspace is unchanged, Lobster logs which kind of pattern matched, and the run keeps a list of the notebook keys it refused. The same false matches apply (token = tokenizer.encode(text) or password = getpass.getpass()): rename the variable, or keep that notebook out of the catalog.

Where these records show

The environment and the step log are kept as LaminDB's own run records. They are hidden from lobster lamin ls and from the file counts in lobster lamin status. lobster lamin ls --runs shows which ones each run has (see Commands).

What is not recorded

  • Autosaves. Lobster's automatic saves overwrite one file per dataset on purpose and are never recorded.
  • Remote storage. Saves through a non-local storage backend, such as S3, are not recorded.
  • Files outside the workspace. The catalog only records files inside the workspace it belongs to.
  • Files Lobster loads but did not save. For example, the raw input files you placed in the workspace are not added.
  • The conversation. Prompts, model output and tool messages are not recorded. The step log does hold each tool call's parameters, file paths and any code it ran.

Using your own LaminDB instance

To record into an existing LaminDB instance instead of the workspace catalog, set:

export LOBSTER_LAMIN=1
export LOBSTER_LAMIN_INSTANCE=<owner>/<instance>

LOBSTER_LAMIN_INSTANCE can also go in the workspace .env.

If LAMIN_CURRENT_INSTANCE is set in your environment, Lobster uses that instance too. Unset it if you want the workspace catalog.

With a named instance, Lobster connects with your own LaminDB settings:

  • Saved files are copied into that instance's storage, at <storage root>/lobster/lobster-<folder>-<6 hex>/<key>/<hash><suffix> (the same name a workspace catalog would get), and recorded there. The copies are named by content hash, not by version. Saving bytes that instance already holds copies nothing. The file in your workspace is not changed, and there is no .lamindb folder in the workspace.

  • Network: an instance with local storage works offline. LaminDB contacts Lamin's servers (lamin.ai) only if the instance is registered there, as it does for any of its users, or to look up an instance that is not set up on this machine (see below). LaminDB also creates ~/.lamin if needed and may update its own settings there.

  • Only local storage is supported in this release. An instance whose storage is remote, such as S3, is not recorded into. For an instance set up on this machine, Lobster reads the storage location from its settings file and refuses it before connecting, so this works offline; otherwise it refuses it right after connecting. Lobster logs why.

  • Set the instance up on this machine (its LaminDB settings file). If it is not set up here, LaminDB looks it up on Lamin's servers (for an owner other than anonymous); Lobster records into it only if LaminDB can then connect and its storage is local. Otherwise nothing is recorded, and Lobster logs that the instance is not set up on this machine.

  • Step log: after the scan, the run's step log is copied into the instance's storage too, at <storage root>/lobster/<catalog name>/reports/<run id>.jsonl, where the catalog name is the same lobster-<folder>-<6 hex> name the workspace catalog uses.

  • Environment: not recorded in a named instance in this release.

Lobster logs a warning naming the instance when it connects. Two Lobster processes saving the same new bytes at the same moment may each make a copy and a record; both hold those bytes.

Making a local instance

If you have no LaminDB instance yet, make a local one with LaminDB's own command line, then point Lobster at it:

lobster init ~/my-study --lamin        # skip if your project already exists
cd ~/my-study
uv tool install --python 3.12 "lamin-cli==1.22.0" --with "lamindb-core>=2.12.2,<2.13"
lamin init --storage ~/lamin-data
lobster lamin use anonymous/lamin-data
lobster lamin status

These versions match the LaminDB that Lobster 1.3.0 ships with; the latest lamin-cli can install a pre-release of LaminDB. Run lamin init in your project folder, not in your home folder, where it stops with an error. It writes a small .lamin/ folder into the folder you run it in; the database itself goes into the storage folder.

The instance is named after the storage folder, here anonymous/lamin-data. lobster lamin status should say Records go to the LaminDB instance anonymous/lamin-data.

Commands

lobster lamin manages the catalog of one workspace. Every command takes -w/--workspace <path> (default: $LOBSTER_WORKSPACE when set, otherwise ./.lobster_workspace).

CommandWhat it does
lobster lamin statusWhether the catalog is on and where that setting comes from (environment variable, workspace, global settings or default; env, workspace, global or default in --json), where records go, and whether LaminDB is installed. When the workspace catalog exists, it also shows its instance name, how many files, sessions and notebooks it holds, and the last session.
lobster lamin lsThe files in the catalog in use, newest first, one line per version, with * on the latest version. --runs lists the sessions instead, with each run's status (completed, errored, aborted or not finished), how many files each one saved and loaded, and one bracket group naming the end reason of a run that did not complete and the records the run has: [report, environment] for both, [environment] for the environment alone, nothing for neither. -n/--limit sets the number of rows (default 50).
lobster lamin pruneRemoves the kept copies of earlier versions from the workspace catalog's version store; the records stay, marked as not kept. --dry-run shows what would go, --yes skips the question, --json prints the result. status shows the size of what it would remove.
lobster lamin initTurns the catalog on for this workspace (LOBSTER_LAMIN=1 in its .env) and creates the workspace catalog now. If another Lobster process is writing to the catalog, it waits for it. Running it again keeps the same catalog. With LOBSTER_LAMIN=0 in your shell, it still writes the workspace setting but creates nothing, and says that the shell keeps the catalog off.
lobster lamin use <instance>Records this workspace into your own LaminDB instance instead (LOBSTER_LAMIN_INSTANCE in the workspace .env). <instance> is owner/name, a https://lamin.ai/owner/name URL, or the storage folder of a local LaminDB instance. It does not turn the catalog on.
lobster lamin use --clearGoes back to the workspace catalog.

status and ls also accept --json for machine-readable output; in ls --json, file is where each version's file is, relative to the workspace. In ls --runs --json, each row has status, end_reason (the reason when the run did not complete), report and environment (true or false); last_run in status --json has the same two keys.

status, ls, ls --runs and prune read the catalog in use: the workspace catalog, or, after lobster lamin use, your named instance. With the workspace catalog these commands work offline. A named instance is opened the way recording opens it (see Network and the two bullets above); status, ls and prune exit with code 1 when it cannot be opened. With --json, status gives the reason in problem. ls also exits with code 1 when the workspace has no catalog yet and no instance is set.

With your own instance set, status shows the setting (mode and instance) and the instance's counts of files, sessions and notebooks, and ls lists the instance's files (ls --runs its sessions). prune on an instance finds nothing to remove: the instance holds saved files by content hash, not as kept copies of earlier versions, so every saved version stays in the instance's storage; prune does not remove it. lobster lamin use --clear goes back to the workspace catalog. For anything else, browse your instance with LaminDB's own tools.

lobster lamin init
lobster lamin status
lobster lamin ls
lobster lamin ls --runs

Replay limit

A replayed custom-code cell reads the notebook's own results and writes into the replay's folder, not the session's workspace. When a session loaded its data through custom code (for example, several 10x folders combined by the model), a cell that reads a file outside the replay's folder by its absolute path is refused before the run (REFUSED), and one that reads a workspace file by a relative path through pandas, open() or numpy stops the replay (NOTEBOOK_FAILED). To replay with the input checked and named, load data with Lobster's import (a GEO accession or a single file). See Re-run an exported notebook.

Browse the catalog

For a quick look, use lobster lamin status and lobster lamin ls. The catalog is also a regular LaminDB instance. To read it with LaminDB's Python API, point LaminDB at the workspace's settings. Take the instance name from .lamindb/lobster.json.

cd my_workspace
export LAMIN_SETTINGS_DIR="$PWD/.lamindb/settings"
export LAMIN_CACHE_DIR="$PWD/.lamindb/cache"
export LAMIN_CURRENT_INSTANCE="anonymous/lobster-my-workspace-1a2b3c"  # from .lamindb/lobster.json

python -c "
import lamindb as ln
print(ln.Run.to_dataframe())
print(ln.Artifact.filter(key='data/proc.h5ad').to_dataframe())
print(ln.Artifact.get(key='data/proc.h5ad', is_latest=True).path)
"

This works offline. The connect command of the lamin command-line tool contacts Lamin's servers even for a local catalog, so use the Python API when you are offline.

Behaviour notes

  • Lobster keeps working if the catalog fails. A single catalog call that fails is skipped and logged once. If the catalog cannot start, takes more than two minutes to start, or does not answer within 30 seconds, Lobster continues without recording for the rest of that process and logs the reason.
  • LaminDB already loaded. If Python code imported LaminDB with other settings before Lobster started, the workspace catalog is not used for that process, and Lobster logs why.
  • LaminDB's log lines go to stderr, not stdout, so they do not appear in the output of lobster command … --json.
  • Short commands. A command that finishes while its catalog is still starting waits for it, up to 10 seconds in total. If the catalog has not finished starting by then, the run is not recorded and the command exits.
  • One catalog per process. A process records into one workspace's catalog. A second workspace opened in the same process is not recorded.
  • Several Lobster processes can share a workspace. Writes to the workspace catalog are serialized with the lock file <workspace>/.lobster/catalog.lock. A recorded save holds it from keeping the previous version until the new file is recorded, so two processes saving the same file do not record each other's bytes. A save waits at most about 3 seconds for another process's lock; after that it goes ahead unrecorded.

On this page