---
title: "Unified search"
method: POST
path: "/search"
tags: ["Search"]
---

# Unified search

`POST /search`

Single search endpoint with a mode discriminator.

## Request body

- union
  - QuerySearchRequest
    - `messages` object[], required — List of chat messages
    - `repositories` union[] — List of repositories to query. Can be strings (slug, display name) or dicts with a 'repository' field.
      - union
        - string
        - object
    - `data_sources` union[] — List of data sources to query. Can be strings (display_name, URL, or source_id) or dicts with 'source_id' or 'identifier' fields
      - union
        - string
        - object
    - `local_folders` union[] — List of local folders to query. Can be strings (display_name or local_folder_id) or dicts with 'local_folder_id' or 'identifier' fields. Local folders are private and user-scoped.
      - union
        - string
        - object
    - `slack_workspaces` string[] — List of Slack installation IDs to include in search
    - `slack_filters` SlackSearchFilters — Filters for Slack message search within query endpoint.
      - `channels` string[], nullable — Filter by channel names or IDs
      - `users` string[], nullable — Filter by Slack user names or IDs
      - `date_from` string, nullable — Oldest message timestamp (ISO 8601)
      - `date_to` string, nullable — Newest message timestamp (ISO 8601)
      - `include_threads` boolean — Include threaded messages in results
    - `category` string, nullable — Filter local folder results by classification category (e.g., 'Work', 'Personal')
    - `local_source_filters` LocalSourceFilters — Filters for local/personal source retrieval (messages, contacts, etc.).
      - `source_subtype` string, nullable — Filter by source subtype (e.g., 'database', 'telegram_export')
      - `db_type` string, nullable — Filter by database type (e.g., 'imessage', 'telegram', 'safari_history')
      - `connector_type` string, nullable — Filter by connector type (e.g., 'imessage', 'whatsapp', 'contacts')
      - `conversation_id` string, nullable — Filter to a specific conversation/chat
      - `contact_id` string, nullable — Filter to messages with a specific contact
      - `sender_role` string, nullable — Filter by sender role: 'self' or 'contact'
      - `time_after` string, nullable — Only return results with timestamp after this ISO datetime
      - `time_before` string, nullable — Only return results with timestamp before this ISO datetime
    - `source_trust_filter` SourceTrustFilter — Filtering preferences for trust-aware retrieval.
      - `minimum_trust_tier` 'low' | 'medium' | 'high' | 'verified', nullable — Only include sources at or above this effective trust tier
      - `verified_only` boolean — Only include Nia-verified sources
      - `require_overlay` boolean — Only include sources with curated overlays
    - `search_mode` string — Search mode: 'repositories', 'sources', or 'unified'
    - `stream` boolean — Whether to stream the response
    - `include_sources` boolean — Whether to include source texts in the response
    - `fast_mode` boolean — Skip LLM processing for faster results (100-500ms vs 2-8s). Set to false for deeper analysis.
    - `skip_llm` boolean — Return raw search results without any LLM processing. Returns only sources with scores.
    - `reasoning_strategy` string — Retrieval strategy: 'vector' (default similarity search), 'tree' (LLM-guided tree navigation for PDFs), or 'hybrid' (both combined)
    - `max_tokens` integer, nullable — Maximum tokens in response. Results truncated when budget reached.
    - `model` string, nullable — Synthesis model override. Allowed: claude-sonnet-4-5, gpt-5.2-2025-12-11, claude-haiku-4-5-20251001
    - `semantic_cache_threshold` number — Minimum similarity for semantic cache hit (non-streaming only)
    - `bypass_semantic_cache` boolean — Skip semantic cache (L2) lookup
    - `include_follow_ups` boolean — Generate follow-up questions (adds ~500-1000ms LLM latency). Disabled by default for speed.
    - `e2e_session_id` string, nullable — Active E2E decrypt session ID. When provided, encrypted local folder results are decrypted through the desktop bridge before synthesis.
    - `mode` 'query' — Search mode discriminator
  - WebSearchRequestWithMode
    - `query` string, required — Search query
    - `num_results` integer — Number of results
    - `category` string, nullable — Filter by category: github, company, research, news, tweet, pdf, blog
    - `days_back` integer, nullable — Only show results from last N days
    - `find_similar_to` string, nullable — URL to find similar content to
    - `mode` 'web' — Search mode discriminator
  - DeepResearchRequestWithMode
    - `query` string, required — Research question
    - `output_format` string, nullable — Optional structure hint
    - `verbose` boolean — Include verbose trace output
    - `mode` 'deep' — Search mode discriminator
  - UniversalSearchRequestWithMode
    - `query` string, required — Natural language search query
    - `top_k` integer — Total number of results
    - `include_repos` boolean — Include repository sources
    - `include_docs` boolean — Include documentation sources
    - `include_huggingface_datasets` boolean — Include HuggingFace dataset sources (excluded by default to prevent search pollution)
    - `alpha` number — Weight for vector search (0.7 = 70% vector)
    - `compress_output` boolean — Use AI to compress results
    - `max_sources` integer — Max source namespaces to deep search
    - `sources_for_answer` integer — Number of results to use for AI answer
    - `bypass_cache` boolean — Skip cache and force fresh search results
    - `max_tokens` integer, nullable — Maximum tokens in response. Results truncated when budget reached.
    - `boost_source_types` object — Source type boosts (override to customize or set {} to disable)
    - `boost_languages` string[], nullable — Programming languages to boost (e.g., ['python', 'typescript'])
    - `language_boost_factor` number — Boost multiplier for preferred languages
    - `use_native_boosting` boolean — Use TurboPuffer FTS v2 native Sum/Product boosting
    - `semantic_cache_threshold` number — Minimum similarity for semantic cache hit (0.8-1.0)
    - `bypass_semantic_cache` boolean — Skip semantic cache (L2) lookup
    - `expand_symbols` boolean — Extract function/class names from results and search for usages (cAST-inspired)
    - `mode` 'universal' — Search mode discriminator

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nozomio-labs/apis/nia-ai-api.md) · [All operations](https://skmtc.net/nozomio-labs/apis/nia-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nozomio-labs/nia-ai-api/revisions/dbb602a3ef17/schema)
