Skip to content

datasette-agent 0.2a0: Tools Can Now Pause and Ask You Questions Mid-Run

Simon Willison's datasette-agent 0.2a0 lets tools ask users yes/no, multiple-choice, or free-text questions mid-execution, with conversations that survive server restarts.

Simon Willison’s datasette-agent 0.2a0 ships a feature most agentic frameworks still lack: tools that can pause mid-execution, ask the human a question, and resume once they answer.

The core additions:

  • ask_user() for interactive tools — Any tool declaring a context parameter receives a ToolContext object. Calling await context.ask_user(...) suspends the agent turn and renders a form in the chat UI. Supports yes/no, multiple-choice (options=[...]), and free-text (free_text=True) inputs.
  • Conversations survive restarts — Unanswered questions persist to the internal database. A suspended conversation picks up exactly where it left off after a server restart.
  • Replay-safe execution — When the user answers, the tool re-executes from the top with stored answers replayed. The docs are explicit: call ask_user() before performing side effects.
  • save_query built-in tool — The agent can save SQL it wrote as a Datasette stored query. Every save requires human approval — the agent shows the full SQL, proposed name, database, and visibility before anything is stored.

The interaction model here is worth paying attention to. Most agent loops treat tool calls as fire-and-forget — the LLM decides, the tool runs, results come back. Willison is building a pattern where the tool itself can gate on human input, which makes approval workflows (like saving a query) a natural part of the agent’s capabilities rather than bolted-on guardrails.

NOTE

The ask_user() feature was built on top of a new LLM alpha Willison created the day before, with assistance from Claude. The datasette-agent ecosystem also recently added MicroPython in a WASM sandbox as a tool (datasette-agent-micropython 0.1a0, released June 2).

Alpha release, installable now. The 0.2a0 version tag means expect rough edges, but the human-in-the-loop primitives — persistent questions, replay-safe execution, mandatory approval for writes — are concrete enough to build on.