Pipelines reference - Retrievers
This section provides reference documentation for Pipelines Retrievers. It includes information on the functions and views available in the aidb extension related to Retrievers.
Tables
aidb.retrievers
The aidb.retrievers
table stores information about the retrievers that have been created in the database.
Column | Type | Description |
---|---|---|
id | integer | |
name | text | |
vector_table_name | text | |
vector_table_key_column | text | |
vector_table_vector_column | text | |
model_name | text | |
topk | integer | |
distance_operator | aidb.distanceoperator | |
options | jsonb | |
source_table_name | regclass | |
source_table_data_column | text | |
source_table_data_column_type | aidb.retriever_data_type | |
source_table_key_column | text |
Functions
aidb.register_retriever_for_table
Registers a retriever for a given table.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
p_name | TEXT | ||
p_source_table_name | regclass | ||
p_source_table_data_column | TEXT | ||
p_source_table_data_column_type | aidb.RetrieverSourceDataFormat | ||
p_source_table_key_column | TEXT | 'id' | |
p_vector_table_name | TEXT | NULL | |
p_vector_table_vector_column | TEXT | 'embeddings' | |
p_vector_table_key_column | TEXT | 'id' | |
p_model_name | TEXT | NULL | Mandatory argument since NULL is not allowed. |
p_topk | INTEGER | 1 | |
p_distance_operator | aidb.distanceoperator | 'L2' | |
p_options | JSONB | '{}'::JSONB |
Example
aidb.register_retriever_for_volume
Registers a retriever for a given PGFS volume.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
p_name | TEXT | Name of the retriever. | |
p_source_volume_name | TEXT | Name of the volume. | |
p_vector_table_name | TEXT | NULL | Name of the vector table. |
p_vector_table_vector_column | TEXT | 'embeddings' | Name of the vector column. |
p_vector_table_key_column | TEXT | 'id' | Name of the key column. |
p_model_name | TEXT | NULL | Name of the model. |
p_topk | INTEGER | 1 | Number of results to return. |
p_distance_operator | aidb.distanceoperator | 'L2' | Distance operator. |
p_options | JSONB | '{}'::JSONB | Options. |
Example
aidb.enable_auto_embedding_for_table
Enables automatic embedding generation for a given table.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
p_name | TEXT | Name of registered table which should have auto-embedding enabled. |
Example
aidb.disable_auto_embedding_for_table
Enables automatic embedding generation for a given table.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
p_name | TEXT | Name of registered table which should have auto_embedding disabled. |
Example
aidb.bulk_embedding
Generates embeddings for all data in a given table if there is existing data in the table.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
retriever_name | TEXT | Name of retriever which which should have embeddings generated. |
Example
aidb.retrieve_key
Retrieves a key from matching embeddings without looking up the source data.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
retriever_name | TEXT | Name of retriever which should be used for retrieval. | |
query_string | TEXT | Query string to be used for retrieval. | |
number_of_results | INTEGER | 0 | Number of results to be returned. |
Example
aidb.retrieve_text
Retrieves the source text data from matching embeddings by joining the embeddings with the source table.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
retriever_name | TEXT | Name of retriever which should be used for retrieval. | |
query_string | TEXT | Query string to be used for retrieval. | |
number_of_results | INTEGER | 0 | Number of results to be returned. |
Returns
Column | Type | Description |
---|---|---|
key | text | Key of the retrieved data. |
value | text | Value of the retrieved data. |
distance | double precision | Distance of the retrieved data from the query. |
Example
aidb.delete_retriever
Deletes only the retriever's configuration from the database.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
retriever_name | TEXT | Name of retriever which should be deleted. |
Example
Could this page be better? Report a problem or suggest an addition!