⚠️ Experimental — This resource is part of the Guild platform and may change in future releases.
Manages a knowledge document ingested into the Guild knowledge hub. The provider downloads source_url, uploads the file to Guild, then the server parses it via Docling, chunks it, and indexes it for semantic search by agents. Use knowledge_base_id to target a user-defined base from sg_knowledge_base.
# The provider downloads from source_url and uploads bytes to Guild for indexing.
resource "sg_knowledge_document" "example" {
source_url = "https://example.com/docs/runbook.pdf"
}
# Optional knowledge_base_id targets a user base; omit to use the built-in organization default.
resource "sg_knowledge_document" "into_base" {
source_url = "https://example.com/docs/runbook.pdf"
knowledge_base_id = sg_knowledge_base.example.id
}
Import an existing sg_knowledge_document using its document UUID or document_id |
source_url: |
terraform import sg_knowledge_document.example '123e4567-e89b-12d3-a456-426614174000|https://example.com/runbook.md'
Prefer document_id|source_url so HCL source_url matches state after import.
Guild does not return the original Terraform source_url. Prefer import ID document_id|source_url so the first plan does not force replacement. Document bytes cannot be reconstructed from the API.
source_url (String) HTTP(S) URL to download the document from before upload. The provider fetches the bytes and sends them to Guild as a multipart upload, preserving the URL basename (or Content-Disposition filename) so Guild can detect the file type. Changing forces replacement.knowledge_base_id (String) Target knowledge base UUID for the upload. When omitted, Guild uses the built-in Organization Knowledge base. Changing forces replacement.knowledge_type (String) Content classification: KNOWLEDGE or RUNBOOK. Sent on upload; defaults to KNOWLEDGE when omitted.chunk_count (Number) Number of vector chunks after processing.content_type (String) MIME type of the document.document_id (String) Server-assigned knowledge document ID (UUID).filename (String) Original filename of the ingested document.knowledge_base_name (String) Display name of the knowledge base that owns the document.size_bytes (Number) File size in bytes.status (String) Processing status (pending/processing/ready/failed).