elfmem: Adaptive Memory System That Lets AI Agents Learn, Forget, and Evolve Like Biological Memory

Available in: 中文
2026-03-29T13:46:09.735Z·2 min read
elfmem is a new Python library that gives LLM agents a biologically-inspired memory system — knowledge that gets stronger when used, fades when ignored, and is structured in a knowledge graph for r...

The Tool

elfmem is a new Python library that gives LLM agents a biologically-inspired memory system — knowledge that gets stronger when used, fades when ignored, and is structured in a knowledge graph for recovery. It's available on GitHub with zero infrastructure requirements.

The Problem It Solves

LLM agents are fundamentally stateless:

How elfmem Works

Core Concepts

Adaptive Decay: Knowledge survives when reinforced through use, fades when ignored. A session-aware clock means your agent's memory doesn't decay over weekends.

SELF Frame: Persistent agent identity. Values, style, and constraints survive across sessions with near-permanent retention.

Knowledge Graph: Related-but-not-identical knowledge is always recoverable through graph connections.

Contradiction Detection: Automatically identifies and resolves conflicting knowledge.

Usage

import asyncio
from elfmem import MemorySystem

system = await MemorySystem.from_config("agent.db", {
    "llm": {"model": "claude-sonnet-4-6"},
    "embeddings": {"model": "text-embedding-3-small"},
})

async with system.session():
    await system.learn("Use Celery with Redis for background tasks.")
    identity = await system.frame("self")
    context = await system.frame("attention", query="background job processing")

Infrastructure

Comparison

Featureelfmemmem0LangChain MemoryChroma/Weaviate
InfrastructureNone (SQLite)Postgres/RedisIn-memoryVector DB server
Adaptive decayYesNoNoNo
Knowledge graphYesNoNoNo
Contradiction detectionYesNoNoNo

Why It Matters

This is a fundamental shift in how agents maintain state:

GitHub: github.com/emson/elfmem

↗ Original source · 2026-03-29T00:00:00.000Z
← Previous: LinkedIn Consumes 2.4 GB RAM With Just Two Tabs Open: Web Bloat ContinuesNext: Japan Plans to Use Forex Reserves to Short Crude Oil Futures to Rescue Yen →
Comments0