Skip to main content

Continual learning layer for coding agents and software projects.

Project description

Lerim Logo

Persistent memory for coding agents.

PyPI version Python versions License Tests GitHub stars

lerim.dev · docs · pypi

Summary

Lerim is a memory layer for coding agents. It watches agent sessions, extracts durable memories with PydanticAI, and saves them as plain markdown in .lerim/memory/.

Why teams use it:

  • Keep project decisions and reasoning across sessions.
  • Share context between different coding agents.
  • Ask questions against past work with lerim ask.
  • Keep data local and file-based.

Supported session adapters today: Claude Code, Codex CLI, Cursor, and OpenCode.

How to use

Prerequisites: Python 3.10+ and Docker (recommended).

Install and bootstrap:

pip install lerim
lerim init
lerim project add .
lerim up

If you want a local Docker build instead of pulling from GHCR:

lerim up --build

Use --build from a source checkout (local Dockerfile available). For normal PyPI installs, use lerim up.

Daily flow:

lerim sync
lerim maintain
lerim ask "Why did we choose this approach?"

These commands call the running Lerim service (lerim up or lerim serve).

Quick validation flow before release:

lerim down
lerim up --build
lerim sync
lerim maintain
lerim ask "What are the latest important memories?"

Runtime model

Lerim runs three PydanticAI-based agent flows:

  • sync: indexes sessions and extracts memories.
  • maintain: merges duplicates, archives low-value items, refreshes memory quality.
  • ask: answers questions with memory context and citations.

Memories are markdown files under project scope (<repo>/.lerim/memory/) with fallback in ~/.lerim/memory/.

Configuration

lerim init can set this up for you. API keys are read from environment variables (stored in ~/.lerim/.env by default).

# ~/.lerim/.env
MINIMAX_API_KEY=your-key
# add provider keys you use:
# OPENROUTER_API_KEY, OPENAI_API_KEY, MINIMAX_API_KEY, ZAI_API_KEY

Default provider example (MiniMax):

[roles.agent]
provider = "minimax"
model = "MiniMax-M2.7"
fallback_models = ["zai:glm-4.7"]

Commands

Most-used commands:

lerim status
lerim status --live
lerim logs --follow
lerim queue
lerim queue --failed
lerim unscoped --limit 20
lerim memory list --limit 20

Setup and management:

lerim connect auto
lerim project list
lerim project remove <name>
lerim skill install

Alternative to Docker:

lerim serve

Web UI

Web UI is not bundled in this repo yet. Use lerim dashboard for current status and CLI alternatives.

Docs

Development

uv venv && source .venv/bin/activate
uv pip install -e '.[test]'
tests/run_tests.sh unit
tests/run_tests.sh quality

Contributing

Contributions are welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lerim-0.1.71.tar.gz (144.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lerim-0.1.71-py3-none-any.whl (162.1 kB view details)

Uploaded Python 3

File details

Details for the file lerim-0.1.71.tar.gz.

File metadata

  • Download URL: lerim-0.1.71.tar.gz
  • Upload date:
  • Size: 144.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lerim-0.1.71.tar.gz
Algorithm Hash digest
SHA256 a978b7adc0db18669a5cce6630c628dfb529a5416f51e6d3e353628c52aac9f1
MD5 086e6ce43f3f5bc2353a81c93becd1ca
BLAKE2b-256 540fb6e1eed4964657ceeee12f50bca9acbd5833a94374764d7c9b8694d79736

See more details on using hashes here.

Provenance

The following attestation bundles were made for lerim-0.1.71.tar.gz:

Publisher: publish.yml on lerim-dev/lerim-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lerim-0.1.71-py3-none-any.whl.

File metadata

  • Download URL: lerim-0.1.71-py3-none-any.whl
  • Upload date:
  • Size: 162.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lerim-0.1.71-py3-none-any.whl
Algorithm Hash digest
SHA256 87eb503246cf3886a65d16beaa43d5e233138cb7a819d69c7a4f082144021337
MD5 b7023f28466f94248446558a368c612e
BLAKE2b-256 8c2410d25a6562a70bb9fbbe12226e689fb2ad695f113c8ceaa4b4156254301f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lerim-0.1.71-py3-none-any.whl:

Publisher: publish.yml on lerim-dev/lerim-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page