The kubiya_external_knowledge resource manages external knowledge integrations in the Kubiya platform. This resource allows you to connect external systems to the Kubiya RAG (Retrieval-Augmented Generation) system through a vendor-agnostic interface, enabling agents to access and learn from external data sources like Slack conversations, documentation systems, and other knowledge repositories.
External knowledge integrations supercharge your agents by providing access to historical conversations, institutional knowledge, and contextual information that makes responses more accurate and relevant.

Prerequisites

Before using this resource, ensure you have:
  1. A Kubiya account with API access
  2. An API key (generated from Kubiya dashboard under Admin → Kubiya API Keys)
  3. Access to the external system you want to integrate (e.g., Slack workspace)
  4. Appropriate permissions in the external system

Quick Start

resource "kubiya_external_knowledge" "slack_general" {
  vendor = "slack"
  config = {
    channel_ids = ["C1234567890"]  # General channel ID
  }
}

resource "kubiya_agent" "slack_aware_agent" {
  name         = "slack-aware-assistant"
  runner       = "kubiya-hosted"
  description  = "Agent with access to Slack knowledge"
  instructions = "You have access to historical Slack conversations. Reference relevant discussions when answering questions."
}

Configuration Examples

Set up knowledge integration for incident response and post-mortem analysis:
resource "kubiya_external_knowledge" "incident_channels" {
  vendor = "slack"
  config = {
    channel_ids = [
      "C9999999999",  # #incidents
      "CAAAAAAAAAA",  # #incident-postmortems
      "CBBBBBBBBBB"   # #incident-logs
    ]
  }
}

resource "kubiya_agent" "incident_historian" {
  name         = "incident-historian"
  runner       = "kubiya-hosted"
  description  = "Incident response knowledge agent"
  instructions = <<-EOT
    You have access to incident-related Slack channels.
    Use this knowledge to:
    - Provide context on past incidents
    - Identify patterns in recurring issues
    - Reference previous solutions
    - Help with post-mortem analysis
    - Suggest preventive measures based on history
  EOT
  
  integrations = ["slack", "pagerduty"]
  groups       = ["DevOps", "SRE", "Engineering"]
}

Advanced Configurations

Arguments Reference

Required Arguments

vendor
string
required
The vendor/provider for the knowledge integration. Currently supported values:
  • slack - Slack channel integrations
config
object
required
Dynamic configuration map with vendor-specific keys and values. The structure depends on the vendor being used.

Vendor-Specific Configuration

Slack Configuration

For vendor = "slack", the config object requires:
config.channel_ids
array
required
List of Slack channel IDs to integrate. Each ID should be in the format “C1234567890”. You can find channel IDs in Slack by:
  1. Right-clicking on a channel
  2. Selecting “Copy link”
  3. The ID is the part after “/channels/” in the URL
Example Slack configuration:
config = {
  channel_ids = ["C1234567890", "C0987654321"]
}

Attributes Reference

In addition to all arguments above, the following attributes are exported:
id
string
The unique identifier of the external knowledge integration.
org
string
The organization associated with the integration.
start_date
string
The start date from which knowledge is indexed.
integration_type
string
The type of integration (matches the vendor).
created_at
string
The timestamp when the integration was created.
updated_at
string
The timestamp when the integration was last updated.

How to Find Slack Channel IDs

1. Open Slack in your web browser
2. Navigate to the desired channel
3. Look at the URL: https://app.slack.com/client/T123/C1234567890
4. The channel ID is the part after the last slash (C1234567890)

Import

External knowledge integrations can be imported using their ID:
terraform import kubiya_external_knowledge.example <external-knowledge-id>

Best Practices

Channel Selection

  • Choose channels with valuable, relevant knowledge content
  • Avoid extremely high-volume channels that may create noise
  • Select channels with good signal-to-noise ratio
  • Consider the longevity and relevance of channel content

Privacy & Compliance

  • Ensure compliance with data privacy policies and regulations
  • Review channel content for sensitive information before integration
  • Implement appropriate access controls for sensitive knowledge
  • Regular audit of integrated channels and their content

Access Control

  • Limit agent access to sensitive knowledge integrations
  • Use groups to control which users can access specific knowledge
  • Regularly review and update access permissions
  • Implement least-privilege access principles

Performance & Maintenance

  • Monitor knowledge usage and relevance over time
  • Regular cleanup of obsolete or irrelevant integrations
  • Update channel lists as organizational structure changes
  • Test knowledge retrieval effectiveness in non-production environments

Knowledge Integration Patterns

# Separate integrations per team
resource "kubiya_external_knowledge" "frontend_team" {
  vendor = "slack"
  config = {
    channel_ids = ["C_FRONTEND_1", "C_FRONTEND_2"]
  }
}

resource "kubiya_external_knowledge" "backend_team" {
  vendor = "slack"
  config = {
    channel_ids = ["C_BACKEND_1", "C_BACKEND_2"]
  }
}

Compatibility

Requirements:
  • Kubiya Terraform Provider version >= 1.0.0
  • Terraform >= 1.0
  • Slack integration requires OAuth setup in Kubiya dashboard
  • Channel IDs must be valid and accessible
Processing Time:
  • Knowledge indexing may take time after initial creation
  • Historical data retrieval limits may apply based on platform tier
  • Large channels may require additional processing time
  • Changes to channel content are indexed incrementally
Important Considerations:
  • Ensure proper permissions in Slack workspace
  • Be aware of data privacy and compliance requirements
  • Monitor for sensitive information in indexed content
  • Consider impact on system performance with large integrations

Troubleshooting