
Mengram
io.github.alibaizhanovPublished by GitHub account alibaizhanovv2.25.4Updated Oct 26, 2026
Long-term memory for AI agents: semantic facts, episodic events, and procedural workflows
Overview
Mengram is a hosted long-term memory service for AI agents, giving an assistant tools to store, search and recall facts, events and workflows across sessions.
- What you can do
- Add and search memories: store conversations or text and retrieve semantic facts, episodic events and procedural workflows, with a unified search across all three.
- Ask questions of memory: get a synthesized answer with citations back to the stored facts, and generate a cognitive profile usable as a system prompt.
- Manage procedures: report step outcomes so a workflow evolves into a new version, and read its version history and preconditions.
- Import and organize: bring in Claude Code history, ChatGPT exports, Obsidian vaults or files, and filter results by metadata such as agent or app identifiers.
- Account and automation: check quota usage, register webhooks for memory changes, and run…
- When to use it
- Use it when an assistant should remember a user's preferences, past decisions and working procedures between sessions, machines or agents, or when several agents should share one memory. It suits coding agents that lose context after compaction and teams wanting recall across Claude Code, Codex and Cursor.
- Requirements
- A remote endpoint at mengram.io over streamable HTTP, with OAuth and an Authorization bearer API key; a free key is available from the provider. A paid tier is needed for some features such as the synthesized ask answers. The optional CLI and SDKs are installed separately and are not required for the remote server.
Installation
In SourceWeft
- Open Mengram in the dashboard and add it to a workspace.
- Connect the required credentials. They are stored privately and never shown on public pages.
- Enable the server for the chats that should use its tools.
Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.
Use with an agent
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/io.github.alibaizhanov%2Fmengram/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Other MCP clients
Add this to your client's mcpServers config. The client completes OAuth sign-in on first connect.
{
"mcpServers": {
"mengram": {
"type": "http",
"url": "https://mengram.io/mcp"
}
}
}README
Give your AI agents memory that actually learns
[GitHub stars] [PyPI] [npm] [License: Apache 2.0] [PyPI Downloads] [Last commit]
Website · Get API Key · Docs · Console · Examples
Native multilingual: ask in Russian, Chinese, Spanish, Japanese — Mengram retrieves and answers across 23 languages (Cohere multilingual embeddings + rerank).
Install in one prompt (any AI tool)
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.
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.
Claude Code — Memory That Survives /clear AND Auto-Compaction
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.
What happens:
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.
Same memory in Codex and Cursor
Codex and Cursor fire the same lifecycle events, so the same hooks run there — one memory across all three. mengram setup finds them on your machine and installs their hooks; or add them one by one:
Cursor has no per-prompt context hook (beforeSubmitPrompt can only allow or block), so mid-conversation recall there is on request via the MCP tools; session start and compaction are automatic.
Every fact remembers which tool wrote it and when, and recall shows it: deploys to Fly.io from main (codex, 2026-09-15). Each hook also tells the server which OS and tool it runs under, so a workspace path recorded on your Mac never reaches a Claude Code session on a Linux box, and a Cursor settings fact never reaches Codex — those are left out and counted (facts_left_out_for_host).
Pick a task up where it was left — mengram resume
When an agent stops, the hooks write a task card for the repository and branch: files touched, last commands, the last test run and the commit it ran on, plus the agent's draft of the task, what is done and what remains. The next session on that branch — tomorrow, another agent in another worktree of it, another machine — gets it first, and is told when the code has moved since the last check. A session on a branch with no card of its own (a fresh Orca worktree, say) is only told that cards exist, since another branch's card is usually another agent's task; mengram resume shows it on request:
mengram resume --open serves a local page to correct the card, confirm it (confirmed text is never redrafted), pick another task or copy the context for a new session. The card lives in ~/.mengram/resume/ and needs no account; only the draft of task/done/remaining uses a model.
No account? Keep the memory in a folder
The folder is the memory: a memfmt tree of Markdown you own — git diffs it, Obsidian draws it, memfmt validate checks it. Same procedures-with-outcomes as the cloud: versions, success/fail counts per step, the policy gate, and the regression gate that quarantines a fix that would break another workflow. Only extraction and a failure revision need a model, and that one you bring. Nothing expires and nothing asks for a key. Docs.
Local search matches words in Unicode text, including Russian; it does not use embeddings or translate queries. Multiple Mengram sessions coordinate writes with a folder lock and merge independent additions. Conflicting edits require a reload instead of overwriting another session. Each changed file is replaced atomically, but the whole folder is not a single crash-atomic transaction, and external editors do not participate in the lock.
Why Mengram?
Every AI memory tool stores facts. Mengram stores 3 types of memory — and procedures evolve when they fail.
Get Started in 30 Seconds
1. Install
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
Or get a key manually at mengram.io and export MENGRAM_API_KEY=om-...
3. Use
File Upload (PDF, DOCX, TXT, MD)
JavaScript / TypeScript
REST API (curl)
3 Memory Types
Semantic — facts, preferences, knowledge
Episodic — events, decisions, outcomes
Procedural — workflows that evolve
This happens automatically when you report failures:
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:
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:
Ask Your Memory (RAG built-in)
m.ask() returns a synthesized answer with citations — not a raw fact list.
Mengram embeds your query, retrieves the top relevant facts, and uses
Cohere Chat to write a grounded answer with native source attribution.
Multilingual: ask in any of 23 languages, get an answer in the same language with citations linking back to facts in the original language they were stored. Premium feature (Pro / Growth / Business).
Cognitive Profile
One API call generates a system prompt from all memories:
Insert into any LLM's system prompt for instant personalization.
Import Existing Data
Kill the cold-start problem:
Integrations
Multi-User Isolation
One API key, many users — each sees only their own data:
Async Client
Non-blocking Python client built on httpx:
Install with pip install mengram-ai[async].
Metadata Filters
Filter search results by metadata:
Webhooks
Get notified when memories change:
Agent Templates
Clone, set API key, run in 5 minutes:
Use with AI Agents
Mengram works as a persistent memory backend for autonomous agents. Your agent stores what it learns, and recalls it on the next run — getting smarter over time.
Works with any agent framework — CrewAI, LangChain, AutoGPT, custom loops. The agent just calls add() after actions and search() before decisions.
Self-Hosted (Ollama)
When running locally with Ollama, use models with 8B+ parameters and 8K+ context window. The extraction prompt is ~4,000 tokens — smaller models will hallucinate or mix examples with real data.
API Reference
Full interactive docs: mengram.io/docs
Quota Headers
Every authenticated response includes usage headers:
SDKs expose this via .quota:
Community
- GitHub Issues — bug reports, feature requests
- GitHub Discussions — show your use case, ask questions
- API Docs — interactive Swagger UI
- Examples — ready-to-run agent templates
Star History
[Star History Chart]License
Apache 2.0 — free for commercial use.
Get your free API key · Built by Ali Baizhanov · mengram.io
Source: README.md at commit 88a50ab
Tools
0Version history
1- v2.25.4LatestSep 16, 2026
Score
85% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
- Auth declaredRequired10 pts
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts