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
- CompileKnowledges
- AddKnowledge(Knowledges)
- AddKnowledge(id-content)
- AddKnowledge(id-contents)
- RemoveKnowledge
- GetKnowledges
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
| Parameter | Type | Description |
|---|---|---|
| newKnowledge | Knowledges | The 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 toknowledge/new. If the ID has no knowledge/ prefix, one will be added.
Parameters
| Parameter | Type | Description |
|---|---|---|
| knowledgeID | string | Identifier for the knowledge entry. |
| content | string | Content 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
| Parameter | Type | Description |
|---|---|---|
| knowledgeID | string | Identifier for the knowledge entry. |
| content | List<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
| Parameter | Type | Description |
|---|---|---|
| title | string | Title 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.