KnowledgeModule | Inherits from: InworldFrameworkModule
Module for managing knowledge bases and information retrieval within the Inworld framework. Provides functionality for compiling, storing, and querying knowledge content for AI interactions. Integrates with text embedding services for semantic search and knowledge matching.
Properties
Events
Methods
Reference
CompileConfig
Gets the compile configuration for knowledge processing. Returns null if the module is not properly configured.Returns
Type:KnowledgeCompileConfig
Description: The knowledge compilation configuration instance, or null if not configured.
MaxCharsPerChunk
Gets or sets the maximum number of characters per knowledge chunk. Affects how knowledge content is divided during compilation.Returns
Type:int
Description: The maximum characters per chunk setting.
MaxChunksPerDoc
Gets or sets the maximum number of chunks per document. Limits the granularity of knowledge segmentation during compilation.Returns
Type:int
Description: The maximum chunks per document setting.
OnKnowledgeRemoved
Event triggered when knowledge content has been removed from the knowledge base.Parameters
OnKnowledgeCompiled
Event triggered when knowledge content has been compiled and chunked. Provides the knowledge ID and the resulting list of compiled chunks.Parameters
OnKnowledgeRespond
Event triggered when knowledge retrieval responds with relevant information. Provides the list of knowledge chunks that match the query.Parameters
SetupEmbedder
Sets up the text embedder interface for semantic knowledge processing. Required for advanced knowledge matching and retrieval operations.Parameters
Returns
Type:void
RemoveKnowledge
Removes knowledge content from the knowledge base. Triggers OnKnowledgeRemoved event if the removal is successful.Parameters
Returns
Type:bool
Description: True if the knowledge was successfully removed, false otherwise.
CompileKnowledges
Compiles raw knowledge content into processable chunks. Breaks down large knowledge documents into smaller, searchable segments. Triggers OnKnowledgeCompiled event with the resulting chunks.Parameters
Returns
Type:List<string>
Description: List of compiled knowledge chunks, or null if compilation failed.
GetKnowledges
Retrieves relevant knowledge content based on provided knowledge IDs and optional event history. Performs semantic matching to find the most relevant knowledge for the current context. Triggers OnKnowledgeRespond event with the retrieved knowledge.Parameters
Returns
Type:List<string>
Description: List of relevant knowledge strings, or null if retrieval failed.
Serialized Fields
The following fields are configurable in the Unity Inspector:- m_MaxCharsPerChunk (
int) - Maximum number of characters per knowledge chunk (default: 200) - m_MaxChunksPerDoc (
int) - Maximum number of chunks per document (default: 100)