parrot.nvim icon indicating copy to clipboard operation
parrot.nvim copied to clipboard

Feature / UX suggestion: interactive session context management

Open dlants opened this issue 5 months ago • 3 comments

I've been using LLMs in coding more and more lately, especially using this plugin and some other nvim llm plugins. Thanks for your great contributions!

I've been running into an issue that I think some UX improvements may address.

The plugin and LLMs work great when you're starting with a new project, and you can basically shove the entire thing into a single rewrite / refactor command. However as the project grows, especially starting to create a single file that contains several logical pieces, or multiple files, the usefulness of the interactive mode commands (rewrite this, append here, etc...) starts to drop off significantly.

The project context helps some with this, as it lets you capture some general examples and preferences. However for a large project, the amount of context that you would need to include would be too large for a single file.

I think the solution for this is to allow the user to build up a context dynamically for a single project / session.

I'm kind of doing this currently through liberal use of PrtChatPaste - building up the context in the chat buffer. However, this is not ideal. It takes time to build up. It feels brittle. It gets less relevant with every interaction (as it gets pushed up with each question/response, sometimes past the token window), and there's no easy way to retain the context but add a new question.

Also, as far as I know the latest chat context is not attached to the interactive commands.

My dream UX would look something like:

  • commands to attach the current file, or the current visual selection to the context.
  • the ability to see the context and manage it - removing things from the context or reordering the items in the context, or possibly even adding exposition text.
  • the ability to retain the context when starting a new chat session, or the ability to easily inject the context into a new (clean) chat.
  • the context should be usable when using interactive commands like append or rewrite.

I feel like now that models have larger and larger context windows (128k for openAI, 200k for claude, even though they can't use all of the context window perfectly), being able to manage the context is going to be really valuable.

Thanks for your consideration!

dlants avatar Sep 29 '24 19:09 dlants