AbstractMemory: temporal, provenance-aware semantic memory primitives for AbstractFramework.
Project description
AbstractMemory (early / WIP)
AbstractMemory is a small Python library for append-only, temporal, provenance-aware triple assertions with a deterministic query API and optional vector/semantic retrieval.
Status
- This package is still early: API and storage details may change.
- Implemented today:
TripleAssertion,TripleQuery,InMemoryTripleStore,LanceDBTripleStore,AbstractGatewayTextEmbedder.- Source of truth for exports:
src/abstractmemory/__init__.py
- Source of truth for exports:
- Requires Python 3.10+ (see
pyproject.toml)
Install
From PyPI (when published):
python -m pip install AbstractMemory
Optional persistent backend + vector search:
python -m pip install "AbstractMemory[lancedb]"
Note: the distribution name is AbstractMemory (pip is case-insensitive). The import name is abstractmemory.
From source (recommended for this monorepo package):
python -m pip install -e .
Optional persistent backend + vector search:
python -m pip install -e ".[lancedb]"
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 both stores:
src/abstractmemory/in_memory_store.py,src/abstractmemory/lancedb_store.py
- Implemented by both 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.0.2.tar.gz.
File metadata
- Download URL: abstractmemory-0.0.2.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef449e5b1e8f552c880bc40d7e73a569cf38115bdc4ac7e04bb25032286f1dfc
|
|
| MD5 |
f70506c2cde0e9e1dd2a80ee35945515
|
|
| BLAKE2b-256 |
3095ed4c6bb7a743931c7cca48c82d78b43db9cd29be4a3dd717e45c86459d65
|
File details
Details for the file abstractmemory-0.0.2-py3-none-any.whl.
File metadata
- Download URL: abstractmemory-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
096fdb7a50bcd0edde51c5f48e2b65d295ccd87e9a3683e91cf7266b522bf77c
|
|
| MD5 |
c388666ea02d8fb84b83f9110da15e67
|
|
| BLAKE2b-256 |
1eff9cf2b5193bba6d115a6d6517f934f092beb24d556a7a44691cd652c70655
|