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.72.tar.gz (144.9 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.72-py3-none-any.whl (162.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lerim-0.1.72.tar.gz
  • Upload date:
  • Size: 144.9 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.72.tar.gz
Algorithm Hash digest
SHA256 ab7e700fcd0a6e5e3422737eb38ebdd3c6997fe6c0ec5b754b99d44ed563114f
MD5 19afc4c9d8d32d35698f6e3a3aac5631
BLAKE2b-256 e28bb51f29e744dd1f973f49ed0fe8095f7321ccdf748eb08536aa99efd61195

See more details on using hashes here.

Provenance

The following attestation bundles were made for lerim-0.1.72.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.72-py3-none-any.whl.

File metadata

  • Download URL: lerim-0.1.72-py3-none-any.whl
  • Upload date:
  • Size: 162.3 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.72-py3-none-any.whl
Algorithm Hash digest
SHA256 0850e00b41807923151172c5749faba60fbfb3f8cc27df4b7d3b9e954631fa53
MD5 138927026d013bb55fc0cb1dee3da111
BLAKE2b-256 efb37ee772281624a087a0717149d625da0ccbb0ba383112b69963c62b76d746

See more details on using hashes here.

Provenance

The following attestation bundles were made for lerim-0.1.72-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