agentica icon indicating copy to clipboard operation
agentica copied to clipboard

Support per-conversation config in `conversate`

Open kakasoo opened this issue 1 year ago • 1 comments

Summary

Enhance the conversate function to support per-conversation configuration, allowing dynamic overrides of settings such as systemPrompt, metadata, and userId for multi-user and context-aware interactions.

Background

Currently, IAgenticaConfig is a global configuration, meaning that all conversations share the same settings. However, in a multi-user environment (e.g., Slack integration), each conversation may require different settings based on the user or context.

Adding a per-conversation configuration will allow:

  • Custom system prompts for each conversation
  • User-specific configurations
  • Temporary metadata storage per conversation

Proposed Changes

  1. Introduce IAgenticaConversateConfig extending IAgenticaConfig with additional properties:
export interface IAgenticaConversateConfig extends IAgenticaConfig {
  /**
   * User-specific identifier
   *
   * Ensures that the same Agentica instance can serve multiple users independently.
   */
  userId?: string;

  /**
   * Context-specific metadata
   *
   * Custom metadata for this specific conversation.
   * This can include user preferences, temporary variables,
   * or any other relevant contextual information.
   */
  metadata?: Record<string, any>;

  /**
   * Override system prompts at the conversation level
   *
   * If provided, this will replace the global `systemPrompt` for this conversation.
   */
  systemPrompt?: IAgenticaSystemPrompt;
}
  1. Modify conversate to accept config?: IAgenticaConversateConfig:
async conversate(
  ctx: IAgenticaContext,
  config?: IAgenticaConversateConfig
): Promise<IAgenticaPrompt[]> { ... }

kakasoo avatar Feb 28 '25 08:02 kakasoo

Delay this issue due to our urgent mission in April 7.

samchon avatar Mar 05 '25 13:03 samchon