# Echo - OpenClaw Perplexity Ultimate Async Deep Researcher
You are an expert autonomous researcher. When triggered, you MUST use the Perplexity Search API to gather real-time, factual "raw data" from the internet before answering the user. Do not rely solely on your internal training data.
## Execution Workflow
You must strictly follow these 3 stages:
### Stage 1: Query Formulation
Analyze the user's research request.
Break down the core topic into 3 to 5 highly specific search queries, for example, instead of "AI news", use "AI medical diagnosis accuracy 2026".
### Stage 2: Execute Async Search
You must use your code execution tool (Python) to run the exact script below.
Instructions for Agent:
1. Replace the `queries` list in the `if __name__ == "__main__":` block with the specific queries you formulated in Stage 1.
2. Run the code and read the JSON output from stdout.
```python
import asyncio
import json
import sys
import subprocess
import os
# Auto-install dependency to ensure zero-setup for the user
try:
from perplexity import AsyncPerplexity
except ImportError:
print("Installing perplexityai...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "perplexityai", "-q"])
from perplexity import AsyncPerplexity
async def fetch_results(queries):
# Ensure API Key exists
if not os.environ.get("PERPLEXITY_API_KEY"):
print(json.dumps({"error": "PERPLEXITY_API_KEY environment variable is not set."}, ensure_ascii=False))
return
client = AsyncPerplexity(
api_key=os.environ.get("PERPLEXITY_API_KEY"),
)
# Create async tasks for concurrent execution
tasks = [
client.search.create(query=q, max_results=5, max_tokens_per_page=2048)
for q in queries
]
responses = await asyncio.gather(*tasks, return_exceptions=True)
output = {}
for q, res in zip(queries, responses):
if isinstance(res, Exception):
output[q] = {"error": str(res)}
els...
README excerpt
# Echo - OpenClaw Perplexity Ultimate Async Deep Researcher
A high-performance, autonomous research skill for the OpenClaw framework. This skill empowers your AI Agent to break down complex research tasks and fetch raw data from multiple sources concurrently using the Perplexity Search API.
Built by HolyGrass.
## 🚀 Key Features
- **Blazing Fast Concurrency:** Utilizes `AsyncPerplexity` to execute up to 5 sub-queries simultaneously, drastically reducing the time your Agent spends waiting for web results.
- **Zero-Config Dependency Injection:** The Agent automatically detects and installs the required Perplexity Python SDK on its first run via the internal Python tool. No manual `pip install` required for the end-user.
- **LLM Context Optimization:** Requests "raw data" (snippets, URLs) capped at 2048 tokens per page to reduce payload size and protect your LLM context window.
- **Fault Tolerance:** Built-in error handling ensures that if one search query fails or hits a rate limit, the rest of the research data still returns successfully.
## 🛠 Installation
Create a new directory in your OpenClaw skills folder:
```bash
mkdir -p ~/.openclaw/skills/echo-perplexity-ultimate-async-researcher
```
Copy the provided `SKILL.md` into this new directory.
Reload your OpenClaw environment to register the new skill.
## ⚙️ Configuration
This skill requires a Perplexity API key to function. Expose it to your OpenClaw execution environment:
```bash
export PERPLEXITY_API_KEY="your_api_key_here"
```
You can generate an API key from the Perplexity API Platform.
## 🧠 How It Works (The Agent Workflow)
When a user triggers a research prompt, for example, "Research the latest advancements in solid-state batteries in 2026", the Agent follows a strict 3-stage pipeline:
1. **Query Formulation:** Break the prompt down into 3 to 5 hyper-specific search queries.
2. **Execution:** Execute the built-in asynchronous Python script, replacing placeholder queries with its own, then rea...