Enhancement: Dynamic prompt/instruction building for agents
What features would you like to see added?
Related to #5006, a way to pre-populate the context/instructions with dynamic information, but more generally.
More details
I'm envisioning some sort of capability to inject dynamic information into the instruction prompt, perhaps using an action or something like it. A very simple approach to start with would be to configure an action that runs on every prompt, perhaps with the result being put into a template variable or something.
I'm coming from using SillyTavern to build agents, which has some pretty powerful context management features that inject pieces of data from various sources into the prompt using a recursive set of regex triggers to activate world info entries. Though SillyTavern was built for roleplaying, I found that the toolset worked very well for building agents with tools and memory. But its heritage as roleplaying software means that it lacks considerations needed for proper enterprise deployment.
Looking at model context protocol host support which is already in development, probably be done with MCP Resources or Prompts. #4876
Which components are impacted by your request?
General
Pictures
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Excellent idea
I agree that it would be nice to be able to get the information of the logged in user, time and call the agent or assistant.
It would be nice to be able to use {{current_user}}, {{current_date}} in the instruction of the agent or assistant builder to ask personalized questions.
I would love to be able to use {{current_date}} in the instruction of the agent. I hope this is coming soon!
I hope this is coming soon. We need to rebuild librechat every night to get it done via work around methods at the moment.
This would be great for agents. Would like this to get noticed and prioritized
I'm adding a few new special variables and adding a way to parse them for agent instructions.
Concerning the original post for use of dynamic content, using dynamically fetched information would indeed be great but it would be hard to set a standard there. I think it would be more appropriate to think of a feature like that for "Prompts," which can then in turn be used in Agents.
Adding quick ways to add prompts to agent instructions dynamically will also be implemented, but I'm closing this with just the first couple of special vars we add (mainly date/time-oriented).
Sweet cant wait to test it
Thank you! Can confirm the custom date varaible works now 🥇