Overview
Mengram gives your AI three distinct memory types, inspired by how human memory works:
When you call
m.add(messages), all three types are extracted automatically from the conversation.
Semantic Memory
The knowledge graph. Entities with facts, types, and relationships. This is the core memory layer.Episodic Memory
Autobiographical events — what happened, when, with whom, and what the outcome was. Each episode has a summary, context, outcome, and participant list.Procedural Memory
Learned workflows and processes. Mengram extracts step-by-step procedures from conversations and tracks which ones work and which fail.Graph RAG
Memories aren’t flat — they’re connected in a knowledge graph. When you search, Mengram doesn’t just find direct matches. It traverses relationships to surface context that simple vector search misses.graph_depth:
Ebbinghaus Decay
Mengram models memory decay like the human brain. Facts that haven’t been accessed recently fade in importance, while frequently recalled facts get stronger. The formula:effective_importance = base_importance * e^(-0.03 * days_since_access) + frequency_boost
- A fact accessed yesterday has full weight
- A fact untouched for 30 days decays to ~40% weight
- A fact accessed 100 times gets a frequency boost regardless of recency
Confidence Scoring
Procedural memory uses confidence scoring to decide when to create new procedures:
Confidence is calculated from episode clustering — how many similar events support the pattern. This prevents noisy one-off events from becoming permanent workflows.