Skip to main content
The mengram-ai-sdk package adds Mengram memory to generateText / streamText agents as tools, plus a Cognitive Profile helper for system prompts.

Installation

Grab a free API key at mengram.io (40 memory adds + 200 searches/mo, no card).

Memory tools

Three tools are exposed to the model: getProcedures is the distinctive one — it returns workflows that evolved from failures, with the preconditions that were violated last time, so your agent stops repeating mistakes it already made.

Cognitive Profile as system prompt

One call returns a ready-to-use system prompt built from all three memory types:

Save conversations

Extraction runs server-side — pass raw messages, Mengram distills facts, events, and workflows:

Multi-user apps

Pass your end-user’s id as userId — each user gets isolated facts, events, workflows, and profile under one API key. See Memory API for agent builders.

Options