frankroeder / parrot.nvim

parrot.nvim 🦜 - the plugin that brings stochastic parrots to Neovim. This is a gp.nvim-fork focused on simplicity.
Other
244 stars 14 forks source link

Feature / UX suggestion: interactive session context management #62

Open dlants opened 6 hours ago

dlants commented 6 hours ago

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:

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!

frankroeder commented 4 hours ago

Hey @dlants, thank you for your uplifting feedback! It’s great to hear about your experiences and needs.

In short, I am currently working on a keyword-based approach similar to the cursor editor, which allows you to add a specific file with @file or an entire folder with @folder as context. However, it will take a little more time before these changes make it into the main branch.

For know, you can utilize the .parrot.md file as a global context for your repository/project. Simply invoke PrtContext to open it. This file provides additional context for your interactive mode commands. I see potential for session management here.

Yes, you are right. The chat and the interactive command are to entirely separate things.

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 context should be usable when using interactive commands like append or rewrite.

For now, copy & paste the content into the .parrot.md project file and manage it by opening it with PrtContext.

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.

This is something I have to think about.