v2.43.13 - Advanced Agentic Automation
🤖 Advanced Agentic Automation Features
This release adds comprehensive agentic automation capabilities to spider, making it a powerful tool for autonomous web interactions.
Phase 1: Simplified Agentic APIs
act(page, instruction)- Execute single actions with natural languageobserve(page)- Analyze page state and get structured observationsextract_page(page, prompt, schema)- Extract structured data from pagesAutomationMemory- In-memory state management for multi-round automationrun_with_memory()- Stateful automation with persistent context
Phase 2: Self-Healing & Discovery
SelectorCache- Self-healing selector cache with LRU evictionact_cached(page, instruction, cache)- Actions with automatic selector cachingStructuredOutputConfig- Native JSON schema enforcement for reliable outputsextract_structured(page, prompt, config)- Schema-validated data extractionmap(page, prompt)- AI-powered URL discovery and categorizationMapResult/DiscoveredUrl- Relevance-scored URL discovery
Phase 3: Autonomous Agent Execution
execute(page, config)- Full autonomous goal-oriented executionagent(page, goal)- Simple goal execution with defaultsagent_extract(page, goal, prompt)- Goal execution with data extractionchain(page, steps)- Sequential action composition with conditionsAgentConfig- Comprehensive agent configuration (max_steps, timeout, recovery, etc.)RecoveryStrategy- Error handling strategies (Retry, Alternative, Skip, Abort)ChainStep/ChainCondition- Conditional action executionAgentEvent- Real-time progress tracking eventsAgentResult/ChainResult- Detailed execution results with history
Example Usage
// Autonomous agent
let config = AgentConfig::new("Find and add the cheapest laptop to cart")
.with_max_steps(30)
.with_success_url("/cart")
.with_extraction("Extract cart total");
let result = engine.execute(&page, config).await?;
// Action chaining
let steps = vec![
ChainStep::new("click Login"),
ChainStep::new("type email").when(ChainCondition::ElementExists("#email")),
ChainStep::new("click Submit").then_extract("Extract any errors"),
];
let result = engine.chain(&page, steps).await?;
// Self-healing cache
let mut cache = SelectorCache::new();
engine.act_cached(&page, "click submit", &mut cache).await?;Full Changelog
- feat(automation): add Phase 3 agentic features - autonomous agent, action chaining, error recovery
- feat(automation): add Phase 2 agentic features - selector cache, structured outputs, map API
- feat(automation): add simplified agentic APIs - act(), observe(), extract()
- feat(automation): add agentic memory for multi-round automation