To summarise the article if you're skipping to the comments, the pgvector allows you to create a "vector" type in your database
create table documents (
id bigserial primary key,
content text,
embedding vector (1536)
);
Then you can use OpenAI's Embedding API[0] to convert large text blocks into a 1535-dimension vector, which you will store in the database. From there you can used pgvector's cosine distance operator for searching for related documentsYou can combine the search results into a prompt, and send that to GPT for a "ChatGPT-like" interface, where it will generate an answer from the documents provided