tools.kg_anchoring_tools module
tools/kg_anchoring_tools.py — Agent-facing tools for the Limbic Anchoring pipeline (Phase 5.2).
- Exposes:
- kg_anchor_messages — Create SYNTHESIZED_FROM edges between messages and
existing graph entities.
- async tools.kg_anchoring_tools.kg_anchor_messages(graph_query, message_uuids, entity_uuids, relation='SYNTHESIZED_FROM')[source]
Create typed edges between Message nodes and existing graph entities.
This is an idempotent MERGE operation — calling it multiple times with the same arguments produces exactly one edge per pair.
- Parameters:
- Return type:
- Returns:
Dict with
{"edges_created": int, "skipped": bool}
- Edge cases:
Empty
message_uuidsorentity_uuids: returns immediately with{"edges_created": 0, "skipped": True}— no Cypher emitted.