BaseEntityStore#

class langchain.memory.entity.BaseEntityStore[source]#

Bases: BaseModel, ABC

Abstract base class for Entity store.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

abstract clear() None[source]#

Delete all entities from store.

Return type:

None

abstract delete(key: str) None[source]#

Delete entity value from store.

Parameters:

key (str) –

Return type:

None

abstract exists(key: str) bool[source]#

Check if entity exists in store.

Parameters:

key (str) –

Return type:

bool

abstract get(key: str, default: str | None = None) str | None[source]#

Get entity value from store.

Parameters:
  • key (str) –

  • default (str | None) –

Return type:

str | None

abstract set(key: str, value: str | None) None[source]#

Set entity value in store.

Parameters:
  • key (str) –

  • value (str | None) –

Return type:

None