Saltar al contenido principal

SequentialRetriever

Retriever
DashAI.back.models.RAG.retrievers.composite.SequentialRetriever

Queries multiple retrievers in sequence, re-ranking at each step.

Each stage narrows the result set by requiring strictly decreasing top_k values. The last child is the authoritative scorer.

Parameters​

children : array, default=[]
Ordered list of child retrievers. The first child retrieves broadly; each subsequent child re-ranks and tightens the results.

Methods​

get_metadata(cls) -> Dict[str, Any]

Defined on SequentialRetriever

Return UI metadata including the declarative operation summary.

retrieve(self, query, **kwargs) -> List[DashAI.back.models.RAG.documents.chunk.Chunk]

Defined on SequentialRetriever

Retrieve chunks through the sequential cascade.

score_chunks(self, chunk_ids: List[int], query: str) -> List[Tuple[int, float]]

Defined on SequentialRetriever

Score chunks by delegating to the last child in the cascade.

add(self, child: DashAI.back.models.RAG.retrievers.base_retriever.BaseRetriever) -> None

Defined on CompositeRetriever

Add a child retriever.

get_children(self) -> List[DashAI.back.models.RAG.retrievers.base_retriever.BaseRetriever]

Defined on CompositeRetriever

Return a copy of the children list.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

get_id(self) -> int | None

Defined on BaseRetriever

Return the database ID of this retriever, or None.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

init_model(self) -> None

Defined on BaseRetriever

Called by the factory after inject_infra().

inject_infra(self, env_RAG_path: str | os.PathLike, chunks: Dict[int, Dict[int, DashAI.back.models.RAG.documents.chunk.Chunk]], persistence: Any) -> None

Defined on BaseRetriever

Inject runtime infrastructure after schema validation.

load(self, filename: str = '') -> None

Defined on BaseRetriever

Restore the retriever's state from disk.

remove(self, child: DashAI.back.models.RAG.retrievers.base_retriever.BaseRetriever) -> None

Defined on CompositeRetriever

Remove a child retriever.

save(self, filename: str = '') -> None

Defined on BaseRetriever

Persist the retriever's state to disk.

set_id(self, id: int) -> None

Defined on BaseRetriever

Assign a database ID to this retriever.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.