Skip to main content

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 delete — forget() flags rather than drops; v0.2 will expose restore() on top of the existing forgotten_at column.
  • LangChain adapter — ForgettingRetriever 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.

Metadata

Release files for forget-rag 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forget-rag 0.1.0
File Size Uploaded Provenance
forget_rag-0.1.0.tar.gz 25.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for forget-rag 0.1.0
File Interpreter ABI Platform
forget_rag-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.5 kB

Release files / forget_rag-0.1.0.tar.gz

Download URL forget_rag-0.1.0.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e7467fcd19daafa74f94e38ac58fddb0b69d30ef62b8c7c84c9bcc2eb7841fb4
BLAKE2b-256 checksum
How to use checksums
9a7f994f417755ea7765450f97e167380a7e6f5c5dfdbdc5bf60430c121e7b24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / forget_rag-0.1.0-py3-none-any.whl

Download URL forget_rag-0.1.0-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ff5a3e1da60b9ca408fed159e842cee07f1d4a801d28f41b681abe2e858c8ca
BLAKE2b-256 checksum
How to use checksums
89a917a43f1072ddad5e75d6326e53b4e368555e8b218693955a6cbb6d322d03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Security for forget-rag 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for forget_rag-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page