Skip to content

base

Base classes for database.

Classes:

  • DBBase

    Base class for vector database.

DBBase

Base class for vector database.

Methods:

  • embed

    Embed the documents into the database.

  • search

    Search a query from documents.

embed abstractmethod

embed(documents: Any) -> None

Embed the documents into the database.

Source code in src/rago/augmented/db/base.py
17
18
19
20
@abstractmethod
def embed(self, documents: Any) -> None:
    """Embed the documents into the database."""
    ...

search abstractmethod

search(
    query_encoded: Any, top_k: int = 2
) -> tuple[Iterable[float], Iterable[int]]

Search a query from documents.

Source code in src/rago/augmented/db/base.py
22
23
24
25
26
27
@abstractmethod
def search(
    self, query_encoded: Any, top_k: int = 2
) -> tuple[Iterable[float], Iterable[int]]:
    """Search a query from documents."""
    ...