by alibaizhanov
Human-like memory for AI agents — semantic, episodic & procedural. Experience-driven procedures that learn from failures. Free API, Python & JS SDKs, LangChain, CrewAI & OpenClaw integrations.
# Add to your Claude Code skills
git clone https://github.com/alibaizhanov/mengramLast scanned: 5/30/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-30T15:53:35.696Z",
"npmAuditRan": true,
"pipAuditRan": false
}mengram is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by alibaizhanov. Human-like memory for AI agents — semantic, episodic & procedural. Experience-driven procedures that learn from failures. Free API, Python & JS SDKs, LangChain, CrewAI & OpenClaw integrations. It has 183 GitHub stars.
Yes. mengram passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/alibaizhanov/mengram" and add it to your Claude Code skills directory (see the Installation section above).
mengram is primarily written in Python. It is open-source under alibaizhanov on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mengram against similar tools.
No comments yet. Be the first to share your thoughts!
Website · Get API Key · Docs · Console · Examples
pip install mengram-ai # or: npm install mengram-ai
mengram try # see what memory would know about you — local only,
# no account, nothing leaves your machine
from mengram import Mengram
m = Mengram(api_key="om-...") # Free key → mengram.io
m.add([{"role": "user", "content": "I use Python and deploy to Railway"}])
m.search("tech stack") # → facts
m.ask("what's my tech stack?") # → synthesized answer + citations
m.episodes(query="deployment") # → events
m.procedures(query="deploy") # → workflows that evolve from failures
Native multilingual: ask in Russian, Chinese, Spanish, Japanese — Mengram retrieves and answers across 23 languages (Cohere multilingual embeddings + rerank).
Paste this into Claude Desktop, Cursor, Codex, Claude Code, or Windsurf — the agent reads our setup guide, installs the SDK, configures the MCP server, and verifies the round-trip end-to-end. No terminal context-switching.
Install Mengram for me. Fetch the canonical install guide at
https://mengram.io/agent-install.txt and follow it precisely.
My email is YOUR_EMAIL_HERE.
Works in any agent with shell + file-edit + web-fetch tools. Prefer doing it manually? See the plain-text guide — it's structured for human eyes too.
Persistent memory that survives /clear, auto-compaction, machine switches, and team handoffs — the SessionStart hook fires after every compact and re-injects your context. The summary can be lossy; the memory isn't.
# 1. Get a free key at https://mengram.io and save it once
mkdir -p ~/.mengram && echo '{"api_key": "om-your-key-here"}' > ~/.mengram/config.json
# 2. Install the plugin (hooks + MCP server + skill)
claude plugin marketplace add alibaizhanov/mengram
claude plugin install mengram@mengram
# 3. Skip the cold start — import your existing session history
# (secrets are redacted on your machine before anything is uploaded)
mengram import claude-code
What happens:
Session Start → Loads your cognitive profile (fires after /clear, compaction, and restarts)
Every Prompt → Searches past sessions for relevant context (auto-recall)
After Response → Saves new knowledge in background (auto-save)
No manual saves. No tool calls. Claude just knows what you worked on yesterday — even after compaction ate the transcript.
Prefer CLI-managed hooks instead of the plugin? pip install mengram-ai && mengram setup does the same via mengram hook install.
Every AI memory tool stores facts. Mengram stores 3 types of memory — and procedures evolve when they fail.
| Mengram | claude-mem | Mem0 | Zep | Letta | |
|---|---|---|---|---|---|
| Semantic memory (facts, preferences) | Yes | Yes | Yes | Yes | Yes |
| Episodic memory (events, decisions) | Yes | Partial | No | No | Partial |
| Procedural memory (workflows) | Yes | No | No | No | No |
| Procedures evolve from failures | Yes | No | No | No | No |
| Cognitive Profile | Yes | No | No | No | No |
| Native multilingual retrieval (23 languages) | Yes | Partial | No | No | No |
| Ask & Citations (synthesized answer) | Yes | No | No | No | No |
| Multi-user isolation | Yes | No | Yes | Yes | No |
| Knowledge graph | Yes | No | Yes | Yes | Yes |
| Claude Code hooks (auto-save/recall) | Yes | Yes | No | No | No |
| MCP server | Yes | Yes | Yes | Yes | Yes |
| LangChain + CrewAI integrations | Yes | No | Partial | Partial | Partial |
| Import Claude Code history / ChatGPT / Obsidian | Yes | No | No | No | No |
| Pricing | Free tier | Free OSS (+cloud backup) | $19-249/mo | Enterprise | Self-host |
1. Install
pip install mengram-ai
2. Setup — one command does everything: account, Claude Code hooks, MCP configs for detected tools (Cursor, Claude Desktop, Windsurf), history import, and a round-trip check
mengram setup
Or get a key manually at mengram.io and export MENGRAM_API_KEY=om-...
3. Use
from mengram import Mengram
m = Mengram(api_key="om-...")
# Add a conversation — auto-extracts facts, events, and workflows
m.add([
{"role": "user", "content": "Deployed to Railway today. Build passed but forgot migrations — DB crashed. Fixed by adding a pre-deploy check."},
])
# Search across all 3 memory types at once
results = m.search_all("deployment issues")
# → {semantic: [...], episodic: [...], procedural: [...]}
# Upload a PDF — auto-extracts memories using vision AI
result = m.add_file("meeting-notes.pdf")
# → {"status": "accepted", "job_id": "job-...", "page_count": 12}
# Poll for completion
m.job_status(result["job_id"])
// Node.js — pass a file path
await m.addFile('./report.pdf');
// Browser — pass a File object from <input type="file">
await m.addFile(fileInput.files[0]);
# REST API
curl -X POST https://mengram.io/v1/add_file \
-H "Authorization: Bearer om-..." \
-F "file=@meeting-notes.pdf" \
-F "user_id=default"
npm install mengram-ai
const { MengramClient } = require('mengram-ai');
const m = new MengramClient('om-...');
await m.add([{ role: 'user', content: 'Fixed OOM by adding Redis cache layer' }]);
const results = await m.searchAll('database issues');
// → { semantic: [...], episodic: [...], procedural: [...] }
# Add memory
curl -X POST https://mengram.io/v1/add \
-H "Authorization: Bearer om-..." \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "I prefer dark mode and vim keybindings"}]}'
# Search all 3 types
curl -X POST https://mengram.io/v1/search/all \
-H "Authorization: Bearer om-..." \
-d '{"query": "user preferences"}'
m.search("tech stack")
# → ["Uses Python 3.12", "Deploys to Railway", "PostgreSQL with pgvector"]
m.episodes(query="deployment")
# → [{summary: "DB crashed due to missing migrations", outcome: "resolved", date: "2025-05-12"}]
Week 1: "Deploy" → build → push → deploy
↓ FAILURE: forgot migrations
Week 2: "Deploy" v2 → build → run migrations → push → deploy
↓ FAILURE: OOM
Week 3: "Deploy" v3 → build → run migrations → check memory → push → deploy ✅
This happens automatically when you report failures:
m.procedure_feedback(proc_id, success=False,
context="OOM error on step 3", failed_at_step=3)
# → Procedure evolves to v3 with new step added
Every failure-driven revision records which assumption turned out false — not just which step broke — and derives a precondition that travels with the procedure at recall time:
{
"version": 3,
"violated_assumption": "the build container had enough memory for a full build",
"preconditions": ["check available memory before building"],
"success_count": 11, "fail_count": 2
}
An agent loading v3 doesn't repeat the two mistakes that produced it — and knows what to verify before trusting the workflow.
Or fully automatic — just add conversations and Mengram detects failures and evolves procedures:
m.add([{"role": "user", "content": "Deploy failed again — OOM on