Positron Assistant
Positron Assistant is a preview feature in Positron 2025.07.0-204 and beyond.
At this time, we support Anthropic for chat, and GitHub Copilot for inline code completions. We will continue to add more language model providers in future releases.
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.
Getting started
Step 1: Enable Positron Assistant
Opt in to the
positron.assistant.enable
setting to enable Positron Assistant.Restart Positron or run the Developer: Reload Window command in the Command Palette.
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.
Step 2: Configure language model providers
Chat
Currently, only Anthropic Claude is available for sidebar chat and inline chat.
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.
If you have an Anthropic account, you should be able to get an API key from the Anthropic Console on the admin keys page.
Copy and save the API key to a password manager or another secure location. In order to add Anthropic as a language model provider in Positron, this key will be used to authenticate to Anthropic.
Code completions
At this time, only GitHub Copilot is available for inline code completions.
If you have a GitHub account with Copilot enabled, you can authenticate to GitHub Copilot in Positron Assistant in the “Configure Language Model Providers” 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.
If you are using Positron with a remote SSH session, you will need to authenticate to GitHub on the remote server as well. Follow along on GitHub as we make improvements in this area.
Adding language model providers
Run the Positron Assistant: Configure Language Model Providers command to open the language model provider dialog. You can also click the Add Model Provider… button in the Positron Assistant chat area.
Select the model provider you want to add.
Authenticate with the model provider.
- For Anthropic, paste your API key into the input field and click Sign in.
- For GitHub Copilot, click the Sign in button. This will open a browser window where you can authenticate with your GitHub account via OAuth.
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: Configure Language Model Providers command to open the language model provider dialog. You can also click the Add Model Provider… button in the Positron Assistant chat area to open this dialog.
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.
Step 3: Use Positron Assistant!
Use the Chat pane, inline chat, or code completions in an editor to interact with the language models.
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.
Chat modes
To switch between modes, click the mode selector at the bottom of the Chat pane.
Positron Assistant supports the following chat modes:
- Ask: Use this mode to ask questions, get help with debugging, or request code generation. This is the default mode when you open the chat.
- Edit: Use this mode to make code changes with the model’s help. The model will suggest code changes based on your prompts, and you can apply those changes to your code.
- Agent: Use this mode if you’d like Positron Assistant to determine the steps needed for your request and autonomously carry out the work. On your behalf, Positron Assistant can execute code in the Console, create and modify files, and identify the next steps based on the results of the previous steps.
Attaching context
Providing context to the model is crucial for getting accurate and relevant responses. To attach specific files or directories as context for your prompts, you can either:
- Click the Add Context… button in the Chat pane and choose “Files & Folders…” in the quickpick to select relevant items; or
- Drag files to the Chat pane as attachments
Code generation and execution
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
Chat participants provide specialized knowledge to Positron Assistant. You can add a chat participant by clicking the button or 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.
Chat conversation history
It’s important to start a new chat conversation for each new task, so the model has the most relevant context. To create a new chat conversation, click the button in the top right of the Chat pane or run the Chat: New Chat command in the Command Palette.
To view your chat conversations, click the clock icon in the top right of the Chat pane or run the Chat: Show Chats… command in the Command Palette. You can then select a previous conversation to switch back to it.
Customizing the default prompt
To add further instructions to the default prompt for Positron Assistant, create a file named llms.txt
in your workspace directory. The contents of this file will be appended to the default prompt, which is used for all chat and inline chat interactions. This file does not affect code completions.
Inline chat
Inline chat is very useful for asking questions in the context of your code, and also includes an interface for integrating changes suggested by the model.
To open this mini chat interface can in an editor or terminal, use the default keybinding , or run the command Inline Chat: Editor Inline Chat while your cursor in an editor or the command Inline Chat: Terminal Inline Chat while your cursor is in a terminal.
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 or the Assistant output logs to see if there are any errors logged.
Shiny Assistant
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.
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.
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.
Why use Positron Assistant over other AI clients?
Positron Assistant offers novel data science and Positron-specific context compared to other IDE AI tooling. We provide a data-science-centric IDE 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. You can 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 a 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.).
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
By using Anthropic Claude, you acknowledge that your use of Anthropic Claude is 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.