ishaq101's picture
feat/Catalog Retrieval System (#1)
6bff5d9
raw
history blame
444 Bytes
"""Shared types for the retrieval layer."""
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any
@dataclass
class RetrievalResult:
content: str
metadata: dict[str, Any]
score: float
source_type: str # "document" | "database"
class BaseRetriever(ABC):
@abstractmethod
async def retrieve(
self, query: str, user_id: str, k: int = 5
) -> list[RetrievalResult]: ...