MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / add

Method add

src/knowledge/graph.py:45–56  ·  view source on GitHub ↗
(self, name: str, etype: str, now: float = 0.0)

Source from the content-addressed store, hash-verified

43 return f"{etype}:{name}"
44
45 def add(self, name: str, etype: str, now: float = 0.0) -> None:
46 name = name.strip()
47 if not name:
48 return
49 key = self._key(name, etype)
50 ent = self.entities.get(key)
51 if ent is None:
52 self.entities[key] = Entity(name=name, type=etype, count=1, last_seen=now)
53 else:
54 ent.count += 1
55 if now:
56 ent.last_seen = now
57
58 def record_from_text(self, text: str, now: float = 0.0) -> int:
59 """Extract entities from ``text``; returns the number of mentions recorded."""

Callers 1

record_from_textMethod · 0.95

Calls 3

_keyMethod · 0.95
EntityClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected