valyu-best-practices
Complete Valyu API toolkit for AI agents. Use this skill when asked to perform real-time search across web, academic, medical, transportation, financial sources, content extraction from URLs, AI-powered answers with citations, or comprehensive deep research reports.
What this skill does
# Valyu Best Practices
This skill provides instructions for using the Valyu API to perform search, content extraction, AI-powered answers, and deep research tasks.
## Quick Reference: Choosing the Right API
Use this decision tree to select the appropriate Valyu API:
```
What do you need?
├─ Find information across multiple sources
│ └─ Use Search API
│
├─ Extract content from specific URLs
│ └─ Use Contents API
│
├─ Get an AI-synthesized answer with citations
│ └─ Use Answer API
│
├─ Generate a comprehensive research report
│ └─ Use DeepResearch API
│
└─ Discover available data sources
└─ Use Datasources API
```
---
## ⚠️ MANDATORY: Use Official Valyu SDK Libraries
**CRITICAL: When writing code that uses the Valyu API, you MUST use the official SDK libraries. NEVER make raw HTTP/fetch calls to the Valyu API endpoints.**
### JavaScript/TypeScript: `valyu-js`
```bash
npm install valyu-js
# or
pnpm add valyu-js
```
```typescript
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
// Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deepResearch
```
### Python: `valyu`
```bash
pip install valyu
# or
uv add valyu
```
```python
from valyu import Valyu
valyu = Valyu(api_key=os.environ.get("VALYU_API_KEY"))
# Now use valyu.search(), valyu.contents(), valyu.answer(), valyu.deep_research
```
### Why SDK Over Raw API Calls?
1. **Type safety** - Full TypeScript/Python type hints for all parameters and responses
2. **Automatic retries** - Built-in retry logic for transient failures
3. **Streaming support** - Proper async iterator support for streaming responses
4. **Error handling** - Structured error types with helpful messages
5. **Future compatibility** - SDK updates handle API changes automatically
### ❌ NEVER Do This
```typescript
// DON'T make raw fetch calls
const response = await fetch('https://api.valyu.ai/v1/search', {
method: 'POST',
headers: {
'x-api-key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ query: '...' })
});
```
### ✅ Always Do This
```typescript
// DO use the SDK
import { Valyu } from 'valyu-js';
const valyu = new Valyu(process.env.VALYU_API_KEY);
const response = await valyu.search({ query: '...' });
```
---
## 1. Search API
**Purpose:** Find information across web, academic, medical, transportation, financial, news, and proprietary sources.
### When to Use
- Finding recent information on any topic
- Academic research (arXiv, PubMed, bioRxiv, medRxiv)
- Financial data (SEC filings, earnings reports, stock data)
- News monitoring and current events
- Healthcare data (clinical trials, drug labels)
- Prediction markets (Polymarket, Kalshi)
- Transportation (UK National Rail, Global Shipping)
### Basic Usage
```typescript
const response = await valyu.search({
query: "transformer architecture attention mechanism 2024",
searchType: "all",
maxNumResults: 10
});
```
### Search Types
| Type | Use For |
|------|---------|
| `all` | Everything - web, academic, financial, proprietary |
| `web` | General internet content only |
| `proprietary` | Licensed academic papers and research |
| `news` | News articles and current events |
### Key Parameters
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|-------------------|-------------------|---------|---------|
| `query` | `query` | Search query (under 400 chars) | `"CRISPR gene editing 2024"` |
| `searchType` | `search_type` | Source scope | `"all"`, `"web"`, `"proprietary"`, `"news"` |
| `maxNumResults` | `max_num_results` | Number of results (1-20) | `10` |
| `includedSources` | `included_sources` | Limit to specific sources | `["valyu/valyu-arxiv", "valyu/valyu-pubmed"]` |
| `startDate` / `endDate` | `start_date` / `end_date` | Date filtering | `"2024-01-01"` |
| `relevanceThreshold` | `relevance_threshold` | Minimum relevance (0-1) | `0.7` |
### Domain-Specific Search Patterns
**Academic Research:**
```typescript
await valyu.search({
query: "CRISPR therapeutic applications clinical trials",
searchType: "proprietary",
includedSources: ["valyu/valyu-arxiv", "valyu/valyu-pubmed", "valyu/valyu-biorxiv"],
startDate: "2024-01-01"
});
```
**Financial Analysis:**
```typescript
await valyu.search({
query: "Apple revenue Q4 2024 earnings",
searchType: "all",
includedSources: ["valyu/valyu-sec-filings", "valyu/valyu-earnings-US"]
});
```
**News Monitoring:**
```typescript
await valyu.search({
query: "AI regulation EU",
searchType: "news",
startDate: "2024-06-01",
countryCode: "EU"
});
```
### Search Recipes
For detailed patterns, see:
- [Basic Search Patterns](references/search-recipes/basic-search-all.md)
- [Academic Search](references/search-recipes/academic-search.md)
- [Finance Search](references/search-recipes/finance-search.md)
- [News Search](references/search-recipes/news-search.md)
- [Healthcare Search](references/search-recipes/healthcare-and-bio-search.md)
---
## 2. Contents API
**Purpose:** Extract clean, structured content from web pages optimized for LLM processing.
### When to Use
- Converting web pages to clean markdown
- Extracting article text for summarization
- Parsing documentation for RAG systems
- Structured data extraction from product pages
- Processing academic papers
### Basic Usage
```typescript
const response = await valyu.contents({
urls: ["https://example.com/article"]
});
```
### With Summarization
```typescript
const response = await valyu.contents({
urls: ["https://arxiv.org/abs/2401.12345"],
summary: "Extract key findings in 3 bullet points"
});
```
### Structured Extraction (JSON Schema)
```typescript
const response = await valyu.contents({
urls: ["https://example.com/product"],
summary: {
type: "object",
properties: {
product_name: { type: "string" },
price: { type: "number" },
features: { type: "array", items: { type: "string" } }
},
required: ["product_name", "price"]
}
});
```
### Key Parameters
| Parameter (TS/JS) | Parameter (Python) | Purpose | Example |
|-------------------|-------------------|---------|---------|
| `urls` | `urls` | URLs to process (1-10) | `["https://example.com"]` |
| `responseLength` | `response_length` | Content length | `"short"`, `"medium"`, `"large"`, `"max"` |
| `extractEffort` | `extract_effort` | Extraction quality | `"normal"`, `"high"`, `"auto"` |
| `summary` | `summary` | AI summarization | `true`, `"instructions"`, or JSON schema |
| `screenshot` | `screenshot` | Capture screenshots | `true` |
### Content Recipes
For detailed patterns, see:
- [Basic Content Extraction](references/content-recipes/basic-content-extraction-from-web.md)
- [Extraction with Summary](references/content-recipes/basic-content-extraction-from-web-with-summary.md)
- [Structured Extraction](references/content-recipes/structured-content-extraction-from-web.md)
- [Research Paper Extraction](references/content-recipes/extract-content-from-research-paper.md)
---
## 3. Answer API
**Purpose:** Get AI-powered answers grounded in real-time search results with citations.
### When to Use
- Questions requiring current information synthesis
- Multi-source fact verification
- Technical documentation questions
- Research requiring cited sources
- Structured data extraction from search results
### Basic Usage
```typescript
const response = await valyu.answer({
query: "What are the latest developments in quantum computing?"
});
```
### With Fast Mode (Lower Latency)
```typescript
const response = await valyu.answer({
query: "Current Bitcoin price and 24h change",
fastMode: true
});
```
### With Custom Instructions
```typescript
const response = await valyu.answer({
query: "Compare React and Vue for enterprise applications",
systemInstructions: "Provide a balanced comparison with pros and cons. Format as a comparison table."
});
```
### With Streaming
```typescript
const stream = await valyu.answer({
query: "Explain tRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.