Skip to main content
Within Plain, you can add knowledge sources such as your documentation or marketing website. Your agent can then search through your knowledge sources by using the searchKnowledgeSources query. There are 2 kinds of knowledge sources in Plain:
  • Help Center articles published in Plain’s Help Center
  • Indexed documents you have added as knowledge sources, such as your docs site or your marketing website.
The API needs the knowledgeSource:read permission to be able to do this.

Example query

The return type is a union. Narrow it with __typename. See union types. The page size (pageSize) defaults to 10 and accepts 1–50. searchQuery is 1–1000 characters. Keep the article title or document URL if you want the agent to cite its sources.

Options

string[]
required
Include “INDEXED_DOCUMENT” if you want to include external knowledge sources added to Plain.Include “HELP_CENTER_ARTICLE” if you want to include Plain-hosted Help Center articles.
string[]
required
A list of label type IDs. When provided, knowledge sources will be filtered to only include knowledge sources with these labels.labelTypeIds without types searches indexed documents only. Labels don’t apply to Help Center articles.
boolean
default:false
required
Whether to include Help Centers that are not public.