CombinedMemory#

class langchain.memory.combined.CombinedMemory[source]#

Bases: BaseMemory

Combining multiple memories’ data together.

param memories: List[BaseMemory] [Required]#

For tracking all the memories that should be accessed.

async aclear() β†’ None#

Async clear memory contents.

Return type:

None

async aload_memory_variables(inputs: dict[str, Any]) β†’ dict[str, Any]#

Async return key-value pairs given the text input to the chain.

Parameters:

inputs (dict[str, Any]) – The inputs to the chain.

Returns:

A dictionary of key-value pairs.

Return type:

dict[str, Any]

async asave_context(inputs: dict[str, Any], outputs: dict[str, str]) β†’ None#

Async save the context of this chain run to memory.

Parameters:
  • inputs (dict[str, Any]) – The inputs to the chain.

  • outputs (dict[str, str]) – The outputs of the chain.

Return type:

None

clear() β†’ None[source]#

Clear context from this session for every memory.

Return type:

None

load_memory_variables(inputs: Dict[str, Any]) β†’ Dict[str, str][source]#

Load all vars from sub-memories.

Parameters:

inputs (Dict[str, Any])

Return type:

Dict[str, str]

save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) β†’ None[source]#

Save context from this session for every memory.

Parameters:
  • inputs (Dict[str, Any])

  • outputs (Dict[str, str])

Return type:

None

property memory_variables: List[str]#

All the memory variables that this instance provides.