from typing import List, TypeVar from abc import ABC, abstractmethod T = TypeVar('T') class VectorDB(ABC): @abstractmethod def vec_id(self, index: List[str]) -> T: ... @abstractmethod def retrieve(self, ns: str, vec: List[float], limit: int) -> List[dict]: ... @abstractmethod def upsert(self, ns: str, vec_id: T, vec: List[float], metadata: dict): ... @abstractmethod def delete(self, ns: str, vec_id: T): ...