memoryscope.core.storage.dummy_memory_store
- class memoryscope.core.storage.dummy_memory_store.DummyMemoryStore(embedding_model: BaseModel, **kwargs)[source]
Bases:
BaseMemoryStore
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)[source]
Initializes the DummyMemoryStore with an embedding model and additional keyword arguments.
- Parameters:
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] [source]
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.
- Parameters:
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.
- Returns:
- A list of MemoryNode objects sorted by relevance to the query,
limited to top_k items.
- Return type:
List[MemoryNode]
- async a_retrieve_memories(query: str = '', top_k: int = 3, filter_dict: Dict[str, List[str]] | None = None) List[MemoryNode] [source]
Asynchronously retrieves a list of MemoryNode objects that best match the query, respecting a filter dictionary, with the result size capped at top_k.
- Parameters:
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.
- Returns:
A list of up to top_k MemoryNode objects matching the criteria.
- Return type:
List[MemoryNode]
- batch_insert(nodes: List[MemoryNode])[source]
- batch_update(nodes: List[MemoryNode], update_embedding: bool = True)[source]
- batch_delete(nodes: List[MemoryNode])[source]