Skip to main content

Code

db.py

Usage

1

Set up your virtual environment

2

Set your API key

3

Install dependencies

4

Run PgVector

5

Run Agent

Save the code above as db.py, then run:
PostgreSQL storage maintains conversation state across multiple interactions. The example creates an IBM WatsonX agent with a PostgreSQL storage backend and sends multiple messages, preserving the conversation history between them.