Skip to main content

A forgetting layer for RAG systems — heat-based decay, tiered storage, graceful eviction.

Project description

forget-rag

A forgetting layer for RAG systems — heat-based decay, tiered storage, and graceful eviction so your knowledge base doesn't get dumber over time.

Status: v0.1 (alpha). BM25 + heat ranking, L1/L2/L3 tiers, soft delete with restore-ready schema. Vector layer lands in v0.2.

Install

pip install forget-rag

# with the LangChain adapter
pip install "forget-rag[langchain]"

Quickstart

from forget_rag import ForgettingMemory

memory = ForgettingMemory(
    backend="sqlite",
    decay_halflife_days=30,
    tiers={"L1": 1000, "L2": 10000, "L3": "unlimited"},
)

memory.add("Some knowledge chunk", tags=["meeting", "2026-Q1"])
results = memory.search("query", limit=5)   # auto-promotes hot chunks
report = memory.health_check()              # what should be forgotten?

What's in the box

  • Heat score — every chunk has a decay function based on access frequency + recency.
  • L1 / L2 / L3 tiers — modeled after CPU cache; hot stays in vector
    • FTS, warm in FTS only, cold is archived but searchable.
  • Soft deleteforget() flags rather than drops; v0.2 will expose restore() on top of the existing forgotten_at column.
  • LangChain adapterForgettingRetriever extends BaseRetriever for drop-in chain use.

Companion CLI

The mem-broom companion package wraps this library with a typer-based CLI for ad-hoc memory hygiene. v0.1 ships it as a git install (the PyPI publish is deferred — see the project README for the install command).

Links

License

MIT.

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

forget_rag-0.1.0.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

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

forget_rag-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file forget_rag-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for forget_rag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7467fcd19daafa74f94e38ac58fddb0b69d30ef62b8c7c84c9bcc2eb7841fb4
MD5 0deb8a1278194a4d56b282daf99c1102
BLAKE2b-256 9a7f994f417755ea7765450f97e167380a7e6f5c5dfdbdc5bf60430c121e7b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for forget_rag-0.1.0.tar.gz:

Publisher: publish.yml on zx22413/forget-rag

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

File details

Details for the file forget_rag-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for forget_rag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff5a3e1da60b9ca408fed159e842cee07f1d4a801d28f41b681abe2e858c8ca
MD5 5a26cd4047ae8af3fcca4fcaa18d6c6c
BLAKE2b-256 89a917a43f1072ddad5e75d6326e53b4e368555e8b218693955a6cbb6d322d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for forget_rag-0.1.0-py3-none-any.whl:

Publisher: publish.yml on zx22413/forget-rag

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