Pipelines retrievers (deprecated) reference#

Important

The use of the term "retrievers" has been deprecated in version 4.0 and later. It is replaced by the term "knowledge base" and users should consult the Pipelines knowledge bases reference reference content. For backwards compatibility, the retrievers API is still available, but it is recommended to use the knowledge base API for new implementations. This section is covers the deprecated functions only. For the new API, see Pipelines knowledge bases reference .

aidb.RetrieverSourceDataFormat#

No longer available. Use aidb.PipelineDataFormat instead.

Functions#

aidb.create_retriever_for_table (deprecated)#

Replaced by aidb.create_table_knowledge_base

Creates a retriever for a given table.

Parameters#

Parameter

Type

Default

Description

name

TEXT

Required

Name of the retriever

model_name

TEXT

Required

Name of the model to use

source_table

regclass

Required

Name of the table to use as source

source_data_column

TEXT

Required

Column name in source table to use

source_data_type

aidb.PipelineDataFormat

Required

Type of data in that column ("Text"."Image","PDF")

source_key_column

TEXT

'id'

Column to use as key to reference the rows

vector_table

TEXT

NULL

vector_data_column

TEXT

'embeddings'

vector_key_column

TEXT

'id'

topk

INTEGER

1

distance_operator

aidb.DistanceOperator

'L2'

options

JSONB

'{}'::JSONB

Options

index_type

TEXT

'vector'

Type of index to use for the vector table.

distance_operator

index_type

L2

vector_l2_ops

InnerProduct

vector_ip_ops

Cosine

vector_cosine_ops

L1

vector_l1_ops

  • If index_type is set to ivfflat , the system will create a IVFFlat index on the vector table.

  • If index_type is set to disabled , no index will be created.

SELECT aidb.create_retriever_for_table(
               name => test_retriever,
               model_name => simple_model,
               source_table => test_source_table,
               source_data_column => content,
               source_data_type => Text,
       );

aidb.create_retriever_for_volume (deprecated)#

Replaced by aidb.create_volume_knowledge_base

Creates a retriever for a given PGFS volume.

Parameters#

Parameter

Type

Default

Description

name

TEXT

Required

Name of the retriever

model_name

TEXT

Required

Name of the model

source_volume_name

TEXT

Required

Name of the volume

vector_table

TEXT

NULL

Name of the vector table

vector_data_column

TEXT

'embeddings'

Name of the vector column

vector_key_column

TEXT

'id'

Name of the key column

topk

INTEGER

1

Number of results to return

distance_operator

aidb.distanceoperator

'L2'

Distance operator

options

JSONB

'{}'::JSONB

Options

index_type

TEXT

'vector'

Type of index to use for the vector table.

distance_operator

index_type

L2

vector_l2_ops

InnerProduct

vector_ip_ops

Cosine

vector_cosine_ops

L1

vector_l1_ops

  • If index_type is set to ivfflat , the system will create a IVFFlat index on the vector table.

  • If index_type is set to disabled , no index will be created.

SELECT aidb.create_retriever_for_volume(
               name => demo_vol_retriever,
               model_name => simple_model,
               source_volume_name => demo_bucket_vol
       );

aidb.set_retriever_auto_processing (deprecated)#

Replaced by aidb.set_auto_knowledge_base

Sets the auto-processing mode for this knowledge base.

Parameters#

Parameter

Type

Default

Description

retriever_name

TEXT

Name of retriever for which to enable auto-embedding

mode

aidb.PipelineAutoProcessingMode

Desired auto-processing mode

Example#

SELECT aidb.set_retriever_auto_processing(test_retriever, Live);
SELECT aidb.set_retriever_auto_processing(test_retriever, Disabled);

aidb.delete_retriever (deprecated)#

Replaced by :ref:``aidb.delete_knowledge_base` <aidb.delete_knowledge_base>`

Deletes only the retriever’s configuration from the database.

Parameters#

Parameter

Type

Default

Description

retriever_name

TEXT

Name of retriever to delete

Example#

select aidb.delete_retriever(test_retriever);
__OUTPUT__
 delete_retriever
- -----------------

(1 row)