Spider Agent
A concurrent-safe multimodal agent for web automation and research.
Features
- Concurrent-safe: Designed to be wrapped in
Arcfor multi-task access - Feature-gated: Only include dependencies you need
- Multiple LLM providers: OpenAI, OpenAI-compatible APIs
- Multiple search providers: Serper, Brave, Bing, Tavily
- HTML extraction: Clean and extract structured data from web pages
- Research synthesis: Combine search + extraction + LLM synthesis
Installation
Add to your Cargo.toml:
[]
= { = "0.1", = ["openai", "search_serper"] }
Quick Start
use ;
use Arc;
async
Concurrent Execution
use Agent;
use Arc;
let agent = new;
// Execute multiple searches concurrently
let queries = vec!;
let mut handles = Vecnew;
for query in queries
// Collect results
for handle in handles
Research with Synthesis
use ;
let agent = builder
.with_openai
.with_search_serper
.build?;
let research = agent.research.await?;
println!;
Feature Flags
| Feature | Description |
|---|---|
openai |
OpenAI/OpenAI-compatible LLM provider |
chrome |
Browser automation via chromiumoxide |
search |
Base search functionality |
search_serper |
Serper.dev search provider |
search_brave |
Brave Search provider |
search_bing |
Bing Search provider |
search_tavily |
Tavily AI Search provider |
full |
All features |
Examples
# Basic search
SERPER_API_KEY=xxx
# Extract data
OPENAI_API_KEY=xxx
# Research
OPENAI_API_KEY=xxx SERPER_API_KEY=xxx
# Concurrent execution
OPENAI_API_KEY=xxx SERPER_API_KEY=xxx
API Reference
Agent
The main struct for all agent operations:
search(query)- Search the websearch_with_options(query, options)- Search with custom optionsfetch(url)- Fetch a URLextract(html, prompt)- Extract data from HTML using LLMextract_structured(html, schema)- Extract data matching a JSON schemaresearch(topic, options)- Research a topic with synthesisprompt(messages)- Send a prompt to the LLMmemory_get/set/clear()- Session memory operations
AgentBuilder
Configure and build agents:
builder
.with_config
.with_system_prompt
.with_max_concurrent_llm_calls
.with_openai
.with_search_serper
.build
License
MIT