Skip to main content
Call searchKnowledgeSources to search Help Center articles and indexed documents you already keep in Plain. It returns matching passages. Put those in your model prompt so the agent answers from your content. The API key needs knowledgeSource:read. Two kinds of source:
  • Help Center articles in Plain’s Help Center
  • Indexed documents you have indexed for AI (docs site, marketing pages)
The return type is a union. Narrow with __typename (or instanceof). See union types.
pageSize defaults to 10 (1–50). searchQuery is 1–1000 characters.

Use results in a prompt

content is the matched passage. Concatenate the top results:
Then reply, suggest, or note. Keep the article title or document URL if you want citations.

Options

Help Center only:
labelTypeIds without types searches indexed documents only. Labels do not apply to Help Center articles.

Resources