SQLiteEntityStore#
- class langchain.memory.entity.SQLiteEntityStore[source]#
Bases:
BaseEntityStore
Deprecated since version 0.3.1: Please see the migration guide at: https://python.langchain.com/docs/versions/migrating_memory/ It will not be removed until langchain==1.0.0.
SQLite-backed Entity store with safe query construction.
Initializes the SQLiteEntityStore.
- Parameters:
session_id – Unique identifier for the session.
db_file – Path to the SQLite database file.
table_name – Name of the table to store entities.
- param conn: Any = None#
- param session_id: str = 'default'#
- param table_name: str = 'memory_store'#
- delete(key: str) None [source]#
Deletes a key-value pair, safely quoting the table name.
- Parameters:
key (str)
- Return type:
None
- exists(key: str) bool [source]#
Checks for the existence of a key, safely quoting the table name.
- Parameters:
key (str)
- Return type:
bool
- get(
- key: str,
- default: str | None = None,
Retrieves a value, safely quoting the table name.
- Parameters:
key (str)
default (str | None)
- Return type:
str | None
- set(key: str, value: str | None) None [source]#
Inserts or replaces a value, safely quoting the table name.
- Parameters:
key (str)
value (str | None)
- Return type:
None
- property full_table_name: str#
Returns the full table name with session ID.