MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / find_cross_references

Function find_cross_references

worked/example/raw/processor.py:44–54  ·  view source on GitHub ↗

Look up the index and return IDs of related documents by keyword overlap.

(doc: dict)

Source from the content-addressed store, hash-verified

42
43
44def find_cross_references(doc: dict) -> list:
45 """Look up the index and return IDs of related documents by keyword overlap."""
46 index = load_index()
47 keywords = set(doc.get("keywords", []))
48 refs = []
49 for record_id, entry in index.items():
50 other_keywords = set(entry.get("keywords", []))
51 overlap = keywords & other_keywords
52 if len(overlap) >= 3:
53 refs.append({"id": record_id, "shared_keywords": list(overlap)})
54 return refs
55
56
57def process_and_save(doc: dict) -> str:

Callers 1

enrich_documentFunction · 0.85

Calls 3

load_indexFunction · 0.90
getMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected