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

Method add

finagent/memory/basic_memory.py:31–46  ·  view source on GitHub ↗

Add data to memory.

(
            self,
            data: Dict,
            embedding_key: str,
            **kwargs,
    )

Source from the content-addressed store, hash-verified

29 self.vectorstore = vectorstore
30
31 def add(
32 self,
33 data: Dict,
34 embedding_key: str,
35 **kwargs,
36 ) -> None:
37 """
38 Add data to memory.
39 """
40 name = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime()) # the unique id of the added unit.
41 self.memory[name] = data
42
43 assert embedding_key in data, f"embedding_key {embedding_key} not in data"
44 embeddings = data[embedding_key]
45
46 self.vectorstore.add_embeddings([name], [embeddings])
47
48 def similarity_search(
49 self,

Callers

nothing calls this directly

Calls 1

add_embeddingsMethod · 0.45

Tested by

no test coverage detected