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.6.tar.gz (51.0 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.6-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abstractmemory-0.2.6.tar.gz
  • Upload date:
  • Size: 51.0 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.6.tar.gz
Algorithm Hash digest
SHA256 f5ce007c0544b3b6ebfcb2f7987298cf775fd0ec79c8e7d6b174728ba94131e6
MD5 b5a7397b8b2cd509a8c08af4223a833b
BLAKE2b-256 933ea8daccda13f10d42346b4330acbde64a13a2ee59852ecc270b1036cff2e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractmemory-0.2.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: abstractmemory-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e1de6c0fff124ca55faf63c40101bfd77dcc5e9b5a50c1fd900640b1b1a925
MD5 e33400211ef2b4e74ea3410aaf920292
BLAKE2b-256 ac75e7a61f2430315aa69383c535b78e155b5fc47db996f14ea1bab7bb5188ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for abstractmemory-0.2.6-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