Sponsored by Deepsite.site

Memlayer

Created By
ProcIQa month ago
Agent learning infrastructure that captures experience, surfaces what works, and builds reusable capabilities. MCP-native with 94.4% LongMemEval accuracy. Supports Claude Code, Gemini CLI, Codex CLI, and more.
Overview

MemLayer Plugins

A self-learning memory system for Claude Code, the Gemini CLI, and Codex CLI that enables persistent learning across task executions. Must be used with MemLayer.

Overview

MemLayer provides your AI agents with episodic memory capabilities, allowing them to:

  • Log task executions as episodes with outcomes, errors, and context
  • Extract patterns from past experiences, especially failures
  • Promote proven strategies into reusable skills
  • Retrieve relevant context before starting new tasks
  • Learn from mistakes to avoid repeating them

Installation

One-Command Installers (curl)

Use these from the target project directory.

Gemini CLI

curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-gemini.sh | bash

This installs the Gemini plugin and configures memlayer MCP in .gemini/settings.json.
Then run /mcp auth memlayer in Gemini to complete MCP login. By default, installer checkout ref is main (override with MEMLAYER_REPO_REF).

Claude Code

curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-claude.sh | bash

This adds the plugin marketplace, installs memory@ProcIQ, and configures the memlayer MCP server in Claude.

Codex CLI

curl -fsSL https://raw.githubusercontent.com/shafty023/MemLayer-Plugin/main/install-codex.sh | bash

This installs the memory-usage skill into ${CODEX_HOME:-~/.codex}/skills, updates the current repo's AGENTS.md, configures MCP, and prints the codex mcp login memlayer step for you to run explicitly. By default, installer checkout ref is main (override with MEMLAYER_REPO_REF).

Claude Code

  1. Add the marketplace to Claude Code:

    /plugin marketplace add shafty023/MemLayer-Plugin
    
  2. Install the memory plugin:

    /plugin install memory@ProcIQ
    
  3. Configure the prociq MCP server with your API key (see prociq.ai for setup)

For more details on plugin installation, see the official documentation.

Gemini CLI

See the Gemini Plugin Documentation for installation and setup instructions.

Codex CLI

See the Codex Plugin Documentation for installation and setup instructions.

Project Structure

MemLayer-Plugin/
├── .claude-plugin/           # Claude marketplace registration
├── codex/                    # Codex CLI installer and policy template
│   ├── setup.sh
│   └── templates/
├── gemini/                   # Gemini CLI installer and manifest
│   ├── manifest.json
│   └── setup.sh
└── plugins/
    └── memory/               # Claude Code plugin and shared skill source
        ├── .claude-plugin/
        │   └── plugin.json   # Plugin manifest
        ├── commands/         # CLI commands
        │   ├── audit.md      # /memory:audit - inspect memory state
        │   ├── teach.md      # /memory:teach - inject knowledge manually
        │   └── forget.md     # /memory:forget - remove episodes
        ├── hooks/            # Integration hooks
        │   ├── hooks.json
        │   └── scripts/
        │       ├── session-start.sh
        │       └── user-prompt.sh
        └── skills/
            └── memory-usage/
                └── SKILL.md  # Canonical memory system usage guide

Commands

/memory:audit [episodes|patterns|skills]

Inspect the current state of the memory system. Shows statistics, recent episodes, high-confidence patterns, and skill inventory.

/memory:teach <lesson>

Manually inject knowledge into the memory system without task execution.

/memory:teach When using Detox with animations, always add explicit waitFor timeouts of at least 5000ms

/memory:forget <episode-id|query>

Remove specific episodes from memory. Can search by query or delete by ID.

Core Concepts

Episodes

Records of task execution containing:

  • Task goal and approach taken
  • Outcome (success/partial/failure)
  • Error details if applicable
  • Tools used and file patterns involved
  • Importance score (0.0–1.0)

Patterns

Derived learnings extracted from multiple episodes:

  • Root cause analysis
  • Recommended strategy
  • Trigger conditions (errors, keywords, tools)

Skills

Mature, high-confidence patterns promoted to reusable knowledge that gets surfaced when relevant tasks arise.

Notes

Persistent freeform knowledge entries that never decay (unlike episodes):

  • Recording important discoveries that shouldn't fade
  • Documenting project-specific knowledge
  • Manual teaching via /memory:teach command
  • Reference material that should always be findable

Consolidation

Automatic processing that:

  • Clusters similar episodes
  • Extracts patterns from failures
  • Decays old/low-value episodes
  • Promotes patterns to skills

Memory Tools (MCP)

Episode Tools

ToolPurpose
prociq_log_episodeRecord task execution (async, non-blocking)
prociq_retrieve_contextGet relevant past experiences before a task
prociq_search_episodesSearch with filters (outcome, error_type, project)
prociq_get_episodeRetrieve full episode by ID
prociq_search_episodes_fullSemantic search returning full episodes
prociq_forget_episodesDelete episodes permanently
prociq_archive_episodeSoft-delete episodes (reversible)

Note Tools

ToolPurpose
prociq_log_noteStore persistent freeform knowledge
prociq_update_noteModify existing note
prociq_get_noteRetrieve note by ID
prociq_search_notesSearch notes by content or tags
prociq_delete_noteRemove note from storage

Pattern & Skill Tools

ToolPurpose
prociq_search_patternsSearch patterns with filters
prociq_list_skillsList all available skills
prociq_get_skill_contentRetrieve skill markdown by ID

System Tools

ToolPurpose
prociq_get_memory_statsView memory health and statistics
prociq_trigger_consolidationManually run memory maintenance

Best Practices

When to Log

Do log:

  • Failures (always, before retrying)
  • Non-obvious solutions requiring investigation
  • First-time task types
  • Recurring problem categories (config, debugging, integration)

Don't log:

  • Trivial fixes (typos, missing imports)
  • Routine CRUD operations
  • Pure research/exploration tasks

Importance Scoring

ScenarioScore
Normal success0.2–0.3
First-time task type0.5–0.6
Learned something new0.7–0.8
Critical discovery/failure0.9–1.0

Critical Rule: Log Failures First

Always log a failure before retrying. This captures the exact error context that would otherwise be lost after a successful retry.

How Hooks Work

  1. SessionStart — Reminds Claude about available memory tools
  2. UserPromptSubmit — Injects memory workflow into TodoWrite (check memory first, log outcome last)
  3. Stop — Reminds Claude to log failures and suggests reflection

License

MIT License — see LICENSE for details.

Author

Daniel Ochoa (@shafty023)

Server Config

{
  "mcpServers": {
    "prociq_mcp": {
      "type": "http",
      "url": "https://prociq.ai/mcp"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.