Class for managing chat message history using a Postgres Database as a storage backend. Extends the BaseListChatMessageHistory class.

const chatHistory = new PostgresChatMessageHistory({
tableName: "langchain_chat_histories",
sessionId: "lc-example",
pool: new pg.Pool({
host: "127.0.0.1",
port: 5432,
user: "myuser",
password: "ChangeMe",
database: "api",
}),
});

Hierarchy (view full)

Constructors

Properties

pool: Pool
sessionId: string
tableName: string = "langchain_chat_histories"

Methods