DISCOVER THE FUTURE OF AI AGENTSarrow_forward

Mengram

calendar_todayAdded Feb 26, 2026
categoryAgent & Tooling
codeOpen Source
PythonWorkflow AutomationJavaScriptKnowledge BaseLangChainModel Context ProtocolRAGAI AgentsAgent FrameworkSDKAgent & ToolingDocs, Tutorials & ResourcesAutomation, Workflow & RPAKnowledge Management, Retrieval & RAGProtocol, API & Integration

Human-like memory layer for AI agents featuring semantic, episodic, and procedural memory with failure-driven workflow evolution. Offers Python/JS SDKs, REST API, and LangChain/CrewAI integrations.

Project Positioning#

Mengram provides human-like memory capabilities for AI agents, addressing the core problem of AI agents lacking long-term memory and context retention. Agents cannot automatically optimize workflows from past failures or successes. Mengram offers a unified memory layer connecting different agent frameworks.

Core Memory Architecture#

The project adopts a three-layer memory model:

  • Semantic Memory: Stores facts, preferences, knowledge; retrieved via m.search("tech stack") returning fact lists
  • Episodic Memory: Stores events, decisions, outcomes; queried via m.episodes(query="deployment") returning events with results and dates
  • Procedural Memory: Evolvable workflows with version history; accessed via m.procedures(query="deploy") returning workflow version history

Intelligent Evolution Mechanism#

Trigger automatic workflow evolution via m.procedure_feedback(proc_id, success=False, context="..."). The system automatically detects and evolves workflows from failed conversations, achieving experience-driven continuous optimization. Key data flow: POST /v1/add → session extraction → store entities/events/procedures → auto-associate failure events and evolve procedures.

Retrieval & Cognitive Capabilities#

  • Unified Retrieval: m.search_all("deployment issues") searches across all three memory types
  • Cognitive Profile: m.get_profile() generates personalized summaries usable directly as system prompts
  • Knowledge Graph: Supports graph-based storage and retrieval of entities, relationships, and facts

Data Management#

  • Multi-user Isolation: Data isolation via user_id (sub_user_id)
  • Data Import: CLI supports mengram import chatgpt export.zip --cloud, mengram import obsidian vault --cloud, mengram import files notes/*.md --cloud
  • Smart Triggers: Reminders, contradiction detection, pattern recognition
  • Webhooks: Change event notifications

Ecosystem Integrations#

  • MCP Server: Supports Claude Desktop, Cursor, Windsurf configuration
  • LangChain: Provides MengramChatMessageHistory, MengramRetriever
  • CrewAI: 5 dedicated memory tools
  • OpenClaw: Plugin supports automatic recall and capture with 12 tools

Deployment Modes#

  • Cloud Mode: FastAPI + PostgreSQL + pgvector, includes session extractor, evolution engine, smart triggers, memory agent
  • Local Mode: MengramBrain engine, SQLite + vector indexing + knowledge graph, hybrid retrieval without external database dependencies

Quick Start#

from cloud.client import CloudMemory
m = CloudMemory(api_key="om-...")  # Get free key from mengram.io

m.add([{"role": "user", "content": "I use Python and deploy to Railway"}])
m.search("tech stack")           # → list of facts
m.episodes(query="deployment")   # → list of events
m.procedures(query="deploy")     # → workflow version history

Use Cases#

  • DevOps Agent: Automatically evolves deployment workflows from failure conversations (example: examples/devops-agent)
  • Customer Support: Remembers returning customer preferences and history, combined with CrewAI 5 memory tools
  • Personal Assistant: Builds assistants with personalized cognitive profiles using LangChain (example: examples/personal-assistant)

Related Projects

View All arrow_forward

STAY UPDATED

Get the latest AI tools and trends delivered straight to your inbox. No spam, just intelligence.

rocket_launch