Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

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 SupabasePgvectorEmbeddingRetriever for hybrid search pipelines.
  • Supports both synchronous and asynchronous retrieval.
  • Configurable filter policy to merge or replace filters at query time.

Configuration​

  1. Drag the SupabaseGroongaBM25Retriever component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. Configure the nested SupabaseGroongaDocumentStore:
    • Set supabase_url to your Supabase project URL, for example https://<project-ref>.supabase.co.
    • Set supabase_key as a secret called SUPABASE_SERVICE_KEY. Use the service role key for private access. For instructions, see Add Secrets.

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​

ParameterTypeDescription
querystrThe text query to search for.
filtersOptional[Dict[str, Any]]Filters to apply at query time.
top_kOptional[int]Maximum number of documents to retrieve. Overrides the init-time value.

Outputs​

ParameterTypeDescription
documentsList[Document]A list of matching documents ranked by relevance.

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
document_storeSupabaseGroongaDocumentStoreThe Supabase Groonga document store to retrieve documents from.
filtersOptional[Dict[str, Any]]NoneDefault filters applied to all searches.
top_kint10Maximum number of documents to return.
filter_policyFilterPolicyFilterPolicy.REPLACEHow to handle filters passed at query time. REPLACE replaces init-time filters; MERGE combines them.
raise_on_failureboolTrueWhether 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.

ParameterTypeDefaultDescription
querystrThe text query string.
filtersOptional[Dict[str, Any]]NoneRuntime filters to apply.
top_kOptional[int]NoneMaximum number of documents to retrieve. Overrides the init-time value.