MCPcopy Create free account
hub / github.com/DVampire/FinAgent / VectorStore

Class VectorStore

finagent/memory/base.py:14–55  ·  view source on GitHub ↗

Interface for vector store.

Source from the content-addressed store, hash-verified

12Image = Any
13
14class VectorStore(abc.ABC):
15 """Interface for vector store."""
16
17 @abc.abstractmethod
18 def add_embeddings(
19 self,
20 *args: Any,
21 **kwargs: Any,
22 ) -> None:
23 """Add embeddings to the vectorstore.
24
25 Args:
26 keys: list of metadatas associated with the embedding.
27 embeddings: Iterable of embeddings to add to the vectorstore.
28 kwargs: vectorstore specific parameters
29 """
30
31 @abc.abstractmethod
32 def delete(self,
33 *args: Any,
34 **kwargs: Any,) -> bool:
35 """Delete by keys.
36
37 Args:
38 keys: List of keys to delete.
39 **kwargs: Other keyword arguments that subclasses might use.
40
41 Returns:
42 bool: True if deletion is successful,
43 False otherwise, None if not implemented.
44 """
45
46 @abc.abstractmethod
47 def similarity_search(
48 self,
49 *args: Any,
50 **kwargs: Any,
51 ) -> List[Tuple[str, float]]:
52 """Return keys most similar to query."""
53
54 def save_local(self, memory_path = None) -> None:
55 """Save FAISS index and index_to_key to disk."""
56
57
58class BaseMemory:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected