Skip to content

AI Chat and Actions

Virgile Thonnier edited this page Jul 17, 2026 · 2 revisions

AI Chat & Dry-Run Actions

The chat panel is a retrieval-augmented assistant scoped to your files, with a strict safety model for anything that touches disk: the AI proposes, you decide.

Two modes, one chat

The assistant follows a format rule baked into its system prompt:

  • Question / analysis → a normal text answer, citing relevant files by name (grounded in your index).
  • Action request (move, rename, delete, tidy, create a folder) a structured plan only, as JSON:
{
  "summary": "",
  "operations": [
    { "kind": "move|rename|delete|mkdir", "old_path": "", "new_path": "", "reason": "" }
  ]
}

The model must use exactly the paths present in the folder structure it's given — it can't invent paths. For reorganizations it reasons over the directory tree supplied in-context.

The Dry-Run safety model

When the assistant returns operations, SenseTree renders an Action Plan card: an interactive Before → After diff of every move/rename/delete/mkdir, each with the AI's stated reason. Then:

  • Approveapply_action_plan executes the plan.
  • Discarddiscard_action_plan throws it away.

Nothing is written to disk until you Approve. The plan is first recorded as a draft in the transaction log; no std::fs change happens at planning time.

Transactional apply with rollback

On Approve, operations run one by one and each success is journaled. If any operation fails (e.g. a file is locked), SenseTree rolls back the ones already done (inverse operations), leaving your disk as it was. After a successful apply it also updates the index — renames update LanceDB paths without re-embedding (Index Sync), and deletes remove vectors — then commits.

Related commands

Command What it does
chat_with_assistant Q&A / action chat, retrieval-augmented over your index.
plan_reorganization Build a reorganization plan for a scope from an instruction (draft only).
apply_action_plan Execute an approved plan transactionally, with rollback.
discard_action_plan Drop a pending plan.

Tips

  • Be specific about scope. Open the folder you want the assistant to reason about; it plans over that structure.
  • Read the reasons. Each operation carries a rationale — a quick sanity check before Approve.
  • Reasoning model quality matters. Strict-JSON, path-faithful behavior is easier for solid instruction-following models. If plans are malformed or invent paths, try a better reasoning model or tighten the prompts.

Clone this wiki locally