Class RagSearch.Builder

java.lang.Object
ai.vectros.types.RagSearch.Builder
Enclosing class:
RagSearch

public static final class RagSearch.Builder extends Object
  • Method Details

    • from

      public RagSearch.Builder from(RagSearch other)
    • mode

      Retrieval mode: HYBRID combines keyword and semantic search, SEMANTIC uses vector similarity only, TEXT uses keyword (BM25) matching only. Defaults to HYBRID.

    • mode

      public RagSearch.Builder mode(RagSearchMode mode)
    • limit

      public RagSearch.Builder limit(Optional<Integer> limit)

      Maximum number of results to retrieve before building the prompt. Defaults to 10; the maximum is 50.

    • limit

      public RagSearch.Builder limit(Integer limit)
    • filters

      public RagSearch.Builder filters(Optional<Map<String,FilterValue>> filters)

      Field filters to apply to your indexed content, as a map of field name to required value.

    • filters

      public RagSearch.Builder filters(Map<String,FilterValue> filters)
    • userId

      public RagSearch.Builder userId(Optional<String> userId)

      Restrict retrieval to content owned by this user id.

    • userId

      public RagSearch.Builder userId(String userId)
    • scope

      public RagSearch.Builder scope(Optional<String> scope)

      Restrict retrieval to content carrying this scope value, in namespace:value form — for example group:eng-team, org:<id>, or client:<id>. Resolve an entity's UUID from your own identifier via GET /v1/entities/{namespace}?externalId=.

    • scope

      public RagSearch.Builder scope(String scope)
    • contentTypes

      public RagSearch.Builder contentTypes(Optional<List<RagSearchContentTypesItem>> contentTypes)

      Narrow retrieval to specific content types. When omitted, both documents and records are searched — records are valid grounding content too (for example, structured patient data or intake forms). Pass ["documents"] for documents only or ["records"] for records only. Each retrieved result carries a sourceType field indicating which type it is.

    • contentTypes

      public RagSearch.Builder contentTypes(List<RagSearchContentTypesItem> contentTypes)
    • folderId

      public RagSearch.Builder folderId(Optional<String> folderId)

      Restrict retrieval to content (documents or records) in this exact folder. Folders are a unified organizational primitive and may hold mixed content. Provide the UUID of a folder. To include a folder and all of its descendants instead, use rootFolderId.

    • folderId

      public RagSearch.Builder folderId(String folderId)
    • rootFolderId

      public RagSearch.Builder rootFolderId(Optional<String> rootFolderId)

      Restrict retrieval to content under this subtree — the folder and all of its descendants. Provide the UUID of a top-level (root) folder. Applies uniformly to documents and records. Use folderId to scope to a single folder exactly.

    • rootFolderId

      public RagSearch.Builder rootFolderId(String rootFolderId)
    • typeName

      public RagSearch.Builder typeName(Optional<String> typeName)

      Restrict retrieval to content of a specific schema type — for example patient or runbook. Applies to both documents and records: any item whose bound schema type matches is kept. On its own it narrows both content types to that type; combine it with contentTypes to narrow within a single content type. Untyped content (ingested without a schema) never matches.

    • typeName

      public RagSearch.Builder typeName(String typeName)
    • createdAfter

      public RagSearch.Builder createdAfter(Optional<String> createdAfter)

      Restrict retrieval to content created at or after this ISO-8601 UTC timestamp. Useful for incremental retrieval (for example, answering based only on content ingested today). Pair with createdBefore to define a time window.

    • createdAfter

      public RagSearch.Builder createdAfter(String createdAfter)
    • createdBefore

      public RagSearch.Builder createdBefore(Optional<String> createdBefore)

      Restrict retrieval to content created at or before this ISO-8601 UTC timestamp. Pair with createdAfter to define a time window, or use alone to scope retrieval to content older than a cutoff.

    • createdBefore

      public RagSearch.Builder createdBefore(String createdBefore)
    • requireComplete

      public RagSearch.Builder requireComplete(Optional<Boolean> requireComplete)

      Require complete retrieval. When true, if a search backend is unavailable the request returns HTTP 503 before any answer is streamed, rather than grounding the answer on partial results. Defaults to false, in which case an outage degrades to the surviving search engine and the search_results event reports degraded: true. Set this to true when an answer grounded on incomplete retrieval is unacceptable.

    • requireComplete

      public RagSearch.Builder requireComplete(Boolean requireComplete)
    • build

      public RagSearch build()
    • additionalProperty

      public RagSearch.Builder additionalProperty(String key, Object value)
    • additionalProperties

      public RagSearch.Builder additionalProperties(Map<String,Object> additionalProperties)