Skip to main content

Exa Web Search CLI

Use Exa semantic web search from the command line.

Prerequisites

# Install the package
npm install @exalabs/ai-sdk

# Set your API key
export EXA_API_KEY=your-exa-api-key

Commands

List Tools

# List all available tools including Exa
praisonai-ts tools list

# Filter by search tag
praisonai-ts tools list --tag search

Tool Information

# Get detailed info about Exa tool
praisonai-ts tools info exa

# JSON output
praisonai-ts tools info exa --json

Health Check

# Check if Exa is properly configured
praisonai-ts tools doctor

# Output shows:
# ✓ exa (Exa) - Package installed, env vars set
# ✗ exa (Exa) - Missing env vars: EXA_API_KEY

Test Tool

# Dry run (no API call)
praisonai-ts tools test exa

# Live test with actual API call
praisonai-ts tools test exa --live

Run Search Agent

# Basic search
praisonai-ts agent run \
  --instructions "Search the web for information" \
  --tools exa \
  --prompt "Find the latest AI developments"

# With configuration
praisonai-ts agent run \
  --instructions "Research companies" \
  --tools "exa:numResults=5,type=auto,category=company" \
  --prompt "Find AI startups in Europe"

Tool Options

OptionTypeDefaultDescription
typestringautoSearch type: auto, neural, fast, deep
numResultsnumber10Number of results to return
categorystring-Filter by category
includeDomainsstring[]-Domains to include
excludeDomainsstring[]-Domains to exclude

Examples

praisonai-ts agent run \
  --tools exa \
  --prompt "What are the latest breakthroughs in quantum computing?"

Company Research

praisonai-ts agent run \
  --instructions "You are a business analyst" \
  --tools "exa:category=company,numResults=10" \
  --prompt "Find fintech companies with recent Series A funding"
praisonai-ts agent run \
  --tools "exa:category=news,type=fast" \
  --prompt "Latest news about OpenAI"

Academic Research

praisonai-ts agent run \
  --instructions "You are a research assistant" \
  --tools "exa:category=research paper,numResults=5" \
  --prompt "Find recent papers on transformer architectures"

JSON Output

# Get results as JSON
praisonai-ts agent run \
  --tools exa \
  --prompt "AI news" \
  --json

# Output:
{
  "success": true,
  "data": {
    "text": "Based on my search...",
    "toolCalls": [...],
    "usage": {...}
  }
}

Combining with Other Tools

# Use multiple search tools
praisonai-ts agent run \
  --tools "exa,tavily" \
  --prompt "Compare information about GPT-5 from multiple sources"

# Search and extract
praisonai-ts agent run \
  --tools "exa,firecrawl:scrape" \
  --prompt "Find and extract content from AI research blogs"

Environment Variables

VariableRequiredDescription
EXA_API_KEYYesYour Exa API key
OPENAI_API_KEYYesOpenAI API key for the agent

Troubleshooting

Missing API Key

# Check if API key is set
praisonai-ts tools doctor

# Set the API key
export EXA_API_KEY=your-key-here

Package Not Installed

# Install the Exa package
npm install @exalabs/ai-sdk

# Verify installation
praisonai-ts tools doctor

Rate Limiting

If you encounter rate limits:
  • Reduce numResults
  • Add delays between requests
  • Check your Exa plan limits
  • praisonai-ts tools list - List all tools
  • praisonai-ts tools doctor - Check tool health
  • praisonai-ts agent run - Run agent with tools