memoryscope.core.storage.dummy_memory_store
- class memoryscope.core.storage.dummy_memory_store.DummyMemoryStore(embedding_model: BaseModel, **kwargs)[源代码]
-
Placeholder implementation of a memory storage system interface. Defines methods for querying, updating, and closing memory nodes with asynchronous capabilities, leveraging an embedding model for potential semantic retrieval. Actual storage operations are not implemented.
- __init__(embedding_model: BaseModel, **kwargs)[源代码]
Initializes the DummyMemoryStore with an embedding model and additional keyword arguments.
- 参数:
embedding_model (BaseModel) -- The model used to embed data for potential similarity-based retrieval.
**kwargs -- Additional keyword arguments for configuration or future expansion.
- retrieve_memories(query: str = '', top_k: int = 3, filter_dict: Dict[str, List[str]] | None = None) List[MemoryNode] [源代码]
Retrieves a list of MemoryNode objects that are most relevant to the query, considering a filter dictionary for additional constraints. The number of nodes returned is limited by top_k.
- 参数:
query (str) -- The query string used to find relevant memories.
top_k (int) -- The maximum number of MemoryNode objects to return.
filter_dict (Dict[str, List[str]]) -- A dictionary with keys representing filter fields and values as lists of strings for filtering criteria.
- 返回:
- A list of MemoryNode objects sorted by relevance to the query,
limited to top_k items.
- 返回类型:
List[MemoryNode]
- async a_retrieve_memories(query: str = '', top_k: int = 3, filter_dict: Dict[str, List[str]] | None = None) List[MemoryNode] [源代码]
Asynchronously retrieves a list of MemoryNode objects that best match the query, respecting a filter dictionary, with the result size capped at top_k.
- 参数:
query (str) -- The text to search for in memory nodes.
top_k (int) -- Maximum number of nodes to return.
filter_dict (Dict[str, List[str]]) -- Filters to apply on memory nodes.
- 返回:
A list of up to top_k MemoryNode objects matching the criteria.
- 返回类型:
List[MemoryNode]
- batch_insert(nodes: List[MemoryNode])[源代码]
- batch_update(nodes: List[MemoryNode], update_embedding: bool = True)[源代码]
- batch_delete(nodes: List[MemoryNode])[源代码]