[GH-ISSUE #4325] [FEAT]: New System Prompt Variables #2752

Closed
opened 2026-02-22 18:31:05 -05:00 by yindo · 1 comment
Owner

Originally created by @RobinJue on GitHub (Aug 23, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4325

Originally assigned to: @angelplusultra on GitHub.

What would you like to see?

Dear community,

It would help a lot to be able to retrieve more system prompt variables. For my use case, being able to retrieve the user ID & workspace ID needed a workaround. It would also be super useful if the system prompt variables could be retrieved by agent skills.

Originally created by @RobinJue on GitHub (Aug 23, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4325 Originally assigned to: @angelplusultra on GitHub. ### What would you like to see? Dear community, It would help a lot to be able to retrieve more system prompt variables. For my use case, being able to retrieve the user ID & workspace ID needed a workaround. It would also be super useful if the system prompt variables could be retrieved by agent skills.
yindo added the enhancementcore-team-onlyfeature request labels 2026-02-22 18:31:06 -05:00
yindo closed this issue 2026-02-22 18:31:06 -05:00
Author
Owner

@timothycarambat commented on GitHub (Sep 17, 2025):

Specification:

  • Add support in SystemPromptVariables for user.id to return the current user's id value
  • Add support for in SystemPromptVariables for workspace.id and workspace.name to return both respective values
  • Updated frontend to use cyan for the "User" type and orange for "Workspace" type.

Refs:
getTypeColorTheme - move this out of the component and hoist above the component since it does not depend on state. Also, migrate to a function and not a const function

SystemPromptVariables - is where default values shown in the UI are available as well as DB classes that are valid

multiUserRequired on default props only apply to user based types in DEFAULT_VARIABLES

chatPrompt handles the parsing of this information and that is where additional data can be passed in

.expandSystemPromptVariables will need a conditional for handling this new workspace.* type.


To view system prompt variables open http://localhost:3000/settings/system-prompt-variables
To see user prompt vars you must be in Multi-User Mode first.

@timothycarambat commented on GitHub (Sep 17, 2025): Specification: - Add support in [SystemPromptVariables](https://github.com/Mintplex-Labs/anything-llm/blob/95557ee16fd60094df0750fb9c913e2574cd2261/server/models/systemPromptVariables.js#L15) for `user.id` to return the current user's `id` value - Add support for in SystemPromptVariables for `workspace.id` and `workspace.name` to return both respective values - Updated frontend to use `cyan` for the "User" type and `orange` for "Workspace" type. Refs: [`getTypeColorTheme`](https://github.com/Mintplex-Labs/anything-llm/blob/95557ee16fd60094df0750fb9c913e2574cd2261/frontend/src/pages/Admin/SystemPromptVariables/VariableRow/index.jsx#L41) - move this out of the component and hoist above the component since it does not depend on state. Also, migrate to a function and not a `const` function [`SystemPromptVariables`](https://github.com/Mintplex-Labs/anything-llm/blob/95557ee16fd60094df0750fb9c913e2574cd2261/server/models/systemPromptVariables.js#L15) - is where default values shown in the UI are available as well as DB classes that are valid `multiUserRequired` on default props **only** apply to `user` based types in `DEFAULT_VARIABLES` [`chatPrompt`](https://github.com/Mintplex-Labs/anything-llm/blob/95557ee16fd60094df0750fb9c913e2574cd2261/server/utils/chats/stream.js#L233) handles the parsing of this information and that is where additional data can be passed in [`.expandSystemPromptVariables`](https://github.com/Mintplex-Labs/anything-llm/blob/95557ee16fd60094df0750fb9c913e2574cd2261/server/models/systemPromptVariables.js#L254) will need a conditional for handling this new `workspace.*` type. --- To view system prompt variables open http://localhost:3000/settings/system-prompt-variables To see `user` prompt vars you must be in **Multi-User Mode** first.
yindo changed title from [FEAT]: New System Prompt Variables to [GH-ISSUE #4325] [FEAT]: New System Prompt Variables 2026-06-05 14:48:20 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2752