| name | cognee-switch-datasets |
| description | Use when the user wants to switch this Codex session to another Cognee dataset, see which datasets are available, or move memory capture to a different dataset. Syncs the current session first, then starts a fresh Cognee session bound to the chosen dataset. |
Switch Datasets
Move this Codex session to a different Cognee dataset. A Cognee session never
spans two datasets, so the switch retires the current session (after syncing
it into the graph) and starts a new one on the chosen dataset. All later saves
and recalls target the new dataset; the in-context status line shows it.
Rules
- Never guess a dataset name: list first unless the user named one.
- Only offer datasets the listing returns — read-only ones are already filtered out.
- Do not pass
--force unless the user explicitly accepts that unsynced entries of the current session are retried at session end instead.
Instructions
1. If the user named a dataset, switch directly
python3 "${CODEX_PLUGIN_ROOT}/scripts/switch-dataset.py" "<name>" --json
2. Otherwise, list and let the user choose
python3 "${CODEX_PLUGIN_ROOT}/scripts/switch-dataset.py" --list --json
The JSON has current, datasets ([{name, id, writable, current}]),
hidden_readonly (datasets you can read but not write — never offered) and
filtered (true when write access was verified for every row).
Codex has no interactive picker outside plan mode, so present a numbered
list of the dataset names (mark the current one) and ask the user to reply
with a number or a name. If is , say that write access could
not be verified. When the user answers, run the switch with the chosen name: