N
Neon12mo ago
other-emerald

PGRag example does not work?

I'm trying the end-to-end RAG example: https://neon.tech/docs/extensions/pgrag#end-to-end-rag-example however i keep getting stuck at the part that uses rag_bge_small_en_v15.embedding_for_passage, a basic example that shows the error:
neondb=> SELECT rag_bge_small_en_v15.embedding_for_passage('This is just a test'); ERROR: [rag_bge_small_en_v15] Couldn't connect worker stream /tmp/.s.pgrag.rag_bge_small_en_v15.31673: No such file or directory (os error 2)
CONTEXT: SQL function "embedding_for_passage" statement 1
neondb=> SELECT rag_bge_small_en_v15.embedding_for_passage('This is just a test'); ERROR: [rag_bge_small_en_v15] Couldn't connect worker stream /tmp/.s.pgrag.rag_bge_small_en_v15.31673: No such file or directory (os error 2)
CONTEXT: SQL function "embedding_for_passage" statement 1
I have confirmed that all of the initialization steps worked:
SET neon.allow_unstable_extensions='true';
create extension if not exists rag cascade;
create extension if not exists rag_bge_small_en_v15 cascade;
create extension if not exists rag_jina_reranker_v1_tiny_en cascade;
SET neon.allow_unstable_extensions='true';
create extension if not exists rag cascade;
create extension if not exists rag_bge_small_en_v15 cascade;
create extension if not exists rag_jina_reranker_v1_tiny_en cascade;
Even so, both embedding_for_query and embedding_for_passage fail with this same error.
Neon
The pgrag extension - Neon Docs
What is RAG? What's included in a RAG pipeline? pgrag functions How to use pgrag The pgvector extension YouTube pgrag video demonstration pgrag GitHub repository The pgrag extension and its accompanyi...
8 Replies
exotic-emerald
exotic-emerald12mo ago
Thanks for this report. Huh — I'm now seeing the same error, and it's definitely on us to fix ... Ah — actually, I'm seeing an error on Azure (where the extension is not yet supported) but not on AWS (which is the standard Neon platform). Can I check which platform you're using?
other-emerald
other-emeraldOP12mo ago
Yeah this one is in AWS US East (N. Virginia) @jawj
No description
harsh-harlequin
harsh-harlequin12mo ago
I think for now pgrag is not supported on pg17. I will double check
exotic-emerald
exotic-emerald12mo ago
I think pgrag should work on 17 on AWS, but the compute node will need to have been restarted since the extension was released (because the background worker process gets launched on startup). Is it possible your DB has not shut down for the last few weeks?
other-emerald
other-emeraldOP12mo ago
I only created it on November 15th
exotic-emerald
exotic-emerald12mo ago
OK, thanks. Looks like we still need to do some investigating, then ... Just to be sure about the cause of this issue, would you mind running show shared_preload_libraries; against the DB and let us know what you get back?
other-emerald
other-emeraldOP12mo ago
neon,pg_stat_statements,timescaledb,pg_partman_bgw,rag_bge_small_en_v15,rag_jina_reranker_v1_tiny_en
adverse-sapphire
adverse-sapphire12mo ago
@Chris I just tried to reproduce and was unable to, here's what the configuration I used. The commands I ran are the following:
SET neon.allow_unstable_extensions='true';
create extension if not exists vector;
create extension if not exists rag_bge_small_en_v15 cascade;
SELECT rag_bge_small_en_v15.embedding_for_passage('This is just a test');
SET neon.allow_unstable_extensions='true';
create extension if not exists vector;
create extension if not exists rag_bge_small_en_v15 cascade;
SELECT rag_bge_small_en_v15.embedding_for_passage('This is just a test');
Can you restart your project, and run all of these commands together to see if the error occurs anymore?
No description

Did you find this page helpful?