Skip to main content
Overview > KnowledgeData Class: KnowledgeData | Inherits from: ScriptableObject ScriptableObject that manages a collection of knowledge entries for AI character systems. Use this to define factual information and context your character can reference.

Nested Types

Properties

Methods

Reference

Knowledges

Represents a knowledge entry with title and content.

Fields

  • title (string): Identifier for this knowledge entry.
  • content (List<string>): Content lines for this knowledge entry.

Methods

  • CompileKnowledge()List<string>: Compiles this entry using the framework’s knowledge system.

knowledges (collection)

The collection of knowledge entries managed by this asset.

Type

List<Knowledges>

IDs

List of all knowledge identifiers (titles) contained in this asset.

Type

List<string> (read-only)

CompileKnowledges

Compiles all knowledge entries into a unified knowledge base.

Returns

List<string> — The compiled knowledge strings, or null if the knowledge system is unavailable.

AddKnowledge (Knowledges)

Adds a new knowledge entry to the collection and recompiles the knowledge base.

Parameters

ParameterTypeDescription
newKnowledgeKnowledgesThe new knowledge entry to add.

Returns

List<string> — The compiled knowledge strings after the addition.

AddKnowledge (id, content)

Adds or updates a single content item for a specific knowledge identifier. If the ID is empty, it defaults to knowledge/new. If the ID has no knowledge/ prefix, one will be added.

Parameters

ParameterTypeDescription
knowledgeIDstringIdentifier for the knowledge entry.
contentstringContent string to add.

Returns

List<string> — The compiled knowledge strings after the update.

AddKnowledge (id, contents)

Adds or updates multiple content items for a specific knowledge identifier. Applies the same prefix rules as above.

Parameters

ParameterTypeDescription
knowledgeIDstringIdentifier for the knowledge entry.
contentList<string>Content strings to add.

Returns

List<string> — The compiled knowledge strings after the update.

RemoveKnowledge

Removes a knowledge entry from the collection by its title identifier and also removes it from the framework’s knowledge system if available.

Parameters

ParameterTypeDescription
titlestringTitle identifier of the knowledge entry to remove.

GetKnowledges

Retrieves the compiled knowledge data for all knowledge entries managed by this asset.

Returns

List<string> — The compiled knowledge strings for all entries, or null if the knowledge system is unavailable.