rag_bge_small_en_v15
pgrag · rag_bge_small_en_v15: local bge-small-en-v1.5 embeddings in PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100255 | rag_bge_small_en_v15 | pgrag | 0.0.0 | RAG | Apache-2.0 | Rust |
PostgreSQL · 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
rag_bge_small_en_v15 runs the 33-million-parameter bge-small-en-v1.5 model locally to tokenize text, split model-aware chunks, and generate 384-dimensional passage or query embeddings. It is deprecated and no longer maintained.
Core Workflow
The model executes in a background worker, so preload the library and restart PostgreSQL before creating the extension:
On macOS, the upstream instructions use .dylib instead of .so in shared_preload_libraries.
SQL API
rag_bge_small_en_v15.chunks_by_token_count(text, integer, integer)returns chunks bounded by model tokens with the requested overlap.rag_bge_small_en_v15.embedding_for_passage(text)returnsvector(384)for stored passages.rag_bge_small_en_v15.embedding_for_query(text)returnsvector(384)for search queries.
Operational Notes
The reviewed version is 0.0.0, non-relocatable, requires vector, and sets superuser = true. The worker starts with PostgreSQL but lazy-loads the model on first use; expect first-call latency and substantial memory use. The default build embeds the large ONNX model. A remote_onnx build downloads it after restart and should use a controlled URL. The repository pins patched ONNX Runtime dependencies and documents possible platform-specific symbol failures. Pin the entire build because the project is archived and deprecated.