anything-llm icon indicating copy to clipboard operation
anything-llm copied to clipboard

[FEAT]: Add a Global prompt

Open scottybo opened this issue 6 months ago • 4 comments

What would you like to see?

When looking at how people are using AnythingLLM, the vast majority ask questions about how to do things in their initial chats. The problem with this is that the user is just talking to an LLM, who has no idea about the context for their questions (none of them specifically mention AnythingLLM).

With this example, it would be useful to create a global prompt which gets inserted at the system prompt level which allows us to prompt things like

If the user asks about how to use a platform, direct them to email Bob ([email protected]) for any questions

This way we can easily handle common questions or issues people are having when using AnythingLLM.

scottybo avatar May 29 '25 10:05 scottybo

This can be achieved with System Variables where you can add this to each workspace's system prompt, and then that very same text would be injected into each prompt.

That would resolve this - no?

timothycarambat avatar Jun 03 '25 18:06 timothycarambat

@timothycarambat I'd disagree that this solves it, as it requires the workspace creator to know that this should be done, and also to do it.

When you have dozens of users using the system, this isn't practical or sustainable.

scottybo avatar Jun 03 '25 18:06 scottybo

Thanks for the platform it's really something brilliant!!

totally agree to the above messages, I started to dive into anythingLLM and actually didn't find how to configure pre-sending, I think it might be useful to change the default system prompt, not only in case of stating your contacts, but also when u use another language, e.g. "answer only in Spanish unless user asks to translate or to chat in another language, use context but don't repeat it....", cause most LLM answer in English by default, may be useful, but as for now it's impossible to configure it for all workspaces so the system prompt is always in English and if a user asks in another language the system prompt (and context retrieved) will be in 1 language, answer in another and it potentially may cause some problems and reduce the number of useful information given

  • it may also be handy to give examples of answers (contacts case example)

maybe adding a global customisable setting like default system-prompt (for all workspaces) is not a bad idea - I think it is worth adding) thank u anyway

ArturTask avatar Sep 23 '25 19:09 ArturTask

The singular workspace-based system prompts are very limiting concept.

For this tool being truly useful there should be multi-level system prompt - similar to ChatGPT

ie. [Global System Prompt] - set in the server settings which sets the most basic things (ie. "you are a helpful assistant for a company named acme", personality traits and so on).

[Workspace System Prompt] - builds on the Global Prompt fine tuning to a specific use case (similar to the ChatGPT or Claude Desktop Projects).

[Tool System Prompt] - Tools or Agent Skills are hardly usable for anything serious in the current state of them being set globally (vide #3855 ) - Each skill should be defined per workspace and have it's own description used as tool prompt. Also possibly another field to outline relations between tools.

[User Personalization] - additional instructions set by user (possibly taking into account the bio as well) - similar to ChatGPT personalization options.

They should be joined together and passed to the LLM as a system prompt.

Right now for each workspace I have a python tool which uses jinja2 template to build a system prompt from yaml "modules" so the experience stays the same across all workspaces but LLM understands what's expected in them and which tools to use. It works reasonably well but it's pain to manage.

HanJammer avatar Nov 11 '25 02:11 HanJammer