Positron Assistant
The Positron Assistant is currently an experimental feature in Positron, available in 2025.06.0-167 and beyond. We are actively improving the user experience and functionality, so please provide feedback and report any issues you encounter.
Positron Assistant is an AI client that provides LLM integration within Positron, both for chat and for inline completions. Use Positron Assistant to generate or refactor code, ask questions, get help with debugging, and get suggestions for next steps in your data science projects.
Why use Positron Assistant over other AI clients?
The Positron Assistant offers novel data science and Positron-specific context compared to other IDE AI tooling. We provide a data-science-centric IDE for the user and allow the LLM to interact with the most important parts of Positron to get better context for better results!
A majority of data science work happens interactively with live data during development. Users load local or remote data, seek to understand it via cleaning, transformations, visualizations, and then modeling, then ultimately generate reproducible code. While the full code on disk is the ultimate source of truth and gives you the ability to reproduce the results, the ephemeral state is where a data scientist is actually working the majority of the time. As such, existing AI clients that only have access to the code on disk are limited in their ability to provide useful suggestions and context-aware completions for data science.
We use tool-calling heavily within Positron to allow the LLMs to directly interact with Positron’s novel data science features. We have built out key integration points that allow the LLM to parse and interact with the current state of the Positron IDE, and will continue to expand these capabilities over time.
A few examples of these integration points include Positron’s:
- Variables pane, providing names, dimensions, and column names of dataframes and Python/R based database connections, as well as metadata for arrays, lists, and other objects in memory
- Plots pane for describing the current plot or suggesting variations and next steps for iterating on the current plot
- Console, available to the model for viewing inputs and code outputs, as well as allowing the user or an AI agent to execute code in the console and view the output
- Session state, providing what language is active in the console session (R or Python, including version), what packages are loaded, and what packages are installed
All of that Positron-specific context is in addition to the core capabilities of what traditional software-oriented GenAI clients have (active files, selected lines of code, files in project, training data in the model, etc).
Get started
The general steps to use Positron Assistant are:
Enabling Positron Assistant
Positron Assistant is not enabled by default. Follow these steps to enable it:
Opt in to the
positron.assistant.enable
setting.Restart Positron or run the Developer: Reload Window command in the Command Palette.
Positron Assistant is now enabled!
Click on the chat robot icon in the sidebar, or run the Chat: Open Chat in Sidebar command in the Command Palette to open the chat.
Configuring Positron Assistant
Currently, Positron Assistant uses a bring-your-own API key model for Anthropic, so you’ll need to get keys set up ahead of time and bring those into Positron. GitHub Copilot uses an OAuth flow for authentication, so you will need to have a GitHub account with Copilot enabled.
- Chat model providers: Anthropic Claude is available for sidebar chat and inline chat.
- Inline code completion model providers: only GitHub Copilot is available. Positron’s status bar will show registered inline code completion providers in the robot icon tooltip in the bottom-right of the Positron window.
If you don’t already have API keys or an account for these providers, see the Language Model Provider API Keys section below for instructions on how to get them, before continuing with the steps below.
Managing language model providers
Anthropic and GitHub Copilot are the currently supported language model providers for Positron Assistant. Anthropic Claude is available for sidebar chat and inline chat, while GitHub Copilot is available for inline code completions only.
Adding language model providers
Run the Positron Assistant: Add Language Model command to open the language model provider dialog. You can also click the “Add Language Model provider” button in the Positron Assistant chat area (note: the button may be collapsed within the
...
context menu).Select the model provider you want to add and authenticate with the API key or OAuth flow as required by the provider.
Once authenticated successfully, the “Sign in” button will change to “Sign out”, and available models from the provider will be registered.
Click the “Done” button once you have added all the desired model providers. You can always come back to this dialog later to add or remove providers.
Removing language model providers
Run the Positron Assistant: Add Language Model command to open the language model dialog. You can also click the “Add Language Model” button in the Positron Assistant chat area (note: the button may be collapsed within the
...
context menu).Select the model provider you want to remove.
Click the “Sign out” button to remove the provider from Positron Assistant.
Click the “Done” button to close the dialog.
Using Positron Assistant
Chat pane
Click on the chat robot icon in the sidebar, or run the Chat: Open Chat in Sidebar command in the Command Palette to open the chat.
Positron Assistant’s Chat pane (in the Activity Panel by default) has access to your R and Python console session inputs/outputs, as well as in-memory objects and dataframes as available in the variables pane. Assistant can look at the Plots pane too, if instructed. The user can attach files via the @ icon or drag files as attachments to ask questions about specific files.
Code generated by Assistant can be run in the Console, copied to the clipboard, or sent to the Editor via controls attached to code output blocks.
Slash commands
Slash commands provide quick access to common tasks without writing long prompts. Start by typing / in the chat box to see available commands. For example, the /quarto
command converts the current chat conversation into a Quarto document.
Chat participants
Assistant’s Chat pane (in the Activity Panel by default) has access to your R and Python console session inputs/outputs, as well as in-memory objects and dataframes as available in the variables pane. Assistant can look at the Plots pane too, if instructed. The user can attach files via the @ icon or drag files as attachments to ask questions about specific files.
Chat participants provide specialized knowledge to the Positron Assistant. You can add a chat participant by typing @
in the Chat pane plus the chat participant name. Please reference the Shiny Assistant section for more information on the use of a Shiny chat participant.
Inline chat
The command Inline Chat: Editor Inline Chat (default keybinding: Cmd + I) will open a mini chat right in the editor. This is very useful for asking questions in context, and also includes a good UX for integrating changes suggested by the model.
Completions
If GitHub Copilot is enabled and the user pauses typing for a few seconds, Positron Assistant will offer completions in most contexts. If it is not working, check the following:
- Make sure you have a language model provider added for completions.
- Check the developer tools console logs to see if there are any errors logged.
Shiny Assistant
The Shiny Assistant is a chat participant available within Positron Assistant that provides context-aware assistance for developing Shiny applications in Python or R. It can help you with tasks such as generating Shiny UI components, server logic, and reactive expressions.
The Shiny Assistant enhances the default prompt with additional information about Shiny that we have found improves the quality of generated apps and Shiny components. It is also kept up to date with the latest Shiny features and best practices, in a way that is not practical with foundation models or fine-tuning.
The Shiny Assistant is available in the chat once you have installed the Shiny extension. Like other chat participants, Shiny Assistant can be invoked by typing @shiny
in the chat pane or inline chat, followed by your question or request related to Shiny development.
Language model provider API keys & authentication
Since you may need to access these API keys multiple times, we recommend storing them in a password manager such as 1Password, or another secure location.
Anthropic Claude
If you have an Anthropic account, you should be able to get an API key from the Anthropic Console on the admin keys page.
- Claude 3.5 Sonnet v1
- Claude 3.5 Sonnet v2
- Claude 3.7 Sonnet
- Claude 4 Sonnet
- Claude 4 Opus
Copy and save the API key to a password manager or another secure location. This key will be used to authenticate to Anthropic in the language model dialog.
GitHub Copilot
If you have a Github account with Copilot enabled, you can authenticate to GitHub Copilot in Positron Assistant in the language model dialog. The authentication flow will open up a browser and direct you to sign into Github. Once authenticated, Copilot will be available for inline code completions only.
Support and terms of service
Posit does not provide support or assistance for any code written or generated in Positron, with or without Positron Assistant via any model provider. Posit does not support the Anthropic or GitHub Copilot output, or test the logic used by either to generate code from prompts.
Anthropic
Anthropic Claude is considered “Third Party Materials” as defined in the Posit End User License Agreement and subject to the Anthropic Terms of Service and Privacy Policy. Anthropic Claude is considered “Third Party Materials” as defined in the Posit End User License Agreement and Posit assumes no liability or other obligations with respect thereto and, without limiting the foregoing, is not liable for any loss or damage resulting from the use or access thereof.
GitHub Copilot
GitHub Copilot is a proprietary tool from GitHub. If you want to use GitHub Copilot, you need a subscription for GitHub Copilot in your personal GitHub account or to be assigned a seat by an organization with a subscription for GitHub Copilot for Business. Individual snippets of source code or the contents of entire files may be sent to GitHub’s servers to generate suggestions, for more information about how this information is handled, please see the Copilot Privacy Statement. If you have a Github account with Copilot enabled, you can authenticate to GitHub Copilot in Positron Assistant via the language model dialog. The authentication flow will open up a browser and direct you to sign into Github. Once authenticated, Copilot will be available for inline code completions only. Students and faculty can use GitHub Copilot for free as part of the GitHub Education program. For more information, see the GitHub Education page.
By using GitHub Copilot, you acknowledge that your use of GitHub Copilot is governed by their terms of service and you agree to abide by their terms of service. GitHub Copilot is considered “Third Party Materials” as defined in the Posit End User License Agreement and Posit assumes no liability or other obligations with respect thereto and, without limiting the foregoing, is not liable for any loss or damage resulting from the use or access thereof.