Skip to content
Plain Help Center home
Plain Help Center home

Knowledge Sources

Plain AI becomes significantly more powerful when it can draw on your support documentation. By indexing your docs, you give Suggested Responses deeper, more accurate context – making it easier to answer complex questions quickly, consistently, and confidently.

Ways to index your docs

You can index documentation in two ways:

  1. Via the Plain web UI
    Navigate to Settings → Knowledge Sources and add individual URLs directly.

  2. Via the Plain CLI
    Use the CLI to index documentation programmatically – ideal for bulk updates or automation.

With the CLI, you can index:

– A single URL
– A sitemap URL (each page listed in the sitemap will be indexed)
– Optionally: associate each document with a label type ID (more on that below)

📘 For setup instructions, see the Plain CLI documentation. To index multiple URLs at once, use plain index-sitemap.

Using Labels to improve response relevance

You can provide a label type ID when indexing a document. This ensures that Plain AI only uses that documentation when a support thread has the same label type applied.

This is especially useful if:

– You support multiple products, each with its own docs
– You want to control which docs are surfaced for different issue types or customer tiers

This level of targeting improves the accuracy of suggested responses and avoids surfacing irrelevant content.

Automating indexing with GitHub Actions

To keep your indexed content up to date, you can schedule the Plain CLI to re-index your sitemap regularly – ensuring Plain AI always has the freshest context.

Here’s an example GitHub Action that re-indexes your docs every 3 hours:

name: Index docs on: schedule: - cron: '0 */3 * * *' jobs: index: name: Index Documents runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '22' - name: Install CLI run: npm install -g @team-plain/cli@latest - name: Index Documents run: plain index-sitemap https://www.plain.com/docs/sitemap.xml env: PLAIN_API_KEY: ${{ secrets.PLAIN_API_KEY }}

Required Permissions

The PLAIN_API_KEY needs this permission:

indexedDocument:create