Configuration¶
To leverage memory modules in your assistant, you need to define their configurations in a YAML file. This configuration specifies the types of memory modules and their parameters, allowing your assistant to store and access different kinds of information.
Parameters¶
memory_config: Top-level key for memory module configurations.embedding_config: Global configuration of the embedding model. If omitted, the default embedding model is used. This configuration applies to modules that require embedding inference during memory operations, unless a module explicitly specifies a different embedding model.model: Embedding model identifier. See supported embedding models.
memory_modules: A list of memory modules to integrate. Currently supported memory modules includeChatMemoryModule,VariableMemoryModule, andMemTreeModule.memory_name: A unique identifier for the memory module.memory_class: The class name of the memory module.config: Additional parameters specific to the memory module.
Note: Among the currently available memory modules, only
MemTreeModuleperforms embedding inference. As more modules adopt embedding inference over time, you can configure the embedding model either globally or per module (see MemTreeModule per-module setup). Per-module settings take precedence and override the global configuration.
Here’s an example configuration (config.yaml):
# To customize the memory configuration, define memory_config and list the desired modules under memory_modules.
# Otherwise, omit this block to use the default configuration.
memory_config:
embedding_config: # Optional. Global embedding model configuration.
model: "Qwen/Qwen3-Embedding-0.6B" # Required if embedding_config is set. Embedding model identifier.
memory_modules: # Required if memory_config is set. List of memory modules to enable.
# Optional. Add this entry only if you want to override ChatMemoryModule defaults.
# Required fields in this entry: memory_name, memory_class.
- memory_name: chat_history # Required. Unique identifier for this memory module.
memory_class: ChatMemoryModule # Required. Memory module class.
config: # Optional. Per-module configuration.
n_rounds: 5 # Optional. Number of conversation rounds to retrieve. Must be a positive integer. Defaults to 3.
max_context: 5000 # Optional. Max total character count for retrieved history. Must be a positive integer. Defaults to 10,000.
# Optional. Add this entry only if you want to override VariableMemoryModule defaults.
# Required fields in this entry: memory_name, memory_class.
- memory_name: env_variable # Required. Unique identifier for this memory module.
memory_class: VariableMemoryModule # Required. Memory module class.
config: # Optional. Per-module configuration.
max_context: 5000 # Optional. Max total character count for retrieved env variables. Must be a positive integer. Defaults to 10,000.
variables: # Optional. Key-value variables to preload. Defaults to empty.
event_title: "FIFA World Cup"
event_year: "2022"
supporting_team: "Brazil"
main_competitors: "Argentina, Germany, France"
# Optional. Add this entry only if you want to customize MemTreeModule.
# Required fields in this entry: memory_name, memory_class.
- memory_name: chat_history_memtree # Required. Unique identifier for this memory module.
memory_class: MemTreeModule # Required. Memory module class.
config: # Optional. Per-module configuration.
top: 3 # Optional. Number of top similar nodes to retrieve. Defaults to 3.
max_depth: 2 # Optional. Maximum tree depth. Defaults to -1 (unlimited).
threshold: 0.3 # Optional. Similarity cutoff for retrieval. Defaults to 0.2.
max_context: 4000 # Optional. Max total character count for retrieved memory. Defaults to 10,000.
embedding_config: # Optional. Per-module embedding config (takes precedence over global).
model: "Qwen/Qwen3-Embedding-0.6B" # Required if embedding_config is set.