Pipelines retrievers (deprecated) reference v1.3
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 knowledge_bases 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 knowledge_bases.
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. | 
Index_types
If
index_typeis set tovector, the system will automatically create a hnsw index on the vector table based on the distance operator used in the retriever. This is the default index type. Thevectorindex type is only able to support 2000 dimensions or less. If more dimensions are needed, the index type should be set todisabled.distance_operator index_type L2 vector_l2_opsInnerProduct vector_ip_opsCosine vector_cosine_opsL1 vector_l1_opsIf
index_typeis set toivfflat, the system will create a IVFFlat index on the vector table.If
index_typeis set todisabled, no index will be created.
Example
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. | 
Index_types
If
index_typeis set tovector, the system will automatically create a hnsw index on the vector table based on the distance operator used in the retriever. This is the default index type. Thevectorindex type is only able to support 2000 dimensions or less. If more dimensions are needed, the index type should be set todisabled.distance_operator index_type L2 vector_l2_opsInnerProduct vector_ip_opsCosine vector_cosine_opsL1 vector_l1_opsIf
index_typeis set toivfflat, the system will create a IVFFlat index on the vector table.If
index_typeis set todisabled, no index will be created.
Example
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 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');
delete_retriever ------------------ (1 row)