Skip to main content

AbstractMemory: temporal, provenance-aware semantic memory primitives for AbstractFramework.

Project description

AbstractMemory (early / pre-1.0)

AbstractMemory is a small Python library for append-only, temporal, provenance-aware triple assertions with deterministic structured queries and optional vector/semantic retrieval.

Status

  • This package is early (pre-1.0): the API is intentionally small, and details may evolve.
  • Current repo version: 0.2.4 (see pyproject.toml).
  • Implemented today (public API): TripleAssertion, TripleQuery, TripleStore, InMemoryTripleStore, SQLiteTripleStore, LanceDBTripleStore, TextEmbedder, AbstractGatewayTextEmbedder.
  • Requires Python 3.10+ (see pyproject.toml)
  • Release-channel note: this checkout is the source of truth for this documentation. As of 2026-05-05, PyPI's AbstractMemory 0.2.3 has a different source layout from this repository and origin only has tags through v0.2.2; treat that mismatch as release drift until a maintainer republishes/tags from this repo.

Ecosystem (AbstractFramework)

AbstractMemory is part of the AbstractFramework ecosystem:

  • It stores and retrieves durable “memory” as append-only triples (this package).
  • It can optionally call an AbstractGateway embeddings endpoint for semantic retrieval via AbstractGatewayTextEmbedder (no direct AbstractCore/AbstractRuntime dependency).

Evidence:

flowchart LR
  APP["Your app or agent"] --> AM["AbstractMemory"]
  AM --> IM["InMemoryTripleStore"]
  AM --> SQL["SQLiteTripleStore"]
  AM --> LDB["LanceDBTripleStore"]
  SQL --> SQLITE[("SQLite file")]
  LDB --> DISK[("LanceDB on disk")]

  AM -- "optional embeddings" --> GW["AbstractGateway"]
  GW --> AR["AbstractRuntime"]
  GW --> AC["AbstractCore"]

Related projects:

  • AbstractFramework: https://github.com/lpalbou/AbstractFramework
  • AbstractCore: https://github.com/lpalbou/abstractcore
  • AbstractRuntime: https://github.com/lpalbou/abstractruntime

Install

From source (recommended inside the AbstractFramework monorepo):

python -m pip install -e .

Optional persistent backend + vector search:

python -m pip install -e ".[lancedb]"

PyPI (packaged release):

python -m pip install AbstractMemory
python -m pip install "AbstractMemory[lancedb]"

Framework hardware profile aliases are also available: AbstractMemory[apple] and AbstractMemory[gpu] are no-op compatibility extras; AbstractMemory[all-apple] and AbstractMemory[all-gpu] install the LanceDB backend for durable vector-capable recall.

Notes:

  • The distribution name is AbstractMemory (pip is case-insensitive). The import name is abstractmemory.
  • PyPI releases may not match this repository checkout exactly; see the release-channel note above.

Quick example

from abstractmemory import InMemoryTripleStore, TripleAssertion, TripleQuery

store = InMemoryTripleStore()
store.add(
    [
        TripleAssertion(
            subject="Scrooge",
            predicate="related_to",
            object="Christmas",
            scope="session",
            owner_id="sess-1",
            provenance={"span_id": "span_123"},
        )
    ]
)

hits = store.query(TripleQuery(subject="scrooge", scope="session", owner_id="sess-1"))
assert hits[0].object == "christmas"  # terms are canonicalized (trim + lowercase)

Documentation

Project

Design principles (v0)

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

abstractmemory-0.2.5.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

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

abstractmemory-0.2.5-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file abstractmemory-0.2.5.tar.gz.

File metadata

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

File hashes

Hashes for abstractmemory-0.2.5.tar.gz
Algorithm Hash digest
SHA256 2ccaa2455aac3f3f577382e7103f4a52ec2efede14d711ebfe4211d467d7aa63
MD5 c0e4f914cd81c9c01558c96530b51821
BLAKE2b-256 599ea31515ab3b3b0be9f0eaf64dfff83c2d3b0f2df602f9172ed9e08e0bdaf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractmemory-0.2.5.tar.gz:

Publisher: release.yml on lpalbou/AbstractMemory

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

File details

Details for the file abstractmemory-0.2.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for abstractmemory-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ba3e9a77bd65979089df8aac97ee4927efc6846c33e4e0c59c7da789d2f6f96d
MD5 b7e8bb847385d1519fa143cafe6a19ee
BLAKE2b-256 a0eccd3d354ede23872ec0f1280fcbf4f959f3671cdbffed37816daff7812291

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractmemory-0.2.5-py3-none-any.whl:

Publisher: release.yml on lpalbou/AbstractMemory

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