MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / build_graph

Method build_graph

methods/graph_rag.py:164–170  ·  view source on GitHub ↗

Build the knowledge graph from document splits.

(self, splits: List, llm, embedding_model)

Source from the content-addressed store, hash-verified

162 return spacy.load("en_core_web_sm")
163
164 def build_graph(self, splits: List, llm, embedding_model) -> None:
165 """Build the knowledge graph from document splits."""
166 self._add_nodes(splits)
167 embeddings = self._create_embeddings(splits, embedding_model)
168 self._all_embeddings = list(embeddings)
169 self._extract_concepts(splits, llm)
170 self._add_edges(embeddings)
171
172 def _add_nodes(self, splits: List) -> None:
173 """Add nodes to the graph."""

Callers 1

process_documentsMethod · 0.80

Calls 5

_add_nodesMethod · 0.95
_create_embeddingsMethod · 0.95
_extract_conceptsMethod · 0.95
_add_edgesMethod · 0.95
listFunction · 0.50

Tested by

no test coverage detected