> ## Documentation Index
> Fetch the complete documentation index at: https://exa.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Production Exa Agent examples for list building, KYB intelligence, job postings, and structured outputs.

These examples show production workflow patterns for Exa Agent, including list building, KYB intelligence, job postings, and structured outputs.

<a id="find-all-code" />

## Find all GTM members at Exa.ai

Use a discovery prompt when Agent should find the rows. Be explicit about company disambiguation and require current-employment evidence so similarly named companies do not leak into the result.

```json theme={null}
{
  "query": "Find all GTM members currently working at Exa.ai. Verify each person is at the correct company: Exa, the AI search company at exa.ai, not any other company named Exa. Include the company name in every row. Include only people with public evidence that they currently work at Exa and whose role is go-to-market, such as sales, business development, partnerships, customer success, marketing, growth, or revenue. Return one row per person.",
  "effort": "high",
  "outputSchema": {
    "type": "object",
    "required": ["gtm_members"],
    "properties": {
      "gtm_members": {
        "type": "array",
        "maxItems": 100,
        "items": {
          "type": "object",
          "required": ["full_name", "company", "title", "gtm_function", "company_verified_as_exa_ai", "evidence_urls"],
          "properties": {
            "full_name": { "type": "string" },
            "company": { "type": "string" },
            "title": { "type": "string" },
            "gtm_function": { "type": "string" },
            "company_verified_as_exa_ai": { "type": "boolean" },
            "evidence_summary": { "type": "string" },
            "profile_url": { "type": "string", "format": "uri" },
            "evidence_urls": {
              "type": "array",
              "items": { "type": "string", "format": "uri" },
              "minItems": 1
            }
          }
        }
      }
    }
  }
}
```

<a id="kyb-code" />

## KYC / KYB intelligence

Use Agent when a partner or vendor review needs public web intelligence, not just a single profile page. Ask for identity verification, business context, public signals, investment activity, and explicit risk notes in one structured object.

```json theme={null}
{
  "query": "Research Ramp (ramp.com) as a potential partner for a fintech infrastructure company. Verify the company identity. Return concise KYB intelligence covering company identity, brand or ecosystem partnerships, public mentions or notable news, recent investment activity, and risk notes. Use public sources and include source URLs.",
  "effort": "medium",
  "outputSchema": {
    "type": "object",
    "required": ["company_intel"],
    "properties": {
      "company_intel": {
        "type": "object",
        "required": [
          "company",
          "domain",
          "identity_verified",
          "business_summary",
          "brand_partnerships",
          "public_mentions",
          "investment_activity",
          "risk_notes",
          "source_urls"
        ],
        "properties": {
          "company": { "type": "string" },
          "domain": { "type": "string" },
          "identity_verified": { "type": "boolean" },
          "business_summary": { "type": "string" },
          "brand_partnerships": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "required": ["partner", "relationship", "evidence"],
              "properties": {
                "partner": { "type": "string" },
                "relationship": { "type": "string" },
                "evidence": { "type": "string" }
              }
            }
          },
          "public_mentions": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "required": ["mention", "source"],
              "properties": {
                "mention": { "type": "string" },
                "date": { "type": "string" },
                "source": { "type": "string", "format": "uri" }
              }
            }
          },
          "investment_activity": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "required": ["event", "source"],
              "properties": {
                "event": { "type": "string" },
                "amount_or_valuation": { "type": "string" },
                "date": { "type": "string" },
                "source": { "type": "string", "format": "uri" }
              }
            }
          },
          "risk_notes": {
            "type": "array",
            "maxItems": 3,
            "items": { "type": "string" }
          },
          "source_urls": {
            "type": "array",
            "maxItems": 8,
            "items": { "type": "string", "format": "uri" }
          }
        }
      }
    }
  }
}
```

<a id="job-postings-code" />

## Job postings

Use Agent when open roles are spread across company pages, aggregators, and startup directories. This example constrains the source to Exa's Ashby-hosted job board and still requires company disambiguation.

```json theme={null}
{
  "query": "Find current open job postings for Exa on Ashby. Use Ashby-hosted postings, preferably jobs.ashbyhq.com/exa, and verify each job is for Exa, the AI search company at exa.ai. Return up to 5 postings with company name, title, function, location, Ashby posting URL, and why it is relevant.",
  "effort": "medium",
  "outputSchema": {
    "type": "object",
    "required": ["job_postings"],
    "properties": {
      "job_postings": {
        "type": "array",
        "maxItems": 5,
        "items": {
          "type": "object",
          "required": [
            "title",
            "company",
            "function",
            "location",
            "company_verified_as_exa_ai",
            "posting_url",
            "source_platform",
            "why_relevant"
          ],
          "properties": {
            "title": { "type": "string" },
            "company": { "type": "string" },
            "function": { "type": "string" },
            "location": { "type": "string" },
            "company_verified_as_exa_ai": { "type": "boolean" },
            "posting_url": { "type": "string", "format": "uri" },
            "source_platform": { "type": "string" },
            "why_relevant": { "type": "string" }
          }
        }
      }
    }
  }
}
```

<a id="enrich-input-rows-code" />

## Enrich input rows

Use `input.data` when your system already has the records and Agent should research or enrich each one. This pattern keeps row identity in structured input instead of burying it in the prompt.

```json theme={null}
{
  "query": "For each input company, produce a concise research brief. Use recent, reputable sources. Return one report per input row.",
  "effort": "medium",
  "input": {
    "data": [
      { "company": "Ramp", "domain": "ramp.com" },
      { "company": "Mercury", "domain": "mercury.com" }
    ]
  },
  "outputSchema": {
    "type": "object",
    "required": ["reports"],
    "properties": {
      "reports": {
        "type": "array",
        "maxItems": 2,
        "items": {
          "type": "object",
          "required": ["company", "domain", "overview", "buyingSignals", "sourceUrls", "verified_domain"],
          "properties": {
            "company": { "type": "string" },
            "domain": { "type": "string" },
            "overview": { "type": "string" },
            "buyingSignals": {
              "type": "array",
              "maxItems": 3,
              "items": { "type": "string" }
            },
            "sourceUrls": {
              "type": "array",
              "minItems": 1,
              "items": { "type": "string", "format": "uri" }
            },
            "verified_domain": { "type": "boolean" }
          }
        }
      }
    }
  }
}
```

<a id="bounded-contact-fields-code" />

## Enrich rows with bounded contact fields

Contact-oriented workflows can trigger separate contact enrichment charges. This anonymized docs version demonstrates the shape without publishing personal names, emails, phone numbers, or profile URLs.

```json theme={null}
{
  "query": "For each company, find the best sales or partnerships contact. Prefer leadership or go-to-market roles. Return anonymized contact labels in examples and include evidence for why each role is relevant.",
  "effort": "high",
  "input": {
    "data": [
      { "company": "LangChain", "domain": "langchain.com" },
      { "company": "Modal", "domain": "modal.com" }
    ]
  },
  "outputSchema": {
    "type": "object",
    "required": ["contacts"],
    "properties": {
      "contacts": {
        "type": "array",
        "maxItems": 2,
        "items": {
          "type": "object",
          "required": ["company", "contact_label", "role", "relevanceReason"],
          "properties": {
            "company": { "type": "string" },
            "contact_label": { "type": "string" },
            "role": { "type": "string" },
            "relevanceReason": { "type": "string" },
            "contact_cost_bound": { "type": "string" }
          }
        }
      }
    }
  }
}
```

<a id="exclude-known-records-code" />

## Exclude known records

Use `input.exclusion` when Agent should avoid records your product has already reviewed, shown, or rejected.
The sheet preview uses synthetic returned company names so the exclusion pattern is visible without implying those rows came from a live production run.

```json theme={null}
{
  "query": "Find 10 seed-stage companies building infrastructure for AI coding agents. Do not return companies in the exclusion list.",
  "effort": "auto",
  "input": {
    "exclusion": [
      { "company": "Cursor", "domain": "cursor.com" },
      { "company": "CodeRabbit", "domain": "coderabbit.ai" }
    ]
  },
  "outputSchema": {
    "type": "object",
    "required": ["companies"],
    "properties": {
      "companies": {
        "type": "array",
        "maxItems": 10,
        "items": {
          "type": "object",
          "required": ["company", "domain", "reason", "sourceUrl"],
          "properties": {
            "company": { "type": "string" },
            "domain": { "type": "string" },
            "reason": { "type": "string" },
            "sourceUrl": { "type": "string", "format": "uri" },
            "excluded_match": { "type": "string" },
            "status": { "type": "string" }
          }
        }
      }
    }
  }
}
```

<a id="continue-workflow-code" />

## Continue a completed workflow

Use `previousRunId` when the next request should build on a completed run's context.
The sheet preview uses synthetic returned company names to illustrate the continuation pattern without exposing a real prior run.

```json theme={null}
{
  "previousRunId": "agent_run_01j...",
  "query": "From the companies you found, narrow the list to those hiring platform engineers in San Francisco. Add the hiring page URL for each match.",
  "outputSchema": {
    "type": "object",
    "required": ["companies"],
    "properties": {
      "companies": {
        "type": "array",
        "maxItems": 10,
        "items": {
          "type": "object",
          "required": ["company", "website", "hiringPageUrl"],
          "properties": {
            "company": { "type": "string" },
            "website": { "type": "string", "format": "uri" },
            "hiringPageUrl": { "type": "string", "format": "uri" },
            "hiringEvidence": { "type": "string" },
            "location": { "type": "string" },
            "followup_source": { "type": "string" }
          }
        }
      }
    }
  }
}
```

## Attach a data partner with Exa Connect

Use `dataSources` to let Exa Agent pull from a premium data partner during a run. Here it enriches each company with traffic from Similarweb and funding from Harmonic, blended with web research. See [Exa Connect](/reference/agent-api/connect/overview) for the full list of partners.

```json theme={null}
{
  "query": "For each input company, report estimated monthly visits and total funding raised. Use the attached data partners.",
  "effort": "medium",
  "dataSources": [
    { "provider": "similarweb" },
    { "provider": "harmonic" }
  ],
  "input": {
    "data": [
      { "company": "Ramp", "domain": "ramp.com" },
      { "company": "Mercury", "domain": "mercury.com" }
    ]
  },
  "outputSchema": {
    "type": "object",
    "required": ["companies"],
    "properties": {
      "companies": {
        "type": "array",
        "maxItems": 2,
        "items": {
          "type": "object",
          "required": ["company", "domain", "monthlyVisits", "totalFunding"],
          "properties": {
            "company": { "type": "string" },
            "domain": { "type": "string" },
            "monthlyVisits": { "type": "number", "description": "from Similarweb" },
            "totalFunding": { "type": "string", "description": "from Harmonic" }
          }
        }
      }
    }
  }
}
```

## Production checklist

* Give Agent a specific `query` that names the unit of work and the desired source quality.
* Use `input.data` for known records instead of embedding rows in the prompt.
* Use `input.exclusion` for records that should not be returned again.
* Add `outputSchema` whenever downstream code consumes the result.
* Use `maxItems` on arrays when you need predictable scope and cost.
* Store the returned run `id` so you can poll, replay events, inspect costs, or continue from the run later.
