RedisEntityStore#
- class langchain.memory.entity.RedisEntityStore[source]#
Bases:
BaseEntityStore
Redis-backed Entity store.
Entities get a TTL of 1 day by default, and that TTL is extended by 3 days every time the entity is read back.
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.
- param key_prefix: str = 'memory_store'#
- param recall_ttl: int | None = 259200#
- param redis_client: Any = None#
- param session_id: str = 'default'#
- param ttl: int | None = 86400#
- delete(key: str) None [source]#
Delete entity value from store.
- Parameters:
key (str) –
- Return type:
None
- exists(key: str) bool [source]#
Check if entity exists in store.
- Parameters:
key (str) –
- Return type:
bool
- 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
- set(key: str, value: str | None) None [source]#
Set entity value in store.
- Parameters:
key (str) –
value (str | None) –
- Return type:
None
- property full_key_prefix: str#