MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / memory_path_from_node

Function memory_path_from_node

libatomic/src/daemon/services_agent.rs:215–223  ·  view source on GitHub ↗

Read a vault path from KG node metadata; the legacy fallback maps the node identity onto ``memory/ .md``.

(node: &KgNode)

Source from the content-addressed store, hash-verified

213 /// Read a vault path from KG node metadata; the legacy fallback maps the
214 /// node identity onto ``memory/<name>.md``.
215 fn memory_path_from_node(node: &KgNode) -> Option<String> {
216 node.metadata
217 .as_ref()
218 .and_then(|metadata| metadata.get("vault_path"))
219 .and_then(|path| path.as_str())
220 .filter(|path| path.starts_with("memory/") && path.ends_with(".md"))
221 .map(String::from)
222 .or_else(|| memory_node_id_to_path(&node.id))
223 }
224
225 /// Legacy fallback: `memory:architecture` -> `memory/architecture.md`.
226 fn memory_node_id_to_path(node_id: &str) -> Option<String> {

Callers 2

add_memory_neighborsFunction · 0.70
gather_candidatesFunction · 0.70

Calls 4

as_refMethod · 0.80
memory_node_id_to_pathFunction · 0.70
getMethod · 0.65
as_strMethod · 0.45

Tested by

no test coverage detected