# KnowledgeCollection

> KnowledgeCollection is a Lighthouse collection: documents a workspace drops in, read into the workspace Rulebook and into text agents are given.

Source: https://docs.go-lumen.ai/he/reference/resources/knowledgecollection

## At a glance

| מאפיין | ערך |
| --- | --- |
| **apiVersion** | `lumen.ai/v1alpha1` |
| **kind** | `KnowledgeCollection` |
| **Resource name** | `knowledgecollections` |
| **Scope** | Namespaced (lives in a workspace's namespace) |
| **Short names** | `kc` |

## Spec

Fields under `spec:`. Nested fields are indented under their parent.

| Field | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `description` | string |  | (maxLength 1000) |
| `displayName` (חובה) | string |  | DisplayName is the title the UI shows. (minLength 1; maxLength 200) |
| `embeddingClassRef` | string |  | EmbeddingClassRef names the ModelClass (kind embedding) the search index is built with. Unused until the index exists (slice 3). (maxLength 253) |
| `maxDocuments` | integer | `500` | MaxDocuments caps the documents the collection holds. (minimum 1; maximum 500) |
| `mode` | string | `"auto"` | Mode is how an agent that names the collection is given it. (one of auto, inject, retrieve) |
| `retention` | object |  | KnowledgeRetention bounds how long replaced and deleted versions are kept. |
| `retention.deletedVersionsDays` | integer | `30` | DeletedVersionsDays is how long a replaced or deleted version's rows and file are kept before the sweep removes them. (minimum 0; maximum 3650) |
| `sensitive` | string | `"allow"` | Sensitive is what happens to a document with personal data in it. Documents are not screened yet (slice 2): allow is the only value admitted until they are, and the default. (one of hold, redact, allow) |

## Status

Written by Lumen; do not set it. Only the phase and the conditions are described here.

| Field | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `conditions` | list of object |  |  |
| `conditions[].lastTransitionTime` (חובה) | string |  | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
| `conditions[].message` (חובה) | string |  | message is a human readable message indicating details about the transition. This may be an empty string. (maxLength 32768) |
| `conditions[].observedGeneration` | integer |  | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions\[x\].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. (minimum 0) |
| `conditions[].reason` (חובה) | string |  | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. (minLength 1; maxLength 1024; pattern \`^\[A-Za-z\](\[A-Za-z0-9\_,:\]\*\[A-Za-z0-9\_\])?$\`) |
| `conditions[].status` (חובה) | string |  | status of the condition, one of True, False, Unknown. (one of True, False, Unknown) |
| `conditions[].type` (חובה) | string |  | type of condition in CamelCase or in foo.example.com/CamelCase. (maxLength 316; pattern \`^(\[a-z0-9\](\[-a-z0-9\]\*\[a-z0-9\])?(\\.\[a-z0-9\](\[-a-z0-9\]\*\[a-z0-9\])?)\*/)?((\[A-Za-z0-9\]\[-A-Za-z0-9\_.\]\*)?\[A-Za-z0-9\])$\`) |

## kubectl columns

| Column | Type | JSONPath |
| --- | --- | --- |
| Title | string | `.spec.displayName` |
| Mode | string | `.spec.mode` |
| Documents | integer | `.status.documents` |
| Ready | string | `.status.conditions[?(@.type=="Ready")].status` |
| Age | date | `.metadata.creationTimestamp` |

## Example

```yaml title="knowledgecollection.yaml"
apiVersion: lumen.ai/v1alpha1
kind: KnowledgeCollection
metadata:
  name: ops-bible
  namespace: tenant-acme
spec:
  displayName: "Operations bible"
  mode: inject
  sensitive: allow
  retention: {deletedVersionsDays: 30}
  maxDocuments: 500
```
