Quick Start

query Search {
  search(
    searchInput: {
      searchQuery: "How do I get started?"
      organizationId: "<YOUR_ORG_ID>"
      integrationId: "<YOUR_INTEGRATION_ID>"
      filters: {}
      searchMode: AUTO
    }
  ) {
    searchHits {
      id
      preview
      title
      url
    }
  }
}

Want to try out a REST version of our API? Contact us at support@inkeep.com for the documentation. It's a native proxy on top of our GraphQL API with equivalent functionality.

Reference

search

ArgumentTypeDescription
searchInputSearchInputRequired. The search parameters that will be used in the query.

Input Types

SearchInput

PropertyTypeDescription
searchQueryString!Required. The search query string.
organizationIdID!Required. The ID of the organization.
integrationIdIDThe ID of the integration.
searchModeSearchModeThe mode of the search (AUTO, KEYWORD, INTELLIGENT).
filtersSearchFiltersInputThe search filters input.

SearchFiltersInput

When we ingest content, we add metadata to the content that is filterable in our search and chat APIs.

For example, if you have multiple products or version your product, you can “scope” the search results if you know the product or product version that the user is interested in.

This might be based on:

  • the URL the user is viewing
  • a product or version picker in your docs or chat UX
  • in-app context you have about the user, like which products or versions they use

By default, we label source documents with a product and product version if it can be inferred from your HTML or URL structure.

If you use our ingestion APIs, you can add your own ‘attributes’ that are filterable to the source documents and create your own filter queries based on that.

PropertyTypeDescription
productStringThe product name. Used to scope the response to content relevant to a specific product.
productVersionStringThe product version name. Used to scope the response to content relevant to a specific product version.
sourceIdsStringThe source IDs.
attributesJSONThe attributes.
limitIntThe maximum number of search results to return. Defaults to 40.

Filter attributes

Our attributes filtering schema is based on MongoDB’s query and projection operators. We currently support $in, $not, $and and $or operators or conditions.

The attributes value should be valid within this schema. See an example below

{
  "attributes": {
    "$and": [
      { "env": "production" },
      { "modules": { "$in": ["module1", "module2"] } }
    ]
  }
}

Note that all filters are assumed to follow $and and by exclusive by default, unless using the $or operator.

That is, sources not meeting those filters will not be used in the chat response.

Filtering by URLs

You can filter by the URLs by using the recordUrlsByRegex and recordUrlsByExact patterns as illustrated below.

{
  "attributes": {
    "$and": [
      {
        "recordUrlsByRegex": {
          "$in": [".*inkeep.*"]
        }
      },
      {
        "recordUrlsByExact": {
          "$in": ["https://www.inkeep.com/product/1.0"]
        }
      }
    ]
  }
}

Enum Types

SearchMode

Values
AUTO
KEYWORD
INTELLIGENT

RecordType

Values
DOCUMENTATION

Note: The public API for other content sources like GitHub, StackOverflow, Discourse, and others is coming soon. Those sources are currently available in the Inkeep React or JS Widgets for everyone.

Object Types

SearchResult

PropertyTypeDescription
searchHits[SearchHit!]!An array of search hits.
searchQueryString!The search query that produced this search result.

SearchHit

PropertyTypeDescription
idID!A unique ID across all records and sources.
rootRecordSearchRootRecord!The root record for this hit.
hitOnRootBoolean!Indicates if the hit was on the root.
urlStringThe URL of the hit.
titleStringThe title of the hit.
previewStringA preview of the hit.

SearchRootRecord

PropertyTypeDescription
idID!A unique ID across all records and all sources.
titleStringThe title of the root record.
urlStringThe URL of the root record.
previewStringA preview of the root record.

Specific Hit Types

DocumentationHit

PropertyTypeDescription
idID!A unique ID across all records and sources.
rootRecordDocumentationRecord!The root document record for this hit.
urlStringThe URL of the hit document.
titleStringThe title of the hit document.
previewStringA preview of the text that generated the hit.
contentDocumentContentLevelThe content (‘chunk’) of the document section that resulted in the hit. This could be a breadcrumb, title, sub-section heading, paragraph, or table.
pathHeadings[DocumentContentLevel]!A list of document chunks starting from the level heading.
hitOnRootBoolean!Indicates if the hit was on the root document and not a specific sub-section of the document.

DocumentationRecord

PropertyTypeDescription
idID!A unique ID across all records and all sources.
titleStringThe title of the record.
urlStringThe URL of the record.
previewStringA preview of the record.
pathBreadcrumbs[String!]!An array representing the breadcrumb path for the record. Example: ["Docs", "Version 8", "API"]
contentTypeString!The content type of the record Example: ‘Blog’.
topLevelHeadings[DocumentContentLevel]!The top-level headings of the document (likely to be h2 elements)
firstContentPath[DocumentContentLevel]!The path to the first content (chunk) in the document.
firstContentStringThe text of the first content (chunk) in the document.

DocumentContentLevel

PropertyTypeDescription
anchorStringThe anchor for the document content level.
urlStringThe URL of the document content level.
htmlTagString!The HTML tag of the content. Examples: ‘code’, ‘p’, ‘h1’, ‘h2’.
contentString!The raw text content of the document content level.