WorkflowSelectionMethod
- AGENT_SELECTED: Agent-based intelligent selection using metadata.
- ROLE_NAME_MATCH: Pattern matching by role_name.
- MOST_RECENT: Fallback to most recent workflows.
- ALL_AVAILABLE: Returned all workflows (fewer than max requested).
- NONE: No workflows available.
WorkflowMemoryManager
- worker (ChatAgent): The worker agent that will use workflows.
- description (str): Description of the worker’s role.
- context_utility (Optional[ContextUtility]): Shared context utility for workflow operations. If None, creates a new instance.
init
_get_context_utility
load_workflows
- pattern (Optional[str]): Legacy parameter for backward compatibility. When use_smart_selection=False, uses this pattern for file matching. Ignored when smart selection is enabled.
- max_files_to_load (int): Maximum number of workflow files to load. (default: :obj:
3
) - session_id (Optional[str]): Specific workforce session ID to load from. If None, searches across all sessions. (default: :obj:
None
) - use_smart_selection (bool): Whether to use agent-based intelligent workflow selection. When True, uses workflow information and LLM to select most relevant workflows. When False, falls back to pattern matching. (default: :obj:
True
)
save_workflow
- conversation_accumulator (Optional[ChatAgent]): Optional accumulator agent with collected conversations. If provided, uses this instead of the main worker agent.
- status (str): “success” or “error”
- summary (str): Generated workflow summary
- file_path (str): Path to saved file
- worker_description (str): Worker description used
_select_relevant_workflows
- workflows_metadata (List[Dict[str, Any]]): List of workflow information dicts (contains title, description, tags, file_path).
- max_files (int): Maximum number of workflows to select.
- session_id (Optional[str]): Specific workforce session ID to search in for fallback pattern matching. If None, searches across all sessions. (default: :obj:
None
)
_format_workflows_for_selection
- workflows_metadata (List[Dict[str, Any]]): List of workflow information dicts (contains title, description, tags, file_path).
_find_workflow_files
- pattern (Optional[str]): Custom search pattern for workflow files. If None, uses worker role_name to generate pattern.
- session_id (Optional[str]): Specific session ID to search in. If None, searches across all sessions.
_collect_workflow_contents
- workflow_files (List[str]): List of workflow file paths to load.
_format_workflows_for_context
- workflows_to_load (List[Dict[str, str]]): List of workflow dicts with ‘filename’ and ‘content’ keys.
_add_workflows_to_system_message
- workflow_context (str): The formatted workflow context to add.
_load_workflow_files
- workflow_files (List[str]): List of workflow file paths to load.
- max_workflows (int): Maximum number of workflows to load.