# leanagent | LeanDojo | Knowledge Base | Instagit

LeanAgent is a novel lifelong learning framework for formal theorem proving that continuously generalizes to and improves on ever-expanding mathematical knowledge without forgetting previously learned knowledge.

GitHub Stars: 58

Repository: https://github.com/lean-dojo/leanagent

---

## Articles

### [How LeanAgent Generates Unique Theorem Identifiers Across Repository Versions](/lean-dojo/leanagent/how-does-leanagent-generate-unique-theorem-identifiers-across-repository-versions)

Discover how LeanAgent generates unique theorem identifiers by combining name file path and source code positions for reliable deduplication across repository versions.

- Tags: internals
- Published: 2026-03-05

### [How to Use Custom PyTorch Lightning Callbacks for Monitoring Training Progress in LeanAgent](/lean-dojo/leanagent/how-are-custom-pytorch-lightning-callbacks-used-for-monitoring-training-progress)

Learn how to leverage custom PyTorch Lightning callbacks in LeanAgent to monitor training progress effectively. Automatically save checkpoints, track metrics, and log learning rates with ease.

- Tags: how-to-guide
- Published: 2026-03-05

### [Theorem Deduplication Priority Logic When Merging Multiple Repositories in LeanAgent](/lean-dojo/leanagent/what-is-the-theorem-deduplication-priority-logic-when-merging-multiple-repositories)

Understand LeanAgent's theorem deduplication priority logic when merging repos. Learn how recent date processed and canonical keys ensure the correct theorem version is kept.

- Tags: deep-dive
- Published: 2026-03-05

### [How LeanAgent Implements Curriculum Learning Strategy with Easy/Medium/Hard Difficulty Categories](/lean-dojo/leanagent/how-is-the-curriculum-learning-strategy-implemented-with-easy-medium-hard-difficulty-categories)

Learn how LeanAgent implements curriculum learning. Discover its Easy/Medium/Hard difficulty categories for effective theorem training and progressively complex learning.

- Tags: how-to-guide
- Published: 2026-03-05

### [How LeanAgent Uses LeanDojo's Tracing Functionality to Extract Theorem Data](/lean-dojo/leanagent/how-does-leanagent-use-leandojos-tracing-functionality-to-extract-theorem-data)

Discover how LeanAgent leverages LeanDojo's tracing to capture tactic executions and extract theorem data into structured TracedTheorem objects. Learn more about this powerful integration.

- Tags: how-to-guide
- Published: 2026-03-05

### [How LeanAgent Identifies and Batch Processes Theorems Marked with 'sorry'](/lean-dojo/leanagent/how-does-leanagent-identify-and-batch-process-theorems-marked-with-sorry)

Learn how LeanAgent identifies and batch processes theorems marked with sorry. It scans theorem traces, batches incomplete proofs, and migrates them to proved status with persistent logs.

- Tags: how-to-guide
- Published: 2026-03-05

### [PremiseRetriever Checkpoint Strategy in LeanAgent: Optimizing for R@10 Metric](/lean-dojo/leanagent/what-is-the-checkpoint-strategy-for-the-premisere-triever-model-based-on-r-10-metric)

Discover the PremiseRetriever checkpoint strategy in LeanAgent. Learn how R@10 optimization preserves retrieval performance for effective lifelong learning.

- Tags: deep-dive
- Published: 2026-03-05

### [How LeanAgent Filters and Selects Relevant Premises During Proof Search](/lean-dojo/leanagent/how-does-leanagent-filter-and-select-relevant-premises-during-proof-search-top-25-logic)

Learn how LeanAgent efficiently filters and selects relevant premises during proof search. Discover its T5-based retrieval for enhanced tactic generation.

- Tags: deep-dive
- Published: 2026-03-05

### [Timeout Configurations and Limits for Theorem Proving Attempts in LeanAgent](/lean-dojo/leanagent/what-are-the-timeout-configurations-and-limits-for-theorem-proving-attempts)

Explore LeanAgent's timeout configurations for theorem proving. Learn about the 600-second default limit, expansion options, and a 1-second buffer to optimize attempts.

- Tags: how-to-guide
- Published: 2026-03-05

### [How LeanAgent Uses File Dependency Graphs for Premise Ordering in Proofs](/lean-dojo/leanagent/how-does-leanagent-handle-file-dependency-graphs-for-premise-ordering-in-proofs)

Learn how LeanAgent uses file dependency graphs to order premises in proofs. Discover how it ensures theorems and definitions appear after their dependencies for efficient proof construction.

- Tags: deep-dive
- Published: 2026-03-05

### [How the Annotation System Links Tactics to Mathematical Premises in Lean Agent](/lean-dojo/leanagent/how-does-the-annotation-system-link-tactics-to-mathematical-premises)

Discover how the Lean Agent annotation system connects tactics to mathematical premises. Learn about its three-layer bridge from low-level tactics to high-level mathematical objects.

- Tags: how-to-guide
- Published: 2026-03-05

### [How the ReProver Retriever Works: Architecture and Training in LeanAgent](/lean-dojo/leanagent/how-does-the-reprover-retriever-work-and-what-is-its-training-procedure)

Discover how the ReProver retriever works and its training process. Learn about its T5 encoder, contrastive learning, and EWC for efficient premise selection in LeanAgent.

- Tags: architecture
- Published: 2026-03-05

### [Proof State Representation and Tactic Application in LeanAgent: A Deep Dive](/lean-dojo/leanagent/what-is-the-proof-state-representation-and-how-are-tactics-applied-through-lean)

Explore proof state representation and tactic application in LeanAgent. Learn how LeanAgent interacts with the Lean proof assistant to apply tactics and manage proof states effectively.

- Tags: deep-dive
- Published: 2026-03-05

### [How PyTorch Lightning DDP Strategy is Configured for Multi-GPU Training in LeanAgent](/lean-dojo/leanagent/how-is-pytorch-lightnings-ddp-strategy-configured-for-multi-gpu-training-in-leanagent)

Learn how LeanAgent configures PyTorch Lightning's DDP strategy leveraging NCCL timeout, four GPUs, and bf16-mixed precision for stable multi-GPU training of retrieval models.

- Tags: how-to-guide
- Published: 2026-03-05

### [How Ray Powers Distributed Proof Search in LeanAgent: Architecture and Configuration](/lean-dojo/leanagent/what-is-the-role-of-ray-in-leanagents-distributed-architecture-and-how-is-it-configured)

Discover how LeanAgent leverages Ray for distributed proof search. Explore its architecture and configuration for efficient parallel processing using a fault-tolerant actor model.

- Tags: architecture
- Published: 2026-03-05

### [How LeanAgent Creates and Manages GitHub Pull Requests for Proven Theorems](/lean-dojo/leanagent/how-does-leanagent-create-and-manage-github-pull-requests-for-proven-theorems)

Discover how LeanAgent automates GitHub pull request creation for proven theorems. Learn about its workflow from theorem detection to API-driven contributions.

- Tags: how-to-guide
- Published: 2026-03-05

### [How Progressive Training Prevents Catastrophic Forgetting in LeanAgent](/lean-dojo/leanagent/how-does-progressive-training-prevent-catastrophic-forgetting-during-lifelong-learning)

Discover how LeanAgent's progressive training prevents catastrophic forgetting in lifelong learning. Learn about curriculum-based EWC and parameter preservation.

- Tags: deep-dive
- Published: 2026-03-05

### [Dynamic Database JSON Serialization in LeanAgent: Structure and Non-Serializable Type Handling](/lean-dojo/leanagent/what-is-the-structure-of-the-dynamic-database-json-serialization-and-how-are-non-serializable-types-handled)

Explore dynamic database JSON serialization in LeanAgent. See how Lean proof repositories are converted to JSON and how non-serializable types like datetime and Path are handled via to_dict methods.

- Tags: deep-dive
- Published: 2026-03-05

### [How LeanAgent Handles Lean Version Compatibility Across Diverse Lean 4 Repositories](/lean-dojo/leanagent/how-does-leanagent-handle-lean-version-compatibility-when-processing-repositories-with-different-toolchain-versions)

LeanAgent ensures Lean version compatibility across diverse repositories by checking lean-toolchain files and automatically finding compatible commits.

- Tags: internals
- Published: 2026-03-05

### [Fisher Information Matrix Computation and Elastic Weight Consolidation (EWC) in LeanAgent](/lean-dojo/leanagent/how-is-the-fisher-information-matrix-computed-and-used-for-elastic-weight-consolidation-ewc)

Learn how LeanAgent computes the Fisher Information Matrix for Elastic Weight Consolidation. Discover its use in protecting learned knowledge during fine-tuning.

- Tags: deep-dive
- Published: 2026-03-05

### [How the Best-First Tree Search Algorithm Proves 'Sorry' Theorems in LeanAgent](/lean-dojo/leanagent/how-does-the-best-first-tree-search-algorithm-work-for-proving-sorry-theorems)

Discover how LeanAgent's best-first tree search algorithm proves 'sorry' theorems by prioritizing tactic states and expanding promising nodes to achieve ProofFinished.

- Tags: deep-dive
- Published: 2026-03-05

### [How LeanAgent Calculates the Complexity Metric for Curriculum Learning from Proof Steps](/lean-dojo/leanagent/what-is-the-complexity-metric-used-for-curriculum-learning-and-how-is-it-calculated-from-proof-steps)

Discover how LeanAgent computes its complexity metric for curriculum learning using proof steps. Learn about its approach to incomplete and unprocessed theorems.

- Tags: how-to-guide
- Published: 2026-03-05

### [How LeanAgent Deduplicates Theorems When Merging Repositories in the Dynamic Database](/lean-dojo/leanagent/how-does-leanagent-handle-theorem-deduplication-when-merging-repositories-in-the-dynamic-database)

LeanAgent deduplicates theorems during repository merges using a composite key and timestamp to ensure data integrity. Learn how it prevents duplicates in the dynamic database.

- Tags: internals
- Published: 2026-03-05

