async_pgvector_db.py
Knowledge.ainsert() awaits reader and embedding work. PgVector uses a synchronous SQLAlchemy engine for database writes. PgVector.async_search() runs the synchronous search method in a worker thread.
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Run PgVector
4
Export the API key
5
Run the example