RagLeap
PyPI package (alpha)

ragleap-memory

version — loading live from PyPI…

Alpha: durable, tenant-scoped long-term memory for LLM applications, stored in one SQLite file. Version 0.1.0. Open source (MIT). Not independently audited: its threat model says exactly what is and is not defended.

pypi license
pip install ragleap-memory

Highlights

  • SQLiteStore: one SQLite file (or memory) with FTS5 keyword search and no server. It needs a SQLite build with FTS5; the store refuses to start without it
  • Every call takes a Scope (from ragleap-security) and is filtered by it inside the SQL. Single-tenant use is simply one fixed Scope
  • Typed entries (episode, fact, summary) with a trust label (untrusted, model, owner). New entries default to untrusted
  • supersede for facts that change (history is kept), forget, export, erase (removes the text from the file), sweep_expired, and an optional audit log that records ids and counts only
  • Python 3.10 or newer. The only dependency is ragleap-security 0.1.0 or newer

Quickstart

from ragleap_memory import SQLiteStore
from ragleap_security import Scope

store = SQLiteStore("memory.db")
alice = Scope("acme", subject="alice")

old = store.add(alice, "Alice prefers email", trust="owner")
new = store.supersede(alice, old.id, "Alice prefers phone calls", trust="owner")

for hit in store.search(alice, "how should we contact alice", k=3, min_trust="model"):
    print(hit.entry.trust, hit.entry.text)

The store labels trust but does not decide what to do with retrieved text. Code that puts memory into a prompt must treat anything below owner as untrusted input.

Verified, and limits

  • Verified in 0.1.0 (from its changelog): 89 tests pass on Python 3.10 and 3.12, the CI test job passes on 3.10, 3.11 and 3.12, and all 27 deliberate breaks of a protection are caught by the mutation check. After erase(), a byte-level search of the database file and its journal found no trace of the deleted text, on the two SQLite builds tested. Our own count of the repository on main is on the tests page
  • Search quality has not been measured on any benchmark
  • Not in 0.1.0: embeddings and vector search, consolidation and retention policies, importance-based ranking, Postgres, encryption at rest, a review queue and the ragleap-agents adapter. These are planned (issue 900) and not available
  • Alpha and not independently audited. Read the threat model before relying on it
PyPI page Source Changelog Threat model