LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

Enhancement: Dynamic prompt/instruction building for agents

Open acehoss opened this issue 1 year ago • 5 comments

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

acehoss avatar Dec 16 '24 15:12 acehoss

Excellent idea

insilications avatar Jan 10 '25 18:01 insilications

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.

woojuini avatar Feb 10 '25 07:02 woojuini

I would love to be able to use {{current_date}} in the instruction of the agent. I hope this is coming soon!

jcrabapple avatar Apr 18 '25 20:04 jcrabapple

I hope this is coming soon. We need to rebuild librechat every night to get it done via work around methods at the moment.

wogam avatar Apr 22 '25 21:04 wogam

This would be great for agents. Would like this to get noticed and prioritized

asfandsaleem avatar Apr 25 '25 06:04 asfandsaleem

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).

danny-avila avatar Apr 29 '25 02:04 danny-avila

Sweet cant wait to test it

tinuva avatar Apr 29 '25 04:04 tinuva

Thank you! Can confirm the custom date varaible works now 🥇

tinuva avatar Apr 29 '25 08:04 tinuva