Repository navigation
Posit Assistant Can Now Drive Positron #16280
jmcphers
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Today, Posit Assistant in Positron works primarily via lower-level tools. They operate at the R/Python and shell level: reading your files, writing code, and running that code in your console. But a lot of your day in Positron isn't just running code; you might be opening a dataset in the Data Explorer, switching between your R and Python sessions, starting a Shiny app, or reading a database schema to formulate your next hypothesis.
With the daily build of Positron and latest release of Assistant, Posit Assistant can do those things too. We're introducing a new preview feature which teaches Assistant how to operate Positron itself, not just the R or Python session inside it.
What you can ask for now
Here are some things you can now just ask for in the chat.
"Are any packages out of date? Check for any installed packages with known CVEs." The assistant reads your session's package list straight from Positron. That includes installed versions, available updates, and known security advisories (from Posit Package Manager). It can also install or update packages when you ask.
"Set up a Python environment for this project." The assistant can install Python if you don't have it yet, then create a venv, Conda, or uv environment and register it with Positron so it's ready to use.
"Run my Shiny app." The assistant starts Shiny, Streamlit, Dash, Flask, FastAPI, Gradio, and marimo apps the same way the Run button does. The app appears in the Viewer, or wherever your preview settings send it.
"Open sales.parquet." The assistant opens the file in the editor Positron would pick for it. CSV, TSV, Parquet, and Excel files open in the Data Explorer, and notebooks open in the notebook editor.
"What tables are in my warehouse?" The assistant can see the connections you've set up in the new Data Connections pane, connect to one, and look through its tables and columns. Then it can write a query that uses your real table and column names instead of guessing.
"My session is stuck." The assistant can interrupt a long-running computation, or restart the session if that's what's needed. It will tell you before it does anything that throws away your variables.
"Deploy this to Connect." If you have the Posit Publisher extension, the assistant can work out what kind of content your project is, deploy it to Posit Connect or Connect Cloud, and pull the logs if a deployment fails.
"Which features do I have in preview?" or "Why isn't my setting working?" The assistant can read your actual Positron configuration and your AI provider setup, and answer from that.
It can also handle smaller things: switching to the four-pane or notebook layout, bringing up the Variables or Plots pane, clearing the console, or showing help for a function in the Help pane.
Why this is better than "just running code"
You might wonder why this matters, since a capable assistant could already try most of these tasks with code and terminal commands. It could, but the process was clumsy, and the results could be wrong.
Positron's environment is now the source of truth. On systems with a lot of interpreters and environments, commands executed directly from shells don't necessarily have the same libraries, modules, etc. as you have chosen to use with your Positron project, so it's possible for Assistant be working with different state than what actually exists in your Positron project. The new skill gets your questions answered using the same source of truth as the Packages pane, the Console, and the rest of Positron's UI.
Positron knows things shells don't. Positron knows about every Python and R environment you have installed on your system, and how each one should be configured. This info can be used to guide project configuration and management, and would take an agent many turns to gather on its own (presuming it was motivated to do so in the first place!).
It sees things your code can't. Connections you set up in the Data Connections pane are stored in Positron, not in your R or Python session. An assistant that could only run code would look for them, find nothing, and confidently tell you that you have no connections. Now it can see them, and it can browse their schemas before writing a query.
Files open where they belong. Asking to "look at" a CSV used to mean the assistant read the raw text into the chat. Now it can open the file in the Data Explorer, where you can sort, filter, and look at column summaries.
It answers from your setup, not the docs. Questions like "what's in preview?" or "which providers am I signed in to?" depend on your install. Before, the assistant might search release notes, or read a settings file from a path that's wrong on Posit Workbench. Now it asks your running copy of Positron.
It stays in sync with your version of Positron. The assistant's knowledge of these commands is generated from the copy of Positron you're running. When Positron updates, it updates too.
How to turn it on
This is a preview feature, so it's off by default. To turn it on:
You will also need a daily build of Positron to use this feature.
The next time you ask Posit Assistant for something, it will have these new abilities. (If you've already turned on Assistant: Experimental Features, you have them already, since experimental includes preview.)
A few notes:
Give it a try and let us know what you think!
All reactions