AgentConfig
from pilottai.core import AgentConfig, AgentType config = AgentConfig( title="document_processor", # Agent's title/type agent_type=AgentType.WORKER, # Agent classification goal="Process documents efficiently", # Main objective description="Document processing worker", # Brief description backstory=None, # Optional background story knowledge_sources=[], # Available knowledge sources tools=["text_extractor"], # Available tools required_capabilities=[], # Required capabilities max_iterations=20, # Maximum execution iterations max_rpm=None, # Rate limits memory_enabled=True, # Enable memory verbose=False # Verbose logging )
from pilottai.core import Job, JobPriority job = Job( description="Extract key information from document", priority=JobPriority.HIGH, context={"file_path": "document.pdf"} )
# Store information in semantic memory await agent.memory.store_semantic( text="Important information about topic X", metadata={"topic": "X", "importance": "high"}, tags={"research", "topic_x"} ) # Search memory results = await agent.memory.search( query="topic X", tags={"research"} )
from pilottai.core import LLMConfig llm_config = LLMConfig( model_name="gpt-4", provider="openai", api_key="your-api-key", temperature=0.7, max_tokens=2000 )
from pilottai.tools import Tool email_tool = Tool( name="email_sender", description="Send emails to recipients", function=lambda **kwargs: send_email(**kwargs), parameters={ "to": "str", "subject": "str", "body": "str" } )
await pilott.enable_dynamic_scaling( config={ "min_agents": 2, "max_agents": 10, "scale_up_threshold": 0.8, "scale_down_threshold": 0.3 } )
await pilott.enable_load_balancing( config={ "check_interval": 30, "overload_threshold": 0.7 } )
await pilott.enable_fault_tolerance( config={ "health_check_interval": 30, "max_recovery_attempts": 3 } )