pub fn render_node(node: &Node) -> StringExpand description
Render a Node to a compact, deterministic text representation
suitable for LLM consumption.
The format is YAML-like and stable across versions:
ntype: <ntype>
id: <uuid>
context: <context_sentence>
summary: <summary>
<prop_key>: <prop_value>
...ntypeandidare always present.contextis emitted iffnode.context_sentenceisSome. Sits BEFOREsummaryso an LLM reading the rendered node sees the chunk’s positional cue first (, Anthropic 2024 contextual-retrieval recipe).summaryis emitted iffnode.summaryisSome. Clipped atDEFAULT_RENDER_SUMMARY_CAP_CHARS(8192) chars by default, overridable viaMNEM_RENDER_SUMMARY_CAP_CHARS. A 1 MiB summary on a single node would otherwise consume the entire token budget and starve every other item out of the result.- Scalar props (
String,Integer,Float,Bool) are emitted in BTreeMap order (alphabetical). Non-scalar props (Link,Map,List,Bytes,Null) are skipped - an agent chasing a link should follow it with a separatemnem_get_nodecall. - Opaque
contentbytes are never rendered.
Determinism: since Node.props is a BTreeMap, iteration order is
byte-stable and the rendered string is therefore also byte-stable.