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", }),}); Copy
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", }),});
Creates a new PostgresChatMessageHistory.
The input fields for the PostgresChatMessageHistory.
If neither pool nor poolConfig is provided.
pool
poolConfig
End the Postgres pool.
Class for managing chat message history using a Postgres Database as a storage backend. Extends the BaseListChatMessageHistory class.
Example