# Knowledge resources

> A knowledge resource is governed content that AI nodes read, such as a taxonomy, a dataset or a policy. Publishing it records a numbered version, bindings show where it is used, and Git Sync can keep it in a repository.

Source: https://docs.sommatic.ai/en/ai/knowledge-resources/ (updated 2026-11-26)

A knowledge resource is what your AI nodes know that the model does not: the categories you triage into, the registry
you match against, the policy a decision must follow. It lives once in your organization, with an owner and a review
state, and every node that needs it points to it.

## Resource types

`resource_type` says what the content is:

| `resource_type` | Typical content                                                  |
| --------------- | ---------------------------------------------------------------- |
| `text`          | Free text.                                                       |
| `document`      | A document or a file reference.                                  |
| `list`          | A list of values.                                                |
| `taxonomy`      | Categories and subcategories.                                    |
| `prompt`        | Structured prompt blocks (`system`, `instructions`, `examples`). |
| `policy`        | Rules that a decision must follow.                               |
| `manual`        | Operating instructions.                                          |
| `dataset`       | A small structured dataset.                                      |
| `reference`     | A pointer to an external or internal source.                     |

You can start a resource blank, from text, from a file or from structured data.

## Content

`content` holds the payload, in one of these formats (`content.format`): `plain-text`, `markdown`, `json`,
`file-reference`, `prompt-blocks` or `url`.

| Field             | Used for                                                                                          |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| `text`            | Plain or Markdown text.                                                                           |
| `structured_data` | JSON for lists, taxonomies, rules or datasets.                                                    |
| `file_ref`        | A stored file: `file_name`, `mime_type`, `storage_key`, `document_uri`, `checksum`, `size_bytes`. |
| `prompt_blocks`   | `system`, `instructions` and `examples` when the type is `prompt`.                                |
| `url`             | A link, when the content is a reference.                                                          |

Next to the content, a resource carries:

- **Governance** (`governance`): owner user or team, `visibility_scope` (`private`, `team`, `organization`),
  `review_status` (`draft`, `reviewed`, `approved`, `rejected`), `is_authoritative`, and the dates `effective_from`,
  `effective_to` and `expires_at`.
- **Capabilities** (`capabilities`): `allowed_usage_modes` (`retrieval`, `context`, `instruction`, `routing`,
  `validation`, `few-shot`, `reference`), `is_searchable`, `is_bindable`, `is_version_locked`.
- **Source** (`source`): where it comes from, with `sync_mode` `manual`, `synced` or `imported`.
- `language`, `tags` and `git_binding` (filled by Git Sync).

## Publish a version

A resource is `draft`, `active` or `archived`. Publishing it does two things:

1. It stores an immutable snapshot of the current `content` as the next version (`1`, `2`, `3`…), with an optional
   `description`.
2. It sets the resource to `active`.

### Edit the resource

In the portal, open **Cognitive Assets → Knowledge Center**, then the resource. Edit it in the **Knowledge Editor**
tab and save.

### Publish

Publish from the editor. Through the API:
`POST /cognitive-infrastructure/cognitive-assets/knowledge-resource/:id/publish`.

### List the versions

`GET /cognitive-infrastructure/cognitive-assets/knowledge-resource/versions?search=<resource_id>` returns every
snapshot with its `version`, `content` and, when it came from Git, the commit.

> **Warning: Nodes read the current content**
>
> An AI node loads the resource itself when it runs, not a published snapshot. A saved edit reaches the next run right
> away. Nodes warn when the resource is not `active` and fail when it was deleted. Versions are your history and your
> audit trail; review before you save.

## Use it in a node

Nodes that read a resource expose `knowledge_resource_id`, with a picker filtered by the types they accept:

| Node                                                                                | Resource it expects                                                          |
| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [`ai.classify.triage`](https://docs.sommatic.ai/en/nodes/ai.classify.triage.md)     | A `taxonomy` with the categories and subcategories of the triage (required). |
| [`ai.classify.registry`](https://docs.sommatic.ai/en/nodes/ai.classify.registry.md) | A `dataset` to classify against (required).                                  |
| [`ai.topics`](https://docs.sommatic.ai/en/nodes/ai.topics.md)                       | A `taxonomy` of topics.                                                      |

## Bindings

A binding records that a resource is used somewhere. It has `resource_id`, `target_type`, `target_id`, a `role` and a
`mode`:

| Field         | Values                                                                                              |
| ------------- | --------------------------------------------------------------------------------------------------- |
| `target_type` | `project`, `workflow`, `workflow-node`, `agent-profile`, `app`, `conversation`, `report`, `anomaly` |
| `role`        | `knowledge`, `policy`, `instructions`, `dataset`, `template`, `reference`                           |
| `mode`        | `retrieval`, `context`, `both`, `instruction`, `routing`, `validation`                              |

When you save a draft in the workflow studio, Sommatic AI keeps the bindings of that workflow in step with its nodes: one
binding per resource that a node references (`target_type: workflow`, `role: knowledge`, `mode: context`), removed
when no node uses the resource any more. The resource page lists its bindings, so you can see which workflows depend on
it before you change it.

## Keep it in Git

Knowledge resources sync with [Git Sync](https://docs.sommatic.ai/en/git-sync.md) like workflows. In the repository, a resource file carries the
resource fields (`name`, `slug`, `resource_type`, `content`…) and the header
`{ "sommatic": { "kind": "knowledge-resource", "key": "…", "schema_version": "1.0" } }`, and the package manifest lists
it under `resources.knowledge`.

In the resource page, the **…** menu offers **Sync from Git…** (load the file into the editor, then save and publish)
and **Export for Git…** (the file, manifest entry and environment entry, ready for a pull request). A sync from Git can
publish in the same step, and the version then records the repository, branch and commit it came from.

## Next steps

- [Git Sync](https://docs.sommatic.ai/en/git-sync.md): Review knowledge changes in pull requests.
- [AI nodes](https://docs.sommatic.ai/en/nodes/family/ai.md): The nodes that read knowledge resources.
- [API reference](https://docs.sommatic.ai/en/api/reference/cognitive-infrastructure.md): Resources, versions and bindings.
