[FEAT]: User Profile Custom Metadata Fields #2994

Open
opened 2026-02-28 06:26:30 -05:00 by deekerman · 1 comment
Owner

Originally created by @troylar on GitHub (Nov 22, 2025).

What would you like to see?

Problem/Use Case:

Currently, AnythingLLM only provides two user-specific variables ({user.name} and {user.bio}). For organizations and power users, there's often a need to pass additional user-specific context to the system prompt, such as:

  • User role/department
  • User preferences (communication style, expertise level)
  • User location/timezone
  • User-specific business context (territory, account type, subscription tier)
  • Custom organizational fields

Proposed Solution:

Add the ability to define and store custom metadata fields on user profiles that can be referenced in system prompts using the existing variable syntax.

Implementation Ideas:

  1. Admin Configuration: Add a "User Profile Fields" section in admin settings where admins can define custom fields:

    • Field name (e.g., "role", "department", "expertise_level")
    • Field type (text, dropdown, multi-select, etc.)
    • Optional: Default values
  2. User Profile UI: Extend the user profile page to display and edit these custom fields

  3. Variable Access: Make these fields accessible in system prompts as {user.field_name}, similar to existing {user.name} and {user.bio}

Example Usage:

You are an AI assistant for {company_name}.

The user's name is {user.name} and they are a {user.role} in the {user.department} department.
Their expertise level is: {user.expertise_level}
Their preferred communication style is: {user.communication_style}

{user.bio}

Benefits:

  • Enables more personalized and context-aware AI interactions
  • Supports organizational use cases without code changes
  • Maintains the existing variable pattern users are familiar with
  • Allows dynamic per-user context vs. static global variables
Originally created by @troylar on GitHub (Nov 22, 2025). ### What would you like to see? **Problem/Use Case:** Currently, AnythingLLM only provides two user-specific variables (`{user.name}` and `{user.bio}`). For organizations and power users, there's often a need to pass additional user-specific context to the system prompt, such as: - User role/department - User preferences (communication style, expertise level) - User location/timezone - User-specific business context (territory, account type, subscription tier) - Custom organizational fields **Proposed Solution:** Add the ability to define and store custom metadata fields on user profiles that can be referenced in system prompts using the existing variable syntax. **Implementation Ideas:** 1. **Admin Configuration**: Add a "User Profile Fields" section in admin settings where admins can define custom fields: - Field name (e.g., "role", "department", "expertise_level") - Field type (text, dropdown, multi-select, etc.) - Optional: Default values 2. **User Profile UI**: Extend the user profile page to display and edit these custom fields 3. **Variable Access**: Make these fields accessible in system prompts as `{user.field_name}`, similar to existing `{user.name}` and `{user.bio}` **Example Usage:** ``` You are an AI assistant for {company_name}. The user's name is {user.name} and they are a {user.role} in the {user.department} department. Their expertise level is: {user.expertise_level} Their preferred communication style is: {user.communication_style} {user.bio} ``` **Benefits:** - Enables more personalized and context-aware AI interactions - Supports organizational use cases without code changes - Maintains the existing variable pattern users are familiar with - Allows dynamic per-user context vs. static global variables
Author
Owner

@bittoby commented on GitHub (Feb 18, 2026):

@timothycarambat @shatfield4 I'd like to contribute this! If it is needed, please let me know. I can do it perfectly, thank you

@bittoby commented on GitHub (Feb 18, 2026): @timothycarambat @shatfield4 I'd like to contribute this! If it is needed, please let me know. I can do it perfectly, thank you
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anything-llm#2994
No description provided.