[Enhancement]: Agent Versioning #7224
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
@mawburn Great feature! Thanks a lot 👍 Would it be possible to use GitHub as a backend for version control? The use case I have in mind involves modifying an Agent's system prompt with a Git commit, independently of the UI. This would trigger a self-update of the system prompt for the Agent whenever a new version is detected. This approach would allow us to easily document all system prompt agents using a "docs as code" tool. Additionally, it introduces a way to build a "reflexive agent," where the agent could self-modify its own system prompt through a Git commit... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Current Challenges
Agent modification in LibreChat currently presents several challenges that should be addressed. The main issue is that agents can be modified easily, and these changes can lead to decreased performance, accuracy, or intent compared to previous versions. While creating copies of agents is a current workaround, this approach tends to create unnecessary clutter, especially when managing multiple agents.
This problem becomes particularly apparent in shared organizational environments. When multiple users have modification access to agents, unintended changes can affect all users since modifications are applied globally. There's currently no easy way to track these changes or revert to previous, well-functioning versions.
Proposed Solution
To address these issues, I propose implementing a versioning system similar to what's already in place for saved prompts. The interface would include a new "Versions" button, positioned logically in the UI between the "Advanced" and "Admin Settings" buttons.
This would open a panel displaying the version history of the agent, including timestamps for each version.
Technical Implementation
For the implementation, I suggest storing versions within an array in the agent object, rather than creating entirely new versions as the prompts system does. Each version in the array would store a complete agent object, excluding these metadata properties:
__v, _id, id, updatedAt
and the new property being proposedversions
.This approach would maintain the chronological order of versions while preserving creation timestamps.
This would just need to be done with a fairly minimal change to the updateAgent code:
Benefits
This versioning system would provide several key improvements:
This solution would give users the ability to track changes, restore previous versions, and maintain a clear history of agent modifications, all while keeping the interface clean and manageable. The technical implementation of storing the versions in an array on the already existing Agent, reduces the complexity of updating the
_id
with each new version and should not impose any more load on the database.Beta Was this translation helpful? Give feedback.
All reactions