Skip to content

Working with Memory

This guide covers the common patterns for working with Engrammic: picking layers, setting decay, tagging, linking, and updating.

You haveUseLayer
Observation, no sourcerememberMemory
Claim with sourcelearnKnowledge
Conclusion from factsbelieveWisdom
Reasoning right nowreasonIntelligence

Memory nodes decay over time. You pick the decay class when you write:

{
"tool": "remember",
"arguments": {
"observation": "Deadline is Friday",
"decay_class": "ephemeral"
}
}
ClassHalf-lifeUse for
ephemeral7 daysSession context
standard90 daysDefault
durable540 daysFrequent references
permanent5 yearsFoundational

Tags make recall more precise. Add them when you store:

{
"tool": "remember",
"arguments": {
"observation": "Auth uses JWT RS256",
"tags": ["auth", "security"]
}
}

Then filter by tag when you query:

{
"tool": "recall",
"arguments": {
"query": "auth",
"tags": ["security"]
}
}

When you use learn, the confidence score indicates how much to trust the source:

ScoreSource quality
0.9+Official docs, verified
0.7-0.9Reputable blogs, internal docs
0.5-0.7Forums, inference
<0.5Speculation

You can create explicit relationships between nodes:

{
"tool": "link",
"arguments": {
"from_node": "node_auth",
"to_node": "node_jwt",
"relationship": "IMPLEMENTS"
}
}

Available relationship types: SUPPORTS, CONTRADICTS, CAUSES, PREVENTS, IMPLEMENTS, EXTENDS, RELATES_TO.

When information changes, supersede rather than delete. This preserves history:

{
"tool": "learn",
"arguments": {
"claim": "Rate limit is 200 req/min",
"evidence": "https://docs.example.com/changelog",
"supersedes": "node_old"
}
}

The old node stays in the graph with an edge to the new one, so time-travel queries still work.