Feature: Modular System Prompts, Implemented Ruff Draft Included #1611
rarefushion
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I created a modular system prompts manager complete with a UI! Sharing the design and would gladly take some pointers before I polish and create a pull request, if people think it even fits in the main repo.
How it works:
Sitting next to the Persona Prompt tab, while persona provides an excellent place for the core of the character, this manager allows you to create multiple prompts that can be easily toggled on the fly. Ideal for prompts that aren't directly tied to one character.
The backend "system_prompt_manager.py" loads from the user's data/system_prompts.json and is pulled by the agent_loop.py's _build_system_prompt which has a new optional system_prompts array parameter. The enabled prompts are place after the tool prompts. Changes are only applied at the start of a new conversation.
The frontend UI implements a new tab called System in the Prompt window (screenshot bellow), with a detailed explanation. Under that is a list of all of the user's modules, each with a content header field, enabled toggle, a personal not included description and a text field for the content of your system prompt. Finally at the bottom is a button to add a new module and then a save and close button to save everything.
Commits (rough drafts):
Here's the code commits to my personal project, separate commits for backend and frontend.
b960181a37b3adScreenshot:
Note: The code written in those commits were written by AI. For an official pull request it should be hand-written which I'll be happy to do. These AI drafts do well at presenting the concept.
Let me know how this would contribute to your workflow or how it would need to be modified to fit in! :D
All reactions