Add structured metadata to your documents for precise filtering and targeted queries, supercharging your search experience with file type, owner, and custom (upto 15) fields.
Metadata is the foundation of intelligent document retrieval and context-aware search in Cortex. By attaching structured information to your documents, you enable precise filtering, multi-tenant isolation, and sophisticated query capabilities that transform how users interact with your knowledge base.Note: For uploads, use the fields tenant_metadata and document_metadata (with the same schema as the original metadata field) to attach this information. These fields are not used in the QnA endpoint.
Key Immutability: Once you define tenant metadata keys during tenant creation, they cannot be changed. This ensures organizational consistency and prevents accidental schema drift.Value Consistency: All documents within a tenant share the same tenant metadata values, providing consistent organizational context.
// ✅ Set during tenant creation - keys become immutable{ "tenant_metadata_schema": [ {"key": "department", "type": "string", "searchable": true}, {"key": "compliance_framework", "type": "string", "searchable": true}, {"key": "data_classification", "type": "string", "searchable": false} ]}// ✅ All documents in this tenant will have these same values{ "tenant_metadata": { "department": "Engineering", "compliance_framework": "SOC2", "data_classification": "internal" }}
Complete Flexibility: Document metadata keys and values can be different for every document, allowing rich, varied document descriptions.Runtime Mutability: You can change document metadata values during updates without any restrictions.
Is this attribute the same for ALL documents in your tenant?├─ YES → Use tenant_metadata│ ├─ Department: "Engineering" ✅│ ├─ Compliance: "SOC2" ✅│ └─ Business Unit: "Product" ✅└─ NO → Use document_metadata ├─ Title: "API Security Guidelines" ✅ ├─ Author: "Dr. Sarah Chen" ✅ ├─ Status: "Draft" ✅ └─ Tags: ["security", "api"] ✅
The following keywords are reserved and cannot be used as keys in tenant_metadata_schema:
source_id
source_title
source_url
source_type
source_collection
source_owner
source_collaborator
source_upload_time
source_last_updated_time
chunk_id
chunk_uuid
chunk_content
document_metadata
base_metadata
layout
description
Important: These keywords are used internally by Cortex for document processing and search functionality. Using any of these reserved keywords as tenant metadata keys will result in an error during tenant creation.
You’re indexing thousands of company files. A user asks, “Which PDF did John upload in March about pricing?” The AI uses metadata like file type = PDF, uploader = John, and upload_date = March to find the right document instantly.With proper metadata structure, you can create sophisticated filtering scenarios:
// User query: "Show me all high-priority engineering documents from last quarter"{ "tenant_metadata": { "department": "Engineering" }, "document_metadata": { "priority": "high", "created_date": "2024-01-01" // Would be filtered by date range }}
This metadata-driven approach enables precise, context-aware search that goes far beyond simple keyword matching, providing enterprise-grade document management capabilities that scale with your organization’s needs.