agents.memory.search.labs.agent¶
Labs Agent implementation.
Provides interactive project automation with tools and workflows. Similar to Perplexity’s Labs feature that creates apps, dashboards, and automated workflows.
Classes¶
Agent for interactive project automation with tools and workflows. |
Functions¶
|
Create an interactive app. |
|
Create multiple interactive apps. |
|
Create project assets. |
|
Create a data visualization. |
|
Execute Python code and return results. |
Get the response model for labs operations. |
|
Get specific search instructions for labs operations. |
|
Get the system prompt for labs operations. |
|
|
Plan a project workflow. |
|
Process a data file with specified operations. |
Module Contents¶
- class agents.memory.search.labs.agent.LabsAgent(name='labs_agent', engine=None, search_tools=None, enable_code_execution=True, **kwargs)¶
Bases:
haive.agents.memory.search.base.BaseSearchAgent
Agent for interactive project automation with tools and workflows.
Mimics Perplexity’s Labs feature by providing comprehensive project automation, including data analysis, visualization creation, app development, and workflow execution.
Features: - Multi-tool integration (Python, SQL, visualization libraries) - Interactive app creation (dashboards, websites, slideshows) - Code execution and data analysis - Asset management and organization - Workflow automation - Real-time collaboration tools
Capabilities: - Data analysis and visualization - Interactive dashboard creation - Basic web app development - Chart and image generation - CSV and data processing - Code execution and debugging
Examples
Basic usage:
agent = LabsAgent( name="labs", engine=AugLLMConfig(temperature=0.3) ) response = await agent.process_labs_project( "Create a dashboard analyzing sales data", data_sources=["sales_data.csv"] )
With specific tools:
response = await agent.process_labs_project( "Build an interactive chart showing trends", required_tools=["pandas", "plotly", "d3.js"], create_interactive_app=True )
Initialize the Labs Agent.
- Parameters:
name (str) – Agent identifier
engine (haive.core.engine.aug_llm.AugLLMConfig | None) – LLM configuration (defaults to optimized settings)
search_tools (list[langchain_core.tools.Tool] | None) – Optional search tools
enable_code_execution (bool) – Enable code execution capabilities
**kwargs – Additional arguments passed to parent
- create_interactive_apps(workflow_steps)¶
Create interactive apps from workflow results.
- create_project_assets(workflow_steps)¶
Create project assets from workflow results.
- async execute_workflow_step(step_plan, step_index)¶
Execute a single workflow step.
- get_response_model()¶
Get the response model for Labs.
- Return type:
type[haive.agents.memory.search.base.SearchResponse]
- plan_project_workflow(query, project_type, data_sources)¶
Plan the workflow steps for a project.
- async process_labs_project(query, project_type='analysis', data_sources=None, required_tools=None, create_interactive_app=True, max_work_time=600, save_to_memory=True)¶
Process a Labs project with comprehensive automation.
- Parameters:
- Returns:
Labs response with project results
- Return type:
haive.agents.memory.search.labs.models.LabsResponse
- async process_search(query, context=None, save_to_memory=True)¶
Process a search query with default Labs settings.
- agents.memory.search.labs.agent.create_interactive_app(app_type, title, description)¶
Create an interactive app.
- agents.memory.search.labs.agent.create_interactive_apps(app_specs)¶
Create multiple interactive apps.
- agents.memory.search.labs.agent.create_project_assets(project_name, asset_types)¶
Create project assets.
- agents.memory.search.labs.agent.create_visualization(chart_type, data, title)¶
Create a data visualization.
- agents.memory.search.labs.agent.execute_python_code(code, description='')¶
Execute Python code and return results.
- agents.memory.search.labs.agent.get_response_model()¶
Get the response model for labs operations.
- Return type:
type[haive.agents.memory.search.base.SearchResponse]
- agents.memory.search.labs.agent.get_search_instructions()¶
Get specific search instructions for labs operations.
- Return type:
- agents.memory.search.labs.agent.get_system_prompt()¶
Get the system prompt for labs operations.
- Return type:
- agents.memory.search.labs.agent.plan_project_workflow(project_type, goals)¶
Plan a project workflow.