Nous.Memory.Scope (nous v0.15.4)

View Source

Shared scope-building logic for memory operations.

Both Nous.Plugins.Memory and Nous.Memory.Tools need to resolve a scope from config. This module extracts that common pattern.

Summary

Functions

Build a scope map from config based on the :default_search_scope setting.

Build a scope map from specific fields in config.

Functions

build(config)

@spec build(map()) :: :global | map()

Build a scope map from config based on the :default_search_scope setting.

Returns :global or a map of scoping fields extracted from config.

from_fields(config, fields)

@spec from_fields(map(), [atom()]) :: :global | map()

Build a scope map from specific fields in config.

Returns :global if no fields have values.