luminary-memory 0.1.0__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 (71) hide show
  1. luminary_memory-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  2. luminary_memory-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  3. luminary_memory-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +21 -0
  4. luminary_memory-0.1.0/.github/workflows/ci.yml +25 -0
  5. luminary_memory-0.1.0/.gitignore +27 -0
  6. luminary_memory-0.1.0/CHANGELOG.md +16 -0
  7. luminary_memory-0.1.0/CODE_OF_CONDUCT.md +31 -0
  8. luminary_memory-0.1.0/CONTRIBUTING.md +45 -0
  9. luminary_memory-0.1.0/LICENSE +202 -0
  10. luminary_memory-0.1.0/PKG-INFO +166 -0
  11. luminary_memory-0.1.0/PLAN.md +876 -0
  12. luminary_memory-0.1.0/README.md +135 -0
  13. luminary_memory-0.1.0/ROADMAP.md +90 -0
  14. luminary_memory-0.1.0/SECURITY.md +24 -0
  15. luminary_memory-0.1.0/docs/api.md +70 -0
  16. luminary_memory-0.1.0/docs/architecture.md +46 -0
  17. luminary_memory-0.1.0/docs/backends.md +33 -0
  18. luminary_memory-0.1.0/docs/cli.md +64 -0
  19. luminary_memory-0.1.0/docs/hermes-integration.md +37 -0
  20. luminary_memory-0.1.0/docs/index.md +28 -0
  21. luminary_memory-0.1.0/docs/lifecycle.md +31 -0
  22. luminary_memory-0.1.0/docs/quickstart.md +57 -0
  23. luminary_memory-0.1.0/docs/recall.md +54 -0
  24. luminary_memory-0.1.0/hermes/SKILL.md +85 -0
  25. luminary_memory-0.1.0/pyproject.toml +51 -0
  26. luminary_memory-0.1.0/src/luminary_memory/__init__.py +4 -0
  27. luminary_memory-0.1.0/src/luminary_memory/api.py +222 -0
  28. luminary_memory-0.1.0/src/luminary_memory/backends/__init__.py +28 -0
  29. luminary_memory-0.1.0/src/luminary_memory/backends/base.py +24 -0
  30. luminary_memory-0.1.0/src/luminary_memory/backends/pgvector.py +220 -0
  31. luminary_memory-0.1.0/src/luminary_memory/backends/sqlite.py +134 -0
  32. luminary_memory-0.1.0/src/luminary_memory/budget.py +36 -0
  33. luminary_memory-0.1.0/src/luminary_memory/cli.py +146 -0
  34. luminary_memory-0.1.0/src/luminary_memory/config.py +86 -0
  35. luminary_memory-0.1.0/src/luminary_memory/embeddings/__init__.py +0 -0
  36. luminary_memory-0.1.0/src/luminary_memory/embeddings/fastembed.py +35 -0
  37. luminary_memory-0.1.0/src/luminary_memory/ingest/__init__.py +0 -0
  38. luminary_memory-0.1.0/src/luminary_memory/ingest/llm.py +21 -0
  39. luminary_memory-0.1.0/src/luminary_memory/ingest/whitelist.py +18 -0
  40. luminary_memory-0.1.0/src/luminary_memory/lifecycle/__init__.py +0 -0
  41. luminary_memory-0.1.0/src/luminary_memory/lifecycle/cleanup.py +29 -0
  42. luminary_memory-0.1.0/src/luminary_memory/lifecycle/consolidate.py +47 -0
  43. luminary_memory-0.1.0/src/luminary_memory/lifecycle/prune.py +28 -0
  44. luminary_memory-0.1.0/src/luminary_memory/lifecycle/runner.py +26 -0
  45. luminary_memory-0.1.0/src/luminary_memory/recall/__init__.py +0 -0
  46. luminary_memory-0.1.0/src/luminary_memory/recall/dedup.py +30 -0
  47. luminary_memory-0.1.0/src/luminary_memory/recall/fusion.py +12 -0
  48. luminary_memory-0.1.0/src/luminary_memory/recall/graph.py +145 -0
  49. luminary_memory-0.1.0/src/luminary_memory/recall/keyword.py +15 -0
  50. luminary_memory-0.1.0/src/luminary_memory/recall/semantic.py +21 -0
  51. luminary_memory-0.1.0/src/luminary_memory/recall/temporal.py +43 -0
  52. luminary_memory-0.1.0/src/luminary_memory/schema.py +54 -0
  53. luminary_memory-0.1.0/src/luminary_memory/types.py +36 -0
  54. luminary_memory-0.1.0/tests/__init__.py +0 -0
  55. luminary_memory-0.1.0/tests/test_api.py +68 -0
  56. luminary_memory-0.1.0/tests/test_api_extended.py +83 -0
  57. luminary_memory-0.1.0/tests/test_backend_pgvector.py +133 -0
  58. luminary_memory-0.1.0/tests/test_backend_sqlite.py +20 -0
  59. luminary_memory-0.1.0/tests/test_budget.py +43 -0
  60. luminary_memory-0.1.0/tests/test_cli.py +71 -0
  61. luminary_memory-0.1.0/tests/test_dedup_jaccard.py +46 -0
  62. luminary_memory-0.1.0/tests/test_embeddings.py +46 -0
  63. luminary_memory-0.1.0/tests/test_fusion_rrf.py +49 -0
  64. luminary_memory-0.1.0/tests/test_ingest_whitelist.py +31 -0
  65. luminary_memory-0.1.0/tests/test_lifecycle.py +92 -0
  66. luminary_memory-0.1.0/tests/test_recall_graph.py +50 -0
  67. luminary_memory-0.1.0/tests/test_recall_keyword.py +40 -0
  68. luminary_memory-0.1.0/tests/test_recall_orchestrator.py +61 -0
  69. luminary_memory-0.1.0/tests/test_recall_semantic.py +42 -0
  70. luminary_memory-0.1.0/tests/test_recall_temporal.py +50 -0
  71. luminary_memory-0.1.0/tests/test_schema.py +25 -0
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a problem
4
+ title: "[bug] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ **Describe the bug**
10
+ A clear description of what happened.
11
+
12
+ **To reproduce**
13
+ Steps to reproduce the behavior:
14
+
15
+ 1. ...
16
+ 2. ...
17
+ 3. ...
18
+
19
+ **Expected behavior**
20
+ What you expected to happen.
21
+
22
+ **Environment**
23
+ - OS:
24
+ - Python version:
25
+ - luminary-memory version:
26
+ - backend (sqlite/pgvector):
27
+
28
+ **Additional context**
29
+ Any other context, logs, or error messages.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea
4
+ title: "[feature] "
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ **Is your feature request related to a problem?**
10
+ A clear description of the problem.
11
+
12
+ **Describe the solution you'd like**
13
+ A clear description of what you want to happen.
14
+
15
+ **Describe alternatives you've considered**
16
+ Any alternative approaches.
17
+
18
+ **Additional context**
19
+ Any other context.
@@ -0,0 +1,21 @@
1
+ ## Summary
2
+
3
+ <!-- What does this PR do? -->
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix
8
+ - [ ] New feature
9
+ - [ ] Documentation
10
+ - [ ] Refactor
11
+
12
+ ## Testing
13
+
14
+ - [ ] `python -m pytest` passes
15
+ - [ ] `python -m ruff check src tests` passes
16
+
17
+ ## Checklist
18
+
19
+ - [ ] Tests added/updated
20
+ - [ ] Docs updated (if applicable)
21
+ - [ ] Commit messages follow convention
@@ -0,0 +1,25 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: ["3.11", "3.12"]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: ${{ matrix.python-version }}
19
+ cache: pip
20
+ - name: Install
21
+ run: pip install -e ".[dev]"
22
+ - name: Lint
23
+ run: ruff check src tests
24
+ - name: Test
25
+ run: pytest -q
@@ -0,0 +1,27 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ *.egg
6
+ .venv/
7
+ venv/
8
+ env/
9
+ dist/
10
+ build/
11
+ .pytest_cache/
12
+ .ruff_cache/
13
+ .mypy_cache/
14
+ .coverage
15
+ .coverage.*
16
+ htmlcov/
17
+ coverage.xml
18
+ *.db
19
+ *.sqlite
20
+ *.sqlite3
21
+ luminary_memory.db
22
+ .DS_Store
23
+ .idea/
24
+ .vscode/
25
+
26
+ # Command Code CLI local config
27
+ .commandcode/
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file. The format follows [Keep a Changelog](https://keepachangelog.com/), and the project adheres to [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [0.1.0] - 2026-08-17
6
+
7
+ ### Added
8
+
9
+ - SQLite backend with FTS5 keyword search and in-process vector search.
10
+ - Optional pgvector backend (HNSW-ready).
11
+ - Four-strategy recall: semantic, keyword, temporal, graph.
12
+ - Reciprocal Rank Fusion (RRF) + Jaccard dedup + token budget.
13
+ - Ingest pipeline with whitelist filter and optional LLM enrichment.
14
+ - Lifecycle: TTL cleanup, near-duplicate consolidation, low-value pruning.
15
+ - Python API (`MemoryClient`) and CLI (`luminary-memory`).
16
+ - Environment-variable configuration (`LUMINARY_*`).
@@ -0,0 +1,31 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment include:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes
17
+
18
+ Examples of unacceptable behavior include:
19
+
20
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
21
+ - Trolling, insulting or derogatory comments, and personal or political attacks
22
+ - Public or private harassment
23
+ - Publishing others' private information without their explicit permission
24
+
25
+ ## Enforcement
26
+
27
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.
28
+
29
+ ## Attribution
30
+
31
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,45 @@
1
+ # Contributing
2
+
3
+ Thanks for helping build luminary-memory.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ git clone <repo> && cd luminary-memory
9
+ pip install -e ".[dev]"
10
+ ```
11
+
12
+ ## Development workflow
13
+
14
+ 1. Create a branch: `git checkout -b feat/your-change`.
15
+ 2. Write a failing test first (`tests/`).
16
+ 3. Implement the minimal change.
17
+ 4. Run the checks:
18
+
19
+ ```bash
20
+ python -m pytest
21
+ python -m ruff check src tests
22
+ ```
23
+
24
+ 5. Commit with a conventional message.
25
+
26
+ ## Commit conventions
27
+
28
+ - `feat:` — new feature
29
+ - `fix:` — bug fix
30
+ - `docs:` — documentation only
31
+ - `improve:` — refactor or enhancement without behavior change
32
+ - `chore:` — build/tooling
33
+
34
+ ## Coding standards
35
+
36
+ - Python 3.11+, type-hinted.
37
+ - `ruff` clean, `pytest` green.
38
+ - TDD where feasible — test first, then implement.
39
+ - Keep the public API (`MemoryClient`) stable; add rather than break.
40
+
41
+ ## Pull requests
42
+
43
+ - One logical change per PR.
44
+ - Link the issue if applicable.
45
+ - CI must pass before merge.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.5
2
+ Name: luminary-memory
3
+ Version: 0.1.0
4
+ Summary: A lightweight, self-hosted memory layer for AI agents
5
+ Project-URL: Homepage, https://github.com/alertxsto/luminary-memory
6
+ Project-URL: Repository, https://github.com/alertxsto/luminary-memory
7
+ Project-URL: Documentation, https://github.com/alertxsto/luminary-memory#readme
8
+ Author: Dwiky Candra
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: fastembed>=0.4.0
21
+ Requires-Dist: numpy>=1.26
22
+ Requires-Dist: pgvector>=0.2.5
23
+ Requires-Dist: psycopg[binary]>=3.1
24
+ Requires-Dist: rich>=13.0
25
+ Requires-Dist: typer>=0.12
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.4; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # luminary-memory
33
+
34
+ > A lightweight, self-hosted memory layer for AI agents.
35
+
36
+ **luminary-memory** gives AI agents durable, cross-session memory without shipping data to a third party. It runs entirely on your infrastructure, embeds and retrieves memories locally, and exposes a clean Python API and CLI that drop into any agent workflow. No external services required — SQLite out of the box, optional pgvector when you need scale.
37
+
38
+ ---
39
+
40
+ ## Why luminary-memory
41
+
42
+ Agents are only as good as what they remember. Stateless agents re-learn the same context every session; luminary-memory closes that gap with a local memory store that persists between runs, retrieves the right context on demand, and keeps itself tidy over time.
43
+
44
+ ### Value proposition
45
+
46
+ - **Self-hosted and private** — all data stays on your machine. No cloud dependency, no API keys to leak, no per-token memory cost.
47
+ - **Four retrieval strategies in one recall** — semantic (embeddings), keyword (FTS5), temporal (recency/access), and graph (entity co-occurrence) run in parallel and fuse into a single ranked result.
48
+ - **Zero hard dependencies** — the default backend is SQLite + FTS5 (standard library). Embeddings run locally on CPU via ONNX. You can be ingesting and recalling memories in minutes.
49
+ - **Budget-aware by design** — results are deduplicated and truncated to a configurable token budget, so memory injection never blows up your agent's context window.
50
+ - **Self-maintaining** — a built-in lifecycle handles TTL expiry, near-duplicate consolidation, and low-value pruning, so the store stays lean without manual cleanup.
51
+ - **Scales when you do** — a pluggable backend lets you move from SQLite to pgvector without changing your code.
52
+
53
+ ---
54
+
55
+ ## Quickstart
56
+
57
+ ### Install
58
+
59
+ ```bash
60
+ pip install luminary-memory # or, for development:
61
+ git clone <repo> && cd luminary-memory && pip install -e ".[dev]"
62
+ ```
63
+
64
+ ### Python API
65
+
66
+ ```python
67
+ from luminary_memory import MemoryClient
68
+
69
+ client = MemoryClient(db_path="memory.db")
70
+
71
+ # store
72
+ mid = client.ingest("The deploy target is the staging cluster", tags=["deploy"])
73
+
74
+ # recall (four strategies, fused)
75
+ result = client.recall("where do we deploy?")
76
+ for memory, score in zip(result.memories, result.scores):
77
+ print(f"{score:.3f} {memory.content}")
78
+
79
+ # maintenance
80
+ client.run_lifecycle() # cleanup + consolidate + prune
81
+
82
+ client.close()
83
+ ```
84
+
85
+ ### CLI
86
+
87
+ ```bash
88
+ luminary-memory add "The deploy target is the staging cluster" --tags deploy
89
+ luminary-memory recall "where do we deploy?" --limit 5 --json
90
+ luminary-memory search "postgresql"
91
+ luminary-memory list
92
+ luminary-memory lifecycle
93
+ luminary-memory stats
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Architecture
99
+
100
+ ```
101
+ ┌──────────────────────────────────────────┐
102
+ │ ingest() │
103
+ │ whitelist → (LLM enrich) → embed → store │
104
+ └──────────────┬───────────────────────────┘
105
+ ▼
106
+ ┌──────────────────────────────────────────┐
107
+ │ backend (pluggable) │
108
+ │ SQLite + FTS5 | pgvector │
109
+ └──────────────┬───────────────────────────┘
110
+ ▼
111
+ ┌──────────────────────────────────────────┐
112
+ │ recall() │
113
+ │ semantic + keyword + temporal + graph │
114
+ │ → RRF fusion → dedup → budget │
115
+ └──────────────┬───────────────────────────┘
116
+ ▼
117
+ ┌──────────────────────────────────────────┐
118
+ │ lifecycle() │
119
+ │ TTL cleanup · consolidate · prune │
120
+ └──────────────────────────────────────────┘
121
+ ```
122
+
123
+ ## Configuration
124
+
125
+ Every setting can be set via a `LUMINARY_*` environment variable or through `Settings` directly.
126
+
127
+ | Setting | Env var | Default |
128
+ |---------|---------|---------|
129
+ | `backend` | `LUMINARY_BACKEND` | `sqlite` |
130
+ | `db_path` | `LUMINARY_DB_PATH` | `luminary_memory.db` |
131
+ | `pg_dsn` | `LUMINARY_PG_DSN` | `postgresql://localhost/luminary_memory` |
132
+ | `embedding_model` | `LUMINARY_EMBEDDING_MODEL` | `BAAI/bge-small-en-v1.5` |
133
+ | `embedding_dim` | `LUMINARY_EMBEDDING_DIM` | `384` |
134
+ | `rrf_k` | `LUMINARY_RRF_K` | `60` |
135
+ | `dedup_jaccard_threshold` | `LUMINARY_DEDUP_JACCARD_THRESHOLD` | `0.85` |
136
+ | `token_budget` | `LUMINARY_TOKEN_BUDGET` | `4096` |
137
+
138
+ ---
139
+
140
+ ## Backends
141
+
142
+ | | SQLite (default) | pgvector |
143
+ |---|---|---|
144
+ | **Dependencies** | stdlib + FTS5 | PostgreSQL + pgvector |
145
+ | **Vector search** | in-process cosine | HNSW index |
146
+ | **Best for** | single-user, edge, <100k memories | scale, concurrent access |
147
+ | **Setup** | zero-config | needs a running Postgres |
148
+
149
+ See [docs/backends.md](docs/backends.md) for a migration guide.
150
+
151
+ ---
152
+
153
+ ## Documentation
154
+
155
+ - [Quickstart](docs/quickstart.md) — install and first use
156
+ - [Architecture](docs/architecture.md) — pipelines and data flow
157
+ - [Python API](docs/api.md) — `MemoryClient` reference
158
+ - [CLI](docs/cli.md) — all subcommands and flags
159
+ - [Recall](docs/recall.md) — how the four strategies + fusion work
160
+ - [Lifecycle](docs/lifecycle.md) — cleanup, consolidation, pruning
161
+ - [Backends](docs/backends.md) — SQLite vs pgvector
162
+ - [Hermes integration](docs/hermes-integration.md) — use with Hermes Agent
163
+
164
+ ## License
165
+
166
+ Apache-2.0 © 2026 Dwiky Candra