Knowledge Source
Knowledge Sources provide contextual information, documentation, and domain knowledge for AI agents. They are referenced by Instruction Configurations (1:N relationship) and support intelligent storage tier management for cost optimization.
Schema: KnowledgeSourceSchema
Source: src/core/service-configuration/knowledge.schema.ts
Attributes​
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | — | — | Unique identifier for the knowledge source |
name | string | Yes | — | Human-readable name |
sourceType | enum | Yes | — | Type of knowledge source. One of DOCUMENT, URL, BUSINESS_WEBSITE, CORPUS, or BATCH_DOCUMENT. |
request_success | boolean | Yes | — | Whether initial processing succeeded |
processingStatus | enum | No | PENDING | Current processing status. One of PENDING, PROCESSING, COMPLETED, or FAILED. |
content | string | null | No | — | Raw extracted content (inline) |
prepped_content | string | null | No | — | Processed content optimized for AI |
content_path | string | null | No | — | Storage path for raw content |
prepped_content_path | string | null | No | — | Storage path for processed content |
original_content_url | string | null | No | — | Original source URL |
stored_content_url | string | null | No | — | Cloud storage URL for raw content |
prepped_content_url | string | null | No | — | Cloud storage URL for processed content |
content_size | number | No | — | Size of raw content in bytes |
prepped_content_size | number | No | — | Size of processed content in bytes |
storage_tier | enum | No | FIRESTORE | Current storage tier. One of FIRESTORE or CLOUD_STORAGE. |
last_accessed | number | No | — | Last access timestamp |
access_count | number | No | 0 | Access count for tier optimization |
is_compressed | boolean | No | false | Whether content is compressed |
compression_ratio | number | No | — | Compression ratio achieved |
metadata | object | No | {} | Additional metadata |
original_content_type | string | null | No | — | Original MIME type |
content_hash | string | null | No | — | Content hash for deduplication |
createdAt | number | — | — | Unix timestamp when created |
updatedAt | number | — | — | Unix timestamp when last updated |
Example​
{
"id": "kb_abc123",
"name": "Product Documentation",
"sourceType": "DOCUMENT",
"request_success": true,
"processingStatus": "COMPLETED",
"content": "Raw document content...",
"prepped_content": "Processed and optimized content...",
"storage_tier": "FIRESTORE",
"access_count": 42,
"is_compressed": false,
"createdAt": 1709856000000,
"updatedAt": 1709856000000
}
Related​
- Instruction Configuration - References knowledge sources via
knowledgeSourceIds