Why one type of memory isn't enough
Most AI memory tools store only facts — "user likes Python", "user lives in San Francisco." This is semantic memory, and it's useful but incomplete. Humans don't just remember facts. We remember experiences and skills too.
Mengram implements all three types of human memory for AI agents. Here's how each works and why it matters.
Semantic memory: facts and knowledge
Semantic memory stores what the AI knows about a user, project, or domain. It's context-free — the facts exist independent of when or how they were learned.
# Semantic memories extracted automatically:
"User prefers TypeScript over JavaScript"
"User works at Acme Corp as a senior engineer"
"User's project uses PostgreSQL with pgvector"
"User prefers dark mode in all tools"
This is the baseline. Tools like Mem0 and Zep implement semantic memory well. But it's only the foundation.
Episodic memory: events and experiences
Episodic memory stores what happened — specific events, decisions, and interactions with full context: when, where, and why.
# Episodic memories:
"On Feb 12, user spent 2 hours debugging a Redis connection timeout.
Root cause was pool_max=2 under concurrent load. Fixed by increasing to 5."
"On Feb 10, user decided to migrate from REST to GraphQL
after discovering N+1 query problems in the dashboard API."
"On Feb 8, user paired with Sarah on the auth refactor.
They chose JWT over sessions for stateless scaling."
Episodic memory enables the AI to reference past events: "Last time you had a Redis issue, it was a pool size problem — want me to check that first?" This is the difference between a tool and a colleague.
Procedural memory: workflows and skills
Procedural memory stores how to do things — step-by-step workflows that the AI learns from observing the user's patterns.
# Procedural memories:
"Deploy workflow: run tests → build Docker image → push to staging →
smoke test → promote to production → notify #eng-deploys"
"Code review process: check for security issues first →
verify test coverage → review naming conventions →
suggest performance improvements last"
"Bug triage: reproduce locally → check error logs →
identify affected users → create ticket → assign priority"
The critical feature of procedural memory is that it evolves from failures. When a deployment fails because the user forgot to run migrations, Mengram updates the procedure to include that step. The AI gets better over time.
How all three work together
Consider a customer support agent with all three memory types:
- Semantic: "This customer is on the Pro plan, uses the React SDK, and prefers email over chat."
- Episodic: "Last week, this customer reported a billing issue that was resolved by applying a promo code."
- Procedural: "For billing issues: check subscription status → verify payment method → check for failed charges → escalate to billing team if unresolved."
With all three, the agent doesn't just have facts — it has experience and skills. It knows the customer, remembers their history, and follows a proven resolution workflow.
Using all three types with Mengram
from mengram import Mengram
m = Mengram(api_key="key")
# Add any conversation — Mengram auto-extracts all 3 types
m.add("Deployed to staging, but migrations failed. Had to rollback, run migrations manually, then redeploy.", user_id="alice")
# Search across all types
m.search("deployment process", user_id="alice")
# Cognitive Profile merges all types into one system prompt
profile = m.profile(user_id="alice")
Mengram automatically classifies and extracts all three memory types from natural conversation. No manual tagging required. Get started in 5 minutes.