SupabaseGroongaBM25Retriever
Retrieve documents from a SupabaseGroongaDocumentStore using PGroonga full-text search without embeddings.
Key Features
- Performs BM25-style full-text search using PGroonga in Supabase PostgreSQL.
- Works without embeddings, making it suitable for keyword-only retrieval pipelines.
- Can be combined with
SupabasePgvectorEmbeddingRetrieverfor hybrid search pipelines. - Supports both synchronous and asynchronous retrieval.
- Configurable filter policy to merge or replace filters at query time.
Configuration
- Drag the
SupabaseGroongaBM25Retrievercomponent onto the canvas from the Component Library. - Click on the component to open the configuration panel.
- Configure the nested
SupabaseGroongaDocumentStore:- Set
supabase_urlto your Supabase project URL, for examplehttps://<project-ref>.supabase.co. - Set
supabase_keyas a secret calledSUPABASE_SERVICE_KEY. Use the service role key for private access. For instructions, see Add Secrets.
- Set
Connections
SupabaseGroongaBM25Retriever receives a query string at runtime. It outputs a list of Document objects that you can connect to a PromptBuilder or other downstream components.
Source Code
To check this component's source code, open groonga_bm25_retriever.py in the Haystack Core Integrations repository.
Usage Examples
Basic Configuration
SupabaseGroongaBM25Retriever:
type: haystack_integrations.components.retrievers.supabase.groonga_bm25_retriever.SupabaseGroongaBM25Retriever
init_parameters:
document_store:
type: haystack_integrations.document_stores.supabase.groonga_document_store.SupabaseGroongaDocumentStore
init_parameters:
supabase_url: https://<project-ref>.supabase.co
supabase_key:
type: env_var
env_vars:
- SUPABASE_SERVICE_KEY
strict: false
table_name: haystack_fts_documents
top_k: 10
Using the Component in a Pipeline
# haystack-pipeline
components:
document_store:
type: haystack_integrations.document_stores.supabase.groonga_document_store.SupabaseGroongaDocumentStore
init_parameters:
supabase_url: https://<project-ref>.supabase.co
supabase_key:
type: env_var
env_vars:
- SUPABASE_SERVICE_KEY
strict: false
table_name: haystack_fts_documents
retriever:
type: haystack_integrations.components.retrievers.supabase.groonga_bm25_retriever.SupabaseGroongaBM25Retriever
init_parameters:
document_store: document_store
top_k: 10
raise_on_failure: true
connections: []
inputs:
query:
- retriever.query
outputs:
documents: retriever.documents
Parameters
Inputs
| Parameter | Type | Description |
|---|---|---|
query | str | The text query to search for. |
filters | Optional[Dict[str, Any]] | Filters to apply at query time. |
top_k | Optional[int] | Maximum number of documents to retrieve. Overrides the init-time value. |
Outputs
| Parameter | Type | Description |
|---|---|---|
documents | List[Document] | A list of matching documents ranked by relevance. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
document_store | SupabaseGroongaDocumentStore | The Supabase Groonga document store to retrieve documents from. | |
filters | Optional[Dict[str, Any]] | None | Default filters applied to all searches. |
top_k | int | 10 | Maximum number of documents to return. |
filter_policy | FilterPolicy | FilterPolicy.REPLACE | How to handle filters passed at query time. REPLACE replaces init-time filters; MERGE combines them. |
raise_on_failure | bool | True | Whether a failing search raises an exception or logs a warning and returns no documents. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
query | str | The text query string. | |
filters | Optional[Dict[str, Any]] | None | Runtime filters to apply. |
top_k | Optional[int] | None | Maximum number of documents to retrieve. Overrides the init-time value. |
Related Information
Was this page helpful?