Web Search & Deep Research

AI-powered web search with Exa for real-time information retrieval

Web Search & Deep Research

Eden Stack uses Exa for AI-powered web search and deep research capabilities.

Why Exa over Perplexity?

We evaluated both Exa and Perplexity's APIs for web search integration. Here's why we chose Exa:

FeatureExaPerplexity
Search Accuracy90.04% (SimpleQA)88.70% (SimpleQA)
Domain FilteringUp to 1,200 domainsUp to 20 domains
Max Results100 per request20 per request
Rate Limits5-100 QPS1-30 QPS
Full Page ContentYesNo
Structured OutputCustom JSON schemasFixed format
Developer ControlFlexible search typesLimited options

Key Advantages

  1. Full Developer Control - Choose between keyword search, neural search, or hybrid approaches based on your quality, speed, or cost needs.

  2. Content Retrieval - Get URLs, full page contents, snippets, or structured output based on custom schemas. Perplexity only returns LLM-generated answers.

  3. Higher Limits - Up to 100 QPS for high-throughput applications vs Perplexity's 30 QPS maximum.

  4. Deep Research API - Async multi-step research pipeline that decomposes complex questions into search queries, synthesizes findings, and returns grounded reports with citations.

Integration in Eden Stack

Chat Web Search (Tool-based)

In the chat interface, Claude automatically decides when to search the web using Exa as a tool:

import { exaWebSearch } from "@eden/ai/tools";
 
const response = await streamText({
  model: anthropic("claude-sonnet-4-20250514"),
  messages,
  tools: {
    webSearch: exaWebSearch(),
  },
  maxSteps: 5,
});

No toggle needed - the AI decides when current web information would help answer the question.

Deep Research (Event-driven)

For comprehensive research tasks, use the durable Inngest-powered deep research:

// POST /agents/deep-research
const response = await fetch("/agents/deep-research", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    query: "What are the latest developments in AI agents?",
    userId: "user_123",
    model: "exa-research", // or "exa-research-pro" for higher quality
  }),
});
 
const { jobId } = await response.json();
// Returns immediately with jobId
 
// Poll for results
const result = await fetch(`/agents/deep-research/${jobId}`);
// Or wait for push notification on mobile

The deep research flow:

  1. Request → Creates job in database, fires Inngest event
  2. Inngest Function → Runs Exa research with retries
  3. Completion → Stores results, sends push notification
  4. Client → Polls for results or receives push notification

Direct SDK Usage

For custom integrations, use the Exa SDK directly:

import { exaDeepResearch, exaSearch } from "@eden/agents";
 
// Quick search with contents
const quickResults = await exaSearch("React Server Components best practices");
 
// Deep research (20-90 seconds, multi-step)
const research = await exaDeepResearch(
  "Compare GPU architectures from NVIDIA, AMD, and Intel in 2024",
  {
    model: "exa-research-pro",
    outputSchema: {
      type: "object",
      properties: {
        gpus: {
          type: "array",
          items: {
            type: "object",
            properties: {
              manufacturer: { type: "string" },
              model: { type: "string" },
              msrpUsd: { type: "number" },
            },
          },
        },
      },
    },
  }
);

Environment Setup

Add your Exa API key to .env:

# Get from: https://dashboard.exa.ai
EXA_API_KEY=your-exa-api-key

Pricing

Exa uses usage-based pricing:

Operationexa-researchexa-research-pro
Search$5/1k searches$5/1k searches
Page Read$5/1k pages$10/1k pages
Reasoning$5/1M tokens$5/1M tokens

A typical deep research task costs ~$0.10-0.25.

Next Steps

Full documentation for Eden Stack users

This documentation is exclusively available to Eden Stack customers. Already purchased? Log in to access the full content.