> For the complete documentation index, see [llms.txt](https://docs.seldon.ai/llm-module/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seldon.ai/llm-module/resources/reference/retrieval.md).

# Retrieval

## VectorDBSettings:

Retrieval base settings.

### **provider\_id: `VectorDBEnum`**

**Description:** VectorDB provider id. Available options: `"qdrant"` | `"pgvector"`.

### **config: `Union[QdrantSettings, PGVectorSettings]`**

**Description:** VectorDB provider settings.\\

### prompt\_utils: `Optional[PromptUtilsSettings]`

**Description:** Prompt utils settings.\
**Default:** `None`

### extract\_utils: `Optional[ExtractUtilsSettings]`

**Description:** Extract utils settings.\
**Default:** `None`

## ExtractUtilsSettings

ExtractUtils setting. Used to extract keys from the response of the vector database. For example, some jinja prompt my expect the context for the vector-db to have specific keys which my not be the same as the keys in the response of the vector database. Thus, this setting can be used to extract and remap keys.

### keys: `Optional[List[str]]`

**Description:** List of keys names to extract.\
**Default:** `None`

### keys\_mapping: `Optional[Dict[str, str]]`

**Description:** Mapping of extracted keys.\
**Default:** `None`

## Distances

Available distances are: `"l1"` | `"l2"` | `"inner_product"` | `"cosine"`. Note that `"inner_product"` is in fact the negative inner product.

## PGVectorSettings

### **model\_type: `Literal["vector-db"]` = "ector-db"**

**Description:** The model type.\
**Default:** `"vector-db"`

### host: `str`

**Description:** Hostname of the PostgreSQL server.\
**Default:** `"localhost"`

### port: `int`

**Description:** Port of the PostgreSQL server.\
**Defualt:** `5432`

### database: `str`

**Description:** Name of the PostgreSQL database.

### user: `str`

**Description:** Username to authenticate with.

### password: `str`

**Description:** Password to authenticate with.

### table: `str`

**Description:** Name of the table to query.\
**Default:** `"embedding_table"`

### embedding\_column: `str`

**Description:** Name of the column containing embeddings.\
**Default:** `"embedding"`

### search\_parameters: `Optional[dict]`

**Description:** Additional parameters for the vector database.\
**Default:** `None`

## QdrantSettings:

### **model\_type: Literal\["vector-db"]**\*

**Description:** The model type. **Default:** `"vector-db"`

### **collection\_name: `str`**

**Description:** Qdrant collection name

### **init\_kwargs: `Optional[dict]`**

**Description:** Initialization kwargs for QdrantClient\
**Default:** `None`

### **search\_parameters: `Optional[dict]`**

**Description:** Additional parameters for the vector database.\
**Default:** `None`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.seldon.ai/llm-module/resources/reference/retrieval.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
