MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / add

Method add

optillm/plugins/memory_plugin.py:17–21  ·  view source on GitHub ↗
(self, item: str)

Source from the content-addressed store, hash-verified

15 self.completion_tokens = 0
16
17 def add(self, item: str):
18 if len(self.items) >= self.max_size:
19 self.items.pop(0)
20 self.items.append(item)
21 self.vectors = None # Reset vectors to force recalculation
22
23 def get_relevant(self, query: str, n: int = 10) -> List[str]:
24 if not self.items:

Callers 5

runFunction · 0.95
searchMethod · 0.80
validate_citation_usageFunction · 0.80
createMethod · 0.80

Calls

no outgoing calls

Tested by 1