agentica
agentica copied to clipboard
Support per-conversation config in `conversate`
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
- Introduce
IAgenticaConversateConfigextendingIAgenticaConfigwith 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;
}
- Modify conversate to accept config?: IAgenticaConversateConfig:
async conversate(
ctx: IAgenticaContext,
config?: IAgenticaConversateConfig
): Promise<IAgenticaPrompt[]> { ... }
Delay this issue due to our urgent mission in April 7.