Config
Core config objects for MemoryManagerConfigBuilder.
This module contains the public config object and its fluent builder implementation, while delegating subsections and shared helpers to sibling modules in this package.
MemoryManagerConfig(config, backend_key=MemoryProviderType.MEM0, backend_options=None)
Represent one immutable configuration payload for MemoryManager.
Attributes:
| Name | Type | Description |
|---|---|---|
_config |
dict[str, Any]
|
Core memory-engine configuration payload. |
_backend_key |
str
|
Internal backend key selected for the config. |
_backend_options |
dict[str, Any]
|
Backend-specific auxiliary options. |
Initializes a new instance of the MemoryManagerConfig class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any]
|
Underlying memory-engine config payload. |
required |
backend_key
|
str
|
Internal backend key selected by the library.
Defaults to |
MEM0
|
backend_options
|
dict[str, Any] | None
|
Internal backend-specific options. Defaults to None. |
None
|
builder()
classmethod
Create a fluent builder for MemoryManagerConfig.
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfigBuilder |
MemoryManagerConfigBuilder
|
New builder instance. |
get_backend_key()
Return the internal backend key selected for this config object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Internal backend key. |
get_backend_options()
Return a safe copy of the backend-specific options.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: Cloned backend-specific options. |
to_dict()
Return a safe copy of the core config payload.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: Cloned core config payload. |
MemoryManagerConfigBuilder()
Builder for MemoryManagerConfig.
Attributes:
| Name | Type | Description |
|---|---|---|
memory_store |
MemoryManagerStoreBuilder
|
Memory-store configuration helper. |
embedding |
MemoryManagerEmbeddingBuilder
|
Embedding configuration helper. |
llm |
MemoryManagerLLMBuilder
|
LLM registration helper. |
reranker |
MemoryManagerRerankerBuilder
|
Optional reranker configuration helper. |
knowledge_graph |
MemoryManagerKnowledgeGraphBuilder
|
Optional KG configuration helper. |
Initializes a new instance of the MemoryManagerConfigBuilder class.
Returns:
| Type | Description |
|---|---|
None
|
None |
build()
Build one MemoryManagerConfig object from the assembled config.
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfig |
MemoryManagerConfig
|
Built config object. |
build_config()
Build validated memory-engine config.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: Deep-copied config dictionary. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required sections are missing. |
conversation_store_path(conversation_store_path)
Set the path used for local conversation-state persistence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conversation_store_path
|
str
|
Local conversation-store path. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfigBuilder |
MemoryManagerConfigBuilder
|
The builder itself. |
merge_backend_option(key, value)
Merge one nested backend option payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Backend option key. |
required |
value
|
dict[str, Any]
|
Partial backend option payload. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfigBuilder |
MemoryManagerConfigBuilder
|
The builder itself. |
set_backend_option(key, value)
Set one backend option payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Backend option key. |
required |
value
|
dict[str, Any]
|
Backend option payload. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfigBuilder |
MemoryManagerConfigBuilder
|
The builder itself. |
set_provider_config(section, provider, config)
Set one provider section in the underlying config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
section
|
str
|
Section name such as |
required |
provider
|
str
|
Provider identifier. |
required |
config
|
dict[str, Any]
|
Provider config payload. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
MemoryManagerConfigBuilder |
MemoryManagerConfigBuilder
|
The builder itself. |