lean4-memories

Store and retrieve Lean 4 proof patterns and conventions via MCP memory server.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill lean4-memories-generalreasoning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean4-memories
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/lean4-proof/environment/skills/lean4-memories
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill lean4-memories-generalreasoning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Persistently store and retrieve Lean 4 proof patterns, failed approaches, project conventions, and user preferences across sessions using an MCP memory server, enabling reuse and reducing repeated dead-ends.

Core Features & Use Cases

  • Persistent memory across sessions for ProofPattern, FailedApproach, ProjectConvention, UserPreference, and TheoremDependency
  • Project-scoped memory with explicit tagging, retrieval before proving, and guidance for tactic selection
  • Integration with automated workflows and scripts to store, query, and prune memories and to share learned patterns across tasks

Quick Start

Run the memory helper after finishing a proof to store the pattern, then query for similar patterns before starting a new proof to guide tactic choice.

Frequently Asked Questions about lean4-memories

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save Lean 4 proof patterns to reuse across different sessions?

To save Lean 4 proof patterns across sessions, you can use this memory server to store successful tactics as ProofPattern entities. It enables persistent retrieval of past proofs to guide future tactic selection and avoid repeated dead-ends.

What is the best way to track failed approaches in Lean 4 theorem proving?

The best way to track failed approaches in Lean 4 theorem proving is by storing them as FailedApproach entities using the MCP memory server. This allows you to query past unsuccessful tactics before starting a new proof and avoid repeating dead-ends.

Can I store project conventions for Lean 4 formalization projects?

Yes, you can store project conventions for Lean 4 formalization projects. The memory system organizes data into specific entity types including ProjectConvention, ensuring your project-scoped rules are persistently saved and queried during theorem proving.

How does an MCP memory server work with Lean 4 automation scripts?

An MCP memory server works with Lean 4 automation scripts by providing project-scoped, configurable memory storage. The scripts automatically store, query, and prune memories like TheoremDependency and UserPreference to share learned patterns across tasks.

How do I prune outdated memories in a Lean 4 proof database?

To prune outdated memories in a Lean 4 proof database, you can use the integrated automation scripts. These scripts manage the MCP memory server by removing stale entries and ensuring only relevant project-scoped patterns are kept for theorem proving.