# alibaizhanov/mengram [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/alibaizhanov/mengram  
**GitHub Stars:** 207  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/alibaizhanov-mengram

## Description
Human-like memory layer for AI agents with semantic, episodic, and procedural memory. Claude Code hooks (auto-save, auto-recall, cognitive profile). 29 MCP tools, knowledge graph, smart triggers, multi-user isolation. Python & JS SDKs.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mengram": {
    "command": "uvx",
    "args": ["mengram-ai"]
  }
}
```

## Documentation

## What alibaizhanov/mengram MCP server does

alibaizhanov/mengram gives AI agents a memory layer organized around three types of knowledge: semantic facts, episodic events, and procedural workflows. The server can retain information from agent interactions, retrieve relevant facts, synthesize answers with citations, and surface workflows that change as their outcomes are recorded.

The project also supports a knowledge graph, smart triggers, and multi-user isolation. Its multilingual retrieval supports queries and answers across 23 languages. A fact can retain metadata about which tool created it and when, helping recall show the source context.

## How it works

The hosted setup uses an API key associated with Mengram. Python and JavaScript interfaces are available, while MCP-compatible clients can connect through the configured server. Example SDK operations include adding messages, searching for facts, asking a question, and querying episodes or procedures.

A local mode stores memory in a directory as a memfmt tree of Markdown files. That folder can be inspected with Git, viewed in Obsidian, and checked with `memfmt validate`. Local memory can use Anthropic, OpenAI, or Ollama as its provider, and the local MCP server can be started against the selected memory directory.

For Claude Code, Codex, and Cursor, lifecycle hooks can provide session context, recall, compaction checkpoints, and automatic saving. Claude Code hooks also cover session starts, prompts, responses, Bash policy checks, and compaction. Cursor does not provide a per-prompt context hook, so mid-conversation recall there is requested through MCP tools instead.

## Setup and configuration

For the hosted package, install the Python CLI with `pip install mengram-ai`, obtain an API key from Mengram, and configure the key in `~/.mengram/config.json`. The JavaScript SDK is installed with `npm install mengram-ai`.

Claude Code can install the plugin from the Mengram marketplace, which includes hooks, the MCP server, and a skill. Existing Claude Code history can be imported with `mengram import claude-code`. Alternatively, `mengram setup` installs lifecycle hooks through the CLI; separate options install hooks for Codex or Cursor.

A local setup uses commands such as `mengram local init ./memory --provider anthropic --api-key ...`, followed by `mengram server --memory ./memory`. Claude Code history can be seeded into that directory with `mengram import claude-code --memory ./memory`.

## Tools and capabilities

- Add conversational content to memory.
- Search stored facts and retrieve relevant knowledge.
- Ask questions for synthesized answers with citations.
- Query episodic events and procedural workflows.
- Preserve session state through hooks and compaction checkpoints.
- Share one memory across supported coding clients while filtering host-specific facts.

## Limitations and notes

Hosted use requires an API key, while local mode keeps the memory in a user-owned folder and uses a model provider selected during initialization. The resume task card is stored under `~/.mengram/resume/`; its task, completed-work, and remaining-work draft uses a model, while confirmed text is not redrafted. Cursor's hook model limits automatic mid-conversation recall, so MCP tools are used on request for that case.

_Full upstream README: https://allmcps.com/mcp/alibaizhanov-mengram/readme_

