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(seepyproject.toml). - Implemented today (public API):
TripleAssertion,TripleQuery,TripleStore,InMemoryTripleStore,SQLiteTripleStore,LanceDBTripleStore,TextEmbedder,AbstractGatewayTextEmbedder.- Source of truth for exports:
src/abstractmemory/__init__.py
- Source of truth for exports:
- 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.3has a different source layout from this repository andoriginonly has tags throughv0.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:
- No direct dependency on AbstractCore/AbstractRuntime:
pyproject.toml - Gateway adapter implementation:
src/abstractmemory/embeddings.py
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 isabstractmemory. - 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
- Getting started:
docs/getting-started.md - FAQ:
docs/faq.md - Architecture (with diagrams):
docs/architecture.md - Stores/backends:
docs/stores.md - API reference:
docs/api.md - Development:
docs/development.md
Project
- Changelog:
CHANGELOG.md - Contributing:
CONTRIBUTING.md - Security:
SECURITY.md - License:
LICENSE - Acknowledgments:
ACKNOWLEDGMENTS.md
Design principles (v0)
- Triples-first representation with temporal fields (
observed_at,valid_from,valid_until).- Implemented in
TripleAssertion:src/abstractmemory/models.py
- Implemented in
- Append-only: represent updates by adding a new assertion with fresh provenance.
- Implemented by all stores:
src/abstractmemory/in_memory_store.py,src/abstractmemory/sqlite_store.py,src/abstractmemory/lancedb_store.py
- Implemented by all stores:
- No direct AbstractCore dependency: embeddings can be obtained via an AbstractGateway HTTP API.
- Implemented by
AbstractGatewayTextEmbedder:src/abstractmemory/embeddings.py
- Implemented by
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ce007c0544b3b6ebfcb2f7987298cf775fd0ec79c8e7d6b174728ba94131e6
|
|
| MD5 |
b5a7397b8b2cd509a8c08af4223a833b
|
|
| BLAKE2b-256 |
933ea8daccda13f10d42346b4330acbde64a13a2ee59852ecc270b1036cff2e5
|
Provenance
The following attestation bundles were made for abstractmemory-0.2.6.tar.gz:
Publisher:
release.yml on lpalbou/AbstractMemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractmemory-0.2.6.tar.gz -
Subject digest:
f5ce007c0544b3b6ebfcb2f7987298cf775fd0ec79c8e7d6b174728ba94131e6 - Sigstore transparency entry: 1479607711
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractMemory@ac6fc08c2de251d9d249d9bc68865c339c95435c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ac6fc08c2de251d9d249d9bc68865c339c95435c -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7e1de6c0fff124ca55faf63c40101bfd77dcc5e9b5a50c1fd900640b1b1a925
|
|
| MD5 |
e33400211ef2b4e74ea3410aaf920292
|
|
| BLAKE2b-256 |
ac75e7a61f2430315aa69383c535b78e155b5fc47db996f14ea1bab7bb5188ee
|
Provenance
The following attestation bundles were made for abstractmemory-0.2.6-py3-none-any.whl:
Publisher:
release.yml on lpalbou/AbstractMemory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractmemory-0.2.6-py3-none-any.whl -
Subject digest:
a7e1de6c0fff124ca55faf63c40101bfd77dcc5e9b5a50c1fd900640b1b1a925 - Sigstore transparency entry: 1479607831
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractMemory@ac6fc08c2de251d9d249d9bc68865c339c95435c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ac6fc08c2de251d9d249d9bc68865c339c95435c -
Trigger Event:
workflow_dispatch
-
Statement type: