Skip to main content
Glama

MemOS-MCP

by qinshu1109
base.py1.07 kB
from abc import ABC, abstractmethod from typing import List, Tuple, Any class BaseReranker(ABC): """Base class for all rerankers.""" @abstractmethod def rerank(self, query: str, documents: List[str], top_k: int = None) -> List[Tuple[str, float]]: """ Rerank documents based on their relevance to the query. Args: query: The search query documents: List of document texts to rerank top_k: Number of top results to return (optional) Returns: List of tuples (document, score) sorted by relevance score in descending order """ pass @abstractmethod def get_scores(self, query: str, documents: List[str]) -> List[float]: """ Get relevance scores for documents without reordering. Args: query: The search query documents: List of document texts to score Returns: List of relevance scores corresponding to input documents """ pass

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qinshu1109/memos-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server