Skip to main content

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.
  • 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

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.0.2.tar.gz (22.6 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.0.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

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

Hashes for abstractmemory-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ef449e5b1e8f552c880bc40d7e73a569cf38115bdc4ac7e04bb25032286f1dfc
MD5 f70506c2cde0e9e1dd2a80ee35945515
BLAKE2b-256 3095ed4c6bb7a743931c7cca48c82d78b43db9cd29be4a3dd717e45c86459d65

See more details on using hashes here.

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

Hashes for abstractmemory-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 096fdb7a50bcd0edde51c5f48e2b65d295ccd87e9a3683e91cf7266b522bf77c
MD5 c388666ea02d8fb84b83f9110da15e67
BLAKE2b-256 1eff9cf2b5193bba6d115a6d6517f934f092beb24d556a7a44691cd652c70655

See more details on using hashes here.

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