AbstractMemory 0.2.3__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. abstractmemory-0.2.6/.github/ISSUE_TEMPLATE/bug_report.yml +73 -0
  2. abstractmemory-0.2.6/.github/workflows/ci.yml +48 -0
  3. abstractmemory-0.2.6/.github/workflows/release.yml +179 -0
  4. abstractmemory-0.2.6/.gitignore +10 -0
  5. abstractmemory-0.2.6/ACKNOWLEDGMENTS.md +15 -0
  6. abstractmemory-0.2.6/CHANGELOG.md +72 -0
  7. abstractmemory-0.2.6/CONTRIBUTING.md +61 -0
  8. {abstractmemory-0.2.3 → abstractmemory-0.2.6}/LICENSE +1 -4
  9. abstractmemory-0.2.6/PKG-INFO +155 -0
  10. abstractmemory-0.2.6/README.md +119 -0
  11. abstractmemory-0.2.6/SECURITY.md +29 -0
  12. abstractmemory-0.2.6/docs/README.md +21 -0
  13. abstractmemory-0.2.6/docs/api.md +112 -0
  14. abstractmemory-0.2.6/docs/architecture.md +182 -0
  15. abstractmemory-0.2.6/docs/backlog/overview.md +102 -0
  16. abstractmemory-0.2.6/docs/backlog/planned/001_semantics_aligned_memory_record_conventions.md +220 -0
  17. abstractmemory-0.2.6/docs/backlog/planned/002_sqlite_database_compatibility_and_store_capabilities.md +202 -0
  18. abstractmemory-0.2.6/docs/backlog/planned/003_bounded_graph_traversal_over_triples.md +210 -0
  19. abstractmemory-0.2.6/docs/backlog/planned/004_recall_trace_and_access_events_contract.md +195 -0
  20. abstractmemory-0.2.6/docs/backlog/planned/005_source_linked_summaries_and_derived_assertion_lineage.md +180 -0
  21. abstractmemory-0.2.6/docs/backlog/planned/006_deterministic_anchor_and_facet_index.md +193 -0
  22. abstractmemory-0.2.6/docs/backlog/planned/007_read_only_memory_observer_contract.md +169 -0
  23. abstractmemory-0.2.6/docs/backlog/proposed/2026-05-08_gateway_memory_install_and_config_boundary.md +169 -0
  24. abstractmemory-0.2.6/docs/development.md +31 -0
  25. abstractmemory-0.2.6/docs/faq.md +176 -0
  26. abstractmemory-0.2.6/docs/getting-started.md +166 -0
  27. abstractmemory-0.2.6/docs/stores.md +110 -0
  28. abstractmemory-0.2.6/llms-full.txt +257 -0
  29. abstractmemory-0.2.6/llms.txt +59 -0
  30. abstractmemory-0.2.6/pyproject.toml +66 -0
  31. abstractmemory-0.2.6/release-notes.md +7 -0
  32. abstractmemory-0.2.6/src/abstractmemory/__init__.py +17 -0
  33. abstractmemory-0.2.6/src/abstractmemory/embeddings.py +96 -0
  34. abstractmemory-0.2.6/src/abstractmemory/in_memory_store.py +186 -0
  35. abstractmemory-0.2.6/src/abstractmemory/lancedb_store.py +289 -0
  36. abstractmemory-0.2.6/src/abstractmemory/models.py +133 -0
  37. abstractmemory-0.2.6/src/abstractmemory/sqlite_store.py +217 -0
  38. abstractmemory-0.2.6/src/abstractmemory/store.py +90 -0
  39. abstractmemory-0.2.6/tests/conftest.py +28 -0
  40. abstractmemory-0.2.6/tests/test_in_memory_query_text_fallback.py +20 -0
  41. abstractmemory-0.2.6/tests/test_lancedb_triple_store.py +183 -0
  42. abstractmemory-0.2.6/tests/test_sqlite_triple_store.py +82 -0
  43. abstractmemory-0.2.6/tests/test_term_canonicalization.py +35 -0
  44. abstractmemory-0.2.6/tests/test_triple_store_limits.py +147 -0
  45. abstractmemory-0.2.3/AbstractMemory.egg-info/PKG-INFO +0 -481
  46. abstractmemory-0.2.3/AbstractMemory.egg-info/SOURCES.txt +0 -27
  47. abstractmemory-0.2.3/AbstractMemory.egg-info/dependency_links.txt +0 -1
  48. abstractmemory-0.2.3/AbstractMemory.egg-info/requires.txt +0 -22
  49. abstractmemory-0.2.3/AbstractMemory.egg-info/top_level.txt +0 -1
  50. abstractmemory-0.2.3/PKG-INFO +0 -481
  51. abstractmemory-0.2.3/README.md +0 -436
  52. abstractmemory-0.2.3/abstractmemory/__init__.py +0 -799
  53. abstractmemory-0.2.3/abstractmemory/cognitive/__init__.py +0 -1
  54. abstractmemory-0.2.3/abstractmemory/components/__init__.py +0 -1
  55. abstractmemory-0.2.3/abstractmemory/components/core.py +0 -112
  56. abstractmemory-0.2.3/abstractmemory/components/episodic.py +0 -68
  57. abstractmemory-0.2.3/abstractmemory/components/semantic.py +0 -102
  58. abstractmemory-0.2.3/abstractmemory/components/working.py +0 -50
  59. abstractmemory-0.2.3/abstractmemory/core/__init__.py +0 -1
  60. abstractmemory-0.2.3/abstractmemory/core/interfaces.py +0 -95
  61. abstractmemory-0.2.3/abstractmemory/core/temporal.py +0 -100
  62. abstractmemory-0.2.3/abstractmemory/embeddings/__init__.py +0 -354
  63. abstractmemory-0.2.3/abstractmemory/embeddings/sentence_transformer_provider.py +0 -159
  64. abstractmemory-0.2.3/abstractmemory/graph/__init__.py +0 -1
  65. abstractmemory-0.2.3/abstractmemory/graph/knowledge_graph.py +0 -178
  66. abstractmemory-0.2.3/abstractmemory/simple.py +0 -151
  67. abstractmemory-0.2.3/abstractmemory/storage/__init__.py +0 -16
  68. abstractmemory-0.2.3/abstractmemory/storage/dual_manager.py +0 -269
  69. abstractmemory-0.2.3/abstractmemory/storage/lancedb_storage.py +0 -544
  70. abstractmemory-0.2.3/abstractmemory/storage/markdown_storage.py +0 -447
  71. abstractmemory-0.2.3/pyproject.toml +0 -54
  72. abstractmemory-0.2.3/setup.cfg +0 -4
@@ -0,0 +1,73 @@
1
+ name: Bug report
2
+ description: Report a reproducible AbstractMemory bug
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for reporting a bug. Include enough detail to reproduce the store, query, embedding, or packaging behavior.
10
+ - type: input
11
+ id: version
12
+ attributes:
13
+ label: AbstractMemory version
14
+ description: Output of `python -c "from importlib.metadata import version; print(version('AbstractMemory'))"`
15
+ placeholder: "0.2.5"
16
+ validations:
17
+ required: true
18
+ - type: dropdown
19
+ id: area
20
+ attributes:
21
+ label: Store or area
22
+ options:
23
+ - in-memory store
24
+ - sqlite store
25
+ - lancedb store
26
+ - embeddings
27
+ - query/model contract
28
+ - packaging/install
29
+ - documentation
30
+ - other
31
+ validations:
32
+ required: true
33
+ - type: textarea
34
+ id: observed
35
+ attributes:
36
+ label: What happened?
37
+ description: Describe the incorrect behavior, including exact errors or unexpected query results.
38
+ validations:
39
+ required: true
40
+ - type: textarea
41
+ id: expected
42
+ attributes:
43
+ label: What did you expect?
44
+ validations:
45
+ required: true
46
+ - type: textarea
47
+ id: reproduce
48
+ attributes:
49
+ label: Reproduction steps
50
+ description: Include commands, Python snippets, store backend, query inputs, and installed extras.
51
+ placeholder: |
52
+ 1. Create a SQLiteTripleStore with ...
53
+ 2. Add assertions ...
54
+ 3. Query with ...
55
+ validations:
56
+ required: true
57
+ - type: textarea
58
+ id: environment
59
+ attributes:
60
+ label: Environment
61
+ description: OS, Python version, installed extras, backend, and relevant package versions.
62
+ placeholder: |
63
+ macOS 15, Python 3.12
64
+ pip install "AbstractMemory[all-apple]"
65
+ validations:
66
+ required: true
67
+ - type: textarea
68
+ id: artifacts
69
+ attributes:
70
+ label: Logs or artifacts
71
+ description: Attach logs, store schema details, query payloads, or related files.
72
+ validations:
73
+ required: false
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python-version: ["3.10", "3.11", "3.12"]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ cache: pip
28
+ - name: Install
29
+ run: |
30
+ python -m pip install -U pip
31
+ python -m pip install -e ".[test]"
32
+ - name: Pytest
33
+ run: python -m pytest -q -m "not integration"
34
+
35
+ build:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+ - uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "3.12"
42
+ cache: pip
43
+ - name: Build
44
+ run: |
45
+ python -m pip install -U pip
46
+ python -m pip install build twine
47
+ python -m build
48
+ python -m twine check dist/*
@@ -0,0 +1,179 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ version:
10
+ description: "Release version, with or without the leading v (example: 0.2.6)"
11
+ required: true
12
+ type: string
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ concurrency:
18
+ group: release-${{ github.ref }}
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ test:
23
+ name: Test Python ${{ matrix.python-version }}
24
+ runs-on: ubuntu-latest
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ python-version: ["3.10", "3.11", "3.12"]
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ cache: pip
35
+ - name: Install
36
+ run: |
37
+ python -m pip install -U pip
38
+ python -m pip install -e ".[test]"
39
+ - name: Pytest
40
+ run: python -m pytest -q -m "not integration"
41
+
42
+ build:
43
+ name: Build distributions
44
+ runs-on: ubuntu-latest
45
+ needs: [test]
46
+ outputs:
47
+ version: ${{ steps.release-meta.outputs.version }}
48
+ tag: ${{ steps.release-meta.outputs.tag }}
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.12"
54
+ cache: pip
55
+ - name: Install build tools
56
+ run: |
57
+ python -m pip install -U pip
58
+ python -m pip install build twine
59
+ - name: Validate tag, version, and changelog
60
+ id: release-meta
61
+ env:
62
+ RELEASE_INPUT_VERSION: ${{ github.event.inputs.version || '' }}
63
+ run: |
64
+ python - <<'PY'
65
+ import os
66
+ import re
67
+ import tomllib
68
+ from pathlib import Path
69
+
70
+ version_input = os.environ.get("RELEASE_INPUT_VERSION", "").strip()
71
+ ref_name = os.environ["GITHUB_REF_NAME"].strip()
72
+ raw_version = version_input or ref_name
73
+ version = raw_version[1:] if raw_version.startswith("v") else raw_version
74
+ if not re.fullmatch(r"\d+\.\d+\.\d+(?:[a-zA-Z0-9.-]+)?", version):
75
+ raise SystemExit(f"Invalid release version: {raw_version!r}")
76
+ tag = f"v{version}"
77
+
78
+ project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]
79
+ package_version = project["version"]
80
+ if version != package_version:
81
+ raise SystemExit(
82
+ f"Tag version {version!r} does not match package version {package_version!r}"
83
+ )
84
+
85
+ changelog = Path("CHANGELOG.md").read_text(encoding="utf-8")
86
+ header = re.search(rf"^## \[?{re.escape(version)}\]? - .+$", changelog, re.MULTILINE)
87
+ if not header:
88
+ raise SystemExit(f"CHANGELOG.md has no entry for {version}")
89
+
90
+ rest = changelog[header.end():]
91
+ next_header = re.search(r"^## ", rest, re.MULTILINE)
92
+ notes = rest[: next_header.start() if next_header else len(rest)].strip()
93
+ if not notes:
94
+ raise SystemExit(f"CHANGELOG.md entry for {version} is empty")
95
+
96
+ Path("release-notes.md").write_text(notes + "\n", encoding="utf-8")
97
+ github_output = Path(os.environ["GITHUB_OUTPUT"])
98
+ with github_output.open("a", encoding="utf-8") as fh:
99
+ print(f"version={version}", file=fh)
100
+ print(f"tag={tag}", file=fh)
101
+ PY
102
+ - name: Build
103
+ run: python -m build
104
+ - name: Check distributions
105
+ run: python -m twine check dist/*
106
+ - uses: actions/upload-artifact@v4
107
+ with:
108
+ name: release-dist
109
+ path: dist/*
110
+ - uses: actions/upload-artifact@v4
111
+ with:
112
+ name: release-notes
113
+ path: release-notes.md
114
+
115
+ ensure-tag:
116
+ name: Ensure release tag
117
+ runs-on: ubuntu-latest
118
+ needs: build
119
+ permissions:
120
+ contents: write
121
+ steps:
122
+ - uses: actions/checkout@v4
123
+ with:
124
+ fetch-depth: 0
125
+ - name: Create annotated tag for manual releases
126
+ if: github.event_name == 'workflow_dispatch'
127
+ run: |
128
+ tag="${{ needs.build.outputs.tag }}"
129
+ if git ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1; then
130
+ echo "Tag ${tag} already exists on origin."
131
+ exit 1
132
+ fi
133
+ git config user.name "github-actions[bot]"
134
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
135
+ git tag -a "${tag}" -m "AbstractMemory ${tag}"
136
+ git push origin "${tag}"
137
+ - name: Tag already supplied by push trigger
138
+ if: github.event_name != 'workflow_dispatch'
139
+ run: echo "Using existing tag ${{ needs.build.outputs.tag }}"
140
+
141
+ publish-pypi:
142
+ name: Publish to PyPI
143
+ runs-on: ubuntu-latest
144
+ needs: [build, ensure-tag]
145
+ environment:
146
+ name: pypi
147
+ url: https://pypi.org/project/abstractmemory/
148
+ permissions:
149
+ contents: read
150
+ id-token: write
151
+ steps:
152
+ - uses: actions/download-artifact@v4
153
+ with:
154
+ name: release-dist
155
+ path: dist
156
+ - uses: pypa/gh-action-pypi-publish@release/v1
157
+
158
+ github-release:
159
+ name: Create GitHub Release
160
+ runs-on: ubuntu-latest
161
+ needs: [build, ensure-tag, publish-pypi]
162
+ permissions:
163
+ contents: write
164
+ steps:
165
+ - uses: actions/download-artifact@v4
166
+ with:
167
+ name: release-dist
168
+ path: dist
169
+ - uses: actions/download-artifact@v4
170
+ with:
171
+ name: release-notes
172
+ path: .
173
+ - uses: softprops/action-gh-release@v2
174
+ with:
175
+ tag_name: ${{ needs.build.outputs.tag }}
176
+ name: AbstractMemory ${{ needs.build.outputs.tag }}
177
+ body_path: release-notes.md
178
+ files: dist/*
179
+ fail_on_unmatched_files: true
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .pytest_cache/
4
+ .DS_Store
5
+ .venv/
6
+ dist/
7
+ build/
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+ untracked/
@@ -0,0 +1,15 @@
1
+ # Acknowledgments
2
+
3
+ AbstractMemory builds on a number of great open-source tools and ideas.
4
+
5
+ ## Libraries
6
+
7
+ - **LanceDB** (`lancedb`) — optional persistent/vector backend used by `LanceDBTripleStore` (see `.[lancedb]` extra in `pyproject.toml`).
8
+ - **pytest** (`pytest`) — development and contract tests (see `.[dev]` extra in `pyproject.toml`).
9
+ - **Hatchling** (`hatchling`) — packaging/build backend (see `[build-system]` in `pyproject.toml`).
10
+
11
+ ## Ecosystem
12
+
13
+ - The broader **AbstractFramework** project for shaping the boundaries between runtime provenance, model execution, and memory storage.
14
+
15
+ If we missed a credit, please open a small PR to update this file.
@@ -0,0 +1,72 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (pre-1.0).
7
+
8
+ ## Unreleased
9
+
10
+ *No unreleased changes.*
11
+
12
+ ## [0.2.6] - 2026-05-09
13
+
14
+ ### Changed
15
+ - The `test` optional dependency now installs `lancedb` so release CI exercises
16
+ the persisted LanceDB store contract instead of skipping it.
17
+
18
+ ### Fixed
19
+ - `LanceDBTripleStore` now recognizes the current LanceDB `list_tables()`
20
+ response shape, restoring persisted table reopen/query behavior.
21
+
22
+ ## [0.2.5] - 2026-05-08
23
+
24
+ ### Added
25
+ - Added GitHub Actions CI for Python 3.10 through 3.12 with pytest and package
26
+ build checks.
27
+ - Added a trusted-publishing release workflow for tagged or manually dispatched
28
+ releases, including version/changelog validation, distribution artifacts,
29
+ PyPI publication, and GitHub Release creation.
30
+ - Added an AbstractMemory GitHub bug report template.
31
+ - Added a `test` optional dependency extra for CI and release validation.
32
+
33
+ ## 0.2.4 - 2026-05-08
34
+
35
+ ### Added
36
+ - Added install-profile compatibility extras:
37
+ `AbstractMemory[apple]`, `AbstractMemory[gpu]`,
38
+ `AbstractMemory[all-apple]`, and `AbstractMemory[all-gpu]`.
39
+ - Planned backlog overview and standalone items for semantics-aligned memory records, SQLite compatibility/store capabilities, bounded graph traversal, recall traces, lineage, deterministic anchors, and read-only observer contracts.
40
+
41
+ ### Changed
42
+ - `AbstractMemory[all-apple]` and `AbstractMemory[all-gpu]` now install the
43
+ LanceDB-backed vector-capable store dependency, matching the existing
44
+ `lancedb`/`all` profile behavior.
45
+ - `AbstractMemory[apple]` and `AbstractMemory[gpu]` remain no-op aliases
46
+ because Memory itself has no hardware-specific runtime engine.
47
+ - Docs: clarify AbstractFramework ecosystem positioning, update PyPI install wording, and add a gateway-managed embeddings example.
48
+ - Docs: align README/API/store/FAQ/agent context with the exported `SQLiteTripleStore` and clarify semantic-query support by backend.
49
+ - Docs: document current release-channel drift between this source tree, PyPI, and remote tags.
50
+
51
+ ### Fixed
52
+ - Test configuration now declares the local `basic` marker.
53
+ - `LanceDBTripleStore` avoids the deprecated LanceDB `table_names()` API when `list_tables()` is available.
54
+
55
+ ## 0.0.2 - 2026-02-04
56
+
57
+ ### Added
58
+ - User-facing documentation set with getting started, API, stores, architecture diagram, and FAQ.
59
+ - Agent-oriented context files: `llms.txt` and `llms-full.txt`.
60
+
61
+ ### Changed
62
+ - `LanceDBTripleStore` non-semantic queries now apply `order` by `observed_at` before applying `limit` (deterministic behavior aligned with `InMemoryTripleStore`).
63
+
64
+ ### Fixed
65
+ - Ordering/limit interaction for non-semantic queries in `LanceDBTripleStore` (covered by new tests).
66
+
67
+ ## 0.0.1 - 2026-01-12
68
+
69
+ ### Added
70
+ - `TripleAssertion` and `TripleQuery` data models.
71
+ - `InMemoryTripleStore` (dependency-free) and `LanceDBTripleStore` (optional).
72
+ - `AbstractGatewayTextEmbedder` adapter for gateway-managed embeddings.
@@ -0,0 +1,61 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in improving AbstractMemory.
4
+
5
+ This repository uses a `src/` layout and keeps the public API intentionally small.
6
+
7
+ AbstractMemory is part of the **AbstractFramework** ecosystem (see [`README.md`](README.md) and [`docs/architecture.md`](docs/architecture.md)).
8
+
9
+ ## Development setup
10
+
11
+ Requirements:
12
+ - Python 3.10+ (see `pyproject.toml`)
13
+
14
+ Install (editable):
15
+
16
+ ```bash
17
+ python -m pip install -e ".[dev]"
18
+ ```
19
+
20
+ Optional (LanceDB backend + tests):
21
+
22
+ ```bash
23
+ python -m pip install -e ".[lancedb]"
24
+ ```
25
+
26
+ More details: [`docs/development.md`](docs/development.md).
27
+
28
+ ## Run tests
29
+
30
+ ```bash
31
+ python -m pytest -q
32
+ ```
33
+
34
+ ## What to contribute
35
+
36
+ Good first contributions:
37
+ - Improve docs (keep statements evidence-based and link to code/tests).
38
+ - Add tests for edge cases and contracts.
39
+ - Make error messages more actionable.
40
+ - Add small, well-scoped features that keep the v0 API minimal.
41
+
42
+ ## Contribution guidelines
43
+
44
+ - Keep changes focused; avoid drive-by refactors.
45
+ - Add tests for behavior changes (especially store/query semantics).
46
+ - Update docs when you change public behavior:
47
+ - `README.md` and `docs/getting-started.md` for user-facing usage
48
+ - `docs/api.md` for public API contracts
49
+ - `docs/architecture.md` when boundaries/diagrams change
50
+ - `CHANGELOG.md` for notable changes
51
+ - If you add a new dependency, keep it optional unless strictly required.
52
+
53
+ ## PR checklist
54
+
55
+ - `python -m pytest -q` passes locally
56
+ - Docs stay evidence-based (link to code/tests for contracts)
57
+ - Public API changes are reflected in `src/abstractmemory/__init__.py` and `docs/api.md`
58
+
59
+ ## Security issues
60
+
61
+ Please do not open public issues for vulnerabilities. See [`SECURITY.md`](SECURITY.md).
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Laurent-Philippe Albou
3
+ Copyright (c) 2024 Laurent-Philippe Albou
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,6 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
-
24
-
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: AbstractMemory
3
+ Version: 0.2.6
4
+ Summary: AbstractMemory: temporal, provenance-aware semantic memory primitives for AbstractFramework.
5
+ Project-URL: AbstractFramework (monorepo), https://github.com/lpalbou/abstractframework
6
+ Author: Laurent-Philippe Albou
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Keywords: agents,knowledge-graph,memory,temporal,triples
10
+ Classifier: Development Status :: 1 - Planning
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.10
20
+ Provides-Extra: all
21
+ Requires-Dist: lancedb; extra == 'all'
22
+ Provides-Extra: all-apple
23
+ Requires-Dist: lancedb; extra == 'all-apple'
24
+ Provides-Extra: all-gpu
25
+ Requires-Dist: lancedb; extra == 'all-gpu'
26
+ Provides-Extra: apple
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
29
+ Provides-Extra: gpu
30
+ Provides-Extra: lancedb
31
+ Requires-Dist: lancedb; extra == 'lancedb'
32
+ Provides-Extra: test
33
+ Requires-Dist: lancedb; extra == 'test'
34
+ Requires-Dist: pytest>=7.0.0; extra == 'test'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # AbstractMemory (early / pre-1.0)
38
+
39
+ AbstractMemory is a small Python library for **append-only, temporal, provenance-aware triple assertions** with **deterministic structured queries** and optional **vector/semantic retrieval**.
40
+
41
+ ## Status
42
+ - This package is early (pre-1.0): the API is intentionally small, and details may evolve.
43
+ - Current repo version: `0.2.4` (see [`pyproject.toml`](pyproject.toml)).
44
+ - Implemented today (public API): `TripleAssertion`, `TripleQuery`, `TripleStore`, `InMemoryTripleStore`, `SQLiteTripleStore`, `LanceDBTripleStore`, `TextEmbedder`, `AbstractGatewayTextEmbedder`.
45
+ - Source of truth for exports: [`src/abstractmemory/__init__.py`](src/abstractmemory/__init__.py)
46
+ - Requires Python 3.10+ (see [`pyproject.toml`](pyproject.toml))
47
+ - 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.
48
+
49
+ ## Ecosystem (AbstractFramework)
50
+
51
+ AbstractMemory is part of the **AbstractFramework** ecosystem:
52
+ - It stores and retrieves durable “memory” as append-only triples (this package).
53
+ - It can *optionally* call an **AbstractGateway** embeddings endpoint for semantic retrieval via `AbstractGatewayTextEmbedder` (no direct AbstractCore/AbstractRuntime dependency).
54
+
55
+ Evidence:
56
+ - No direct dependency on AbstractCore/AbstractRuntime: [`pyproject.toml`](pyproject.toml)
57
+ - Gateway adapter implementation: [`src/abstractmemory/embeddings.py`](src/abstractmemory/embeddings.py)
58
+
59
+ ```mermaid
60
+ flowchart LR
61
+ APP["Your app or agent"] --> AM["AbstractMemory"]
62
+ AM --> IM["InMemoryTripleStore"]
63
+ AM --> SQL["SQLiteTripleStore"]
64
+ AM --> LDB["LanceDBTripleStore"]
65
+ SQL --> SQLITE[("SQLite file")]
66
+ LDB --> DISK[("LanceDB on disk")]
67
+
68
+ AM -- "optional embeddings" --> GW["AbstractGateway"]
69
+ GW --> AR["AbstractRuntime"]
70
+ GW --> AC["AbstractCore"]
71
+ ```
72
+
73
+ Related projects:
74
+ - AbstractFramework: `https://github.com/lpalbou/AbstractFramework`
75
+ - AbstractCore: `https://github.com/lpalbou/abstractcore`
76
+ - AbstractRuntime: `https://github.com/lpalbou/abstractruntime`
77
+
78
+ ## Install
79
+
80
+ From source (recommended inside the AbstractFramework monorepo):
81
+
82
+ ```bash
83
+ python -m pip install -e .
84
+ ```
85
+
86
+ Optional persistent backend + vector search:
87
+
88
+ ```bash
89
+ python -m pip install -e ".[lancedb]"
90
+ ```
91
+
92
+ PyPI (packaged release):
93
+
94
+ ```bash
95
+ python -m pip install AbstractMemory
96
+ python -m pip install "AbstractMemory[lancedb]"
97
+ ```
98
+
99
+ Framework hardware profile aliases are also available:
100
+ `AbstractMemory[apple]` and `AbstractMemory[gpu]` are no-op compatibility
101
+ extras; `AbstractMemory[all-apple]` and `AbstractMemory[all-gpu]` install the
102
+ LanceDB backend for durable vector-capable recall.
103
+
104
+ Notes:
105
+ - The distribution name is `AbstractMemory` (pip is case-insensitive). The import name is `abstractmemory`.
106
+ - PyPI releases may not match this repository checkout exactly; see the release-channel note above.
107
+
108
+ ## Quick example
109
+
110
+ ```python
111
+ from abstractmemory import InMemoryTripleStore, TripleAssertion, TripleQuery
112
+
113
+ store = InMemoryTripleStore()
114
+ store.add(
115
+ [
116
+ TripleAssertion(
117
+ subject="Scrooge",
118
+ predicate="related_to",
119
+ object="Christmas",
120
+ scope="session",
121
+ owner_id="sess-1",
122
+ provenance={"span_id": "span_123"},
123
+ )
124
+ ]
125
+ )
126
+
127
+ hits = store.query(TripleQuery(subject="scrooge", scope="session", owner_id="sess-1"))
128
+ assert hits[0].object == "christmas" # terms are canonicalized (trim + lowercase)
129
+ ```
130
+
131
+ ## Documentation
132
+
133
+ - Getting started: [`docs/getting-started.md`](docs/getting-started.md)
134
+ - FAQ: [`docs/faq.md`](docs/faq.md)
135
+ - Architecture (with diagrams): [`docs/architecture.md`](docs/architecture.md)
136
+ - Stores/backends: [`docs/stores.md`](docs/stores.md)
137
+ - API reference: [`docs/api.md`](docs/api.md)
138
+ - Development: [`docs/development.md`](docs/development.md)
139
+
140
+ ## Project
141
+
142
+ - Changelog: [`CHANGELOG.md`](CHANGELOG.md)
143
+ - Contributing: [`CONTRIBUTING.md`](CONTRIBUTING.md)
144
+ - Security: [`SECURITY.md`](SECURITY.md)
145
+ - License: [`LICENSE`](LICENSE)
146
+ - Acknowledgments: [`ACKNOWLEDGMENTS.md`](ACKNOWLEDGMENTS.md)
147
+
148
+ ## Design principles (v0)
149
+
150
+ - **Triples-first** representation with temporal fields (`observed_at`, `valid_from`, `valid_until`).
151
+ - Implemented in `TripleAssertion`: [`src/abstractmemory/models.py`](src/abstractmemory/models.py)
152
+ - **Append-only**: represent updates by adding a new assertion with fresh provenance.
153
+ - Implemented by all stores: [`src/abstractmemory/in_memory_store.py`](src/abstractmemory/in_memory_store.py), [`src/abstractmemory/sqlite_store.py`](src/abstractmemory/sqlite_store.py), [`src/abstractmemory/lancedb_store.py`](src/abstractmemory/lancedb_store.py)
154
+ - **No direct AbstractCore dependency**: embeddings can be obtained via an AbstractGateway HTTP API.
155
+ - Implemented by `AbstractGatewayTextEmbedder`: [`src/abstractmemory/embeddings.py`](src/abstractmemory/embeddings.py)