UnSearch Docs

Neural Search API

Exa-compatible semantic search, similar content discovery, and key passage extraction.

Neural Search API

Semantic search that finds conceptually similar content. Exa-compatible endpoints for drop-in replacement.

POST /api/v1/neural/search

Find content based on meaning, not just keywords. Supports autoprompt expansion for better results.

Body Parameters

ParameterTypeDefaultDescription
querystringrequiredSearch query
num_resultsinteger10Results to return (1-50)
use_autopromptbooleantrueAuto-expand query for better results
include_highlightsbooleanfalseExtract key passages
include_domainsstring[]Only search these domains
exclude_domainsstring[]Exclude these domains
start_published_datestringFilter by publish date (ISO 8601)
end_published_datestringFilter by publish date (ISO 8601)
categorystring"general", "news", "academic", "tech", "finance"

Example Request

curl -X POST 'https://api.unsearch.dev/api/v1/neural/search' \
  -H 'X-API-Key: sk_live_xxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "Companies building autonomous AI agents",
    "num_results": 10,
    "category": "tech",
    "use_autoprompt": true,
    "include_highlights": true
  }'

Response

{
  "query": "Companies building autonomous AI agents",
  "expanded_queries": [
    "autonomous AI agent startups 2025",
    "enterprise AI agent companies"
  ],
  "results": [
    {
      "title": "AI Agent Startups 2025",
      "url": "https://example.com/ai-agents",
      "content": "A comprehensive list of companies...",
      "score": 0.95,
      "published_date": "2025-01-15",
      "author": "Tech Reporter",
      "highlights": [
        "Cognition Labs raised $175M for their autonomous coding agent Devin",
        "Adept AI focuses on building agents that interact with software"
      ]
    }
  ],
  "autoprompt_used": true,
  "search_type": "neural",
  "response_time_ms": 450
}

Find Similar

POST /api/v1/neural/similar

Find content similar to a given URL or text.

Body Parameters

ParameterTypeDefaultDescription
urlstringURL to find similar content for
textstringText to find similar content for
num_resultsinteger10Results to return (1-50)
exclude_sourcebooleantrueExclude the source URL from results

Provide either url or text, not both.

Example Request

curl -X POST 'https://api.unsearch.dev/api/v1/neural/similar' \
  -H 'X-API-Key: sk_live_xxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://arxiv.org/abs/2301.01234",
    "num_results": 5
  }'

Response

{
  "source": "https://arxiv.org/abs/2301.01234",
  "similar": [
    {
      "title": "Related Research Paper",
      "url": "https://arxiv.org/abs/2302.05678",
      "content": "...",
      "score": 0.89,
      "published_date": "2025-02-10"
    }
  ],
  "response_time_ms": 320
}

Extract Highlights

POST /api/v1/neural/highlights

Extract the most relevant passages from content for a given query.

Body Parameters

ParameterTypeDefaultDescription
querystringrequiredQuery to find relevant passages for
contentstringrequiredContent to extract highlights from
num_highlightsinteger3Number of highlights (1-10)

Response

{
  "query": "transformer self-attention",
  "highlights": [
    {
      "text": "Self-attention allows each position in the sequence to attend to all other positions...",
      "relevance": 0.95,
      "start_index": 1234
    }
  ]
}

POST /api/v1/neural/predictive

Predict next searches based on context and recent queries.

Body Parameters

ParameterTypeDefaultDescription
contextstringCurrent context or topic
recent_searchesstring[]Recent search queries
num_predictionsinteger5Predictions to generate (1-10)

Response

{
  "predictions": [
    {
      "query": "transformer vs LSTM performance comparison",
      "confidence": 0.87,
      "reason": "Follow-up to recent transformer architecture queries"
    }
  ],
  "context_used": true
}

Categories

GET /api/v1/neural/categories

List available search categories.

{
  "categories": ["general", "news", "academic", "tech", "finance"]
}

On this page