memorydrift 3.0.2__tar.gz → 3.0.3__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.
- memorydrift-3.0.3/LICENSE +9 -0
- memorydrift-3.0.3/PKG-INFO +18 -0
- memorydrift-3.0.3/README.md +7 -0
- memorydrift-3.0.3/pyproject.toml +16 -0
- memorydrift-3.0.3/src/memorydrift.egg-info/PKG-INFO +18 -0
- memorydrift-3.0.3/src/memorydrift.egg-info/SOURCES.txt +8 -0
- memorydrift-3.0.3/src/memorylayer/__init__.py +4 -0
- memorydrift-3.0.2/PKG-INFO +0 -148
- memorydrift-3.0.2/README.md +0 -114
- memorydrift-3.0.2/memorydrift.egg-info/PKG-INFO +0 -148
- memorydrift-3.0.2/memorydrift.egg-info/SOURCES.txt +0 -21
- memorydrift-3.0.2/memorydrift.egg-info/requires.txt +0 -17
- memorydrift-3.0.2/memorylayer/__init__.py +0 -59
- memorydrift-3.0.2/memorylayer/collective.py +0 -135
- memorydrift-3.0.2/memorylayer/consolidation.py +0 -101
- memorydrift-3.0.2/memorylayer/decay.py +0 -241
- memorydrift-3.0.2/memorylayer/embedding.py +0 -37
- memorydrift-3.0.2/memorylayer/emotion.py +0 -243
- memorydrift-3.0.2/memorylayer/fidelity.py +0 -166
- memorydrift-3.0.2/memorylayer/memory_store.py +0 -280
- memorydrift-3.0.2/memorylayer/prospective.py +0 -96
- memorydrift-3.0.2/memorylayer/reconsolidation.py +0 -132
- memorydrift-3.0.2/memorylayer/sleep.py +0 -110
- memorydrift-3.0.2/pyproject.toml +0 -49
- memorydrift-3.0.2/tests/test_decay.py +0 -223
- memorydrift-3.0.2/tests/test_enhancements.py +0 -304
- memorydrift-3.0.2/tests/test_memory.py +0 -495
- {memorydrift-3.0.2 → memorydrift-3.0.3}/setup.cfg +0 -0
- {memorydrift-3.0.2 → memorydrift-3.0.3/src}/memorydrift.egg-info/dependency_links.txt +0 -0
- {memorydrift-3.0.2 → memorydrift-3.0.3/src}/memorydrift.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright (c) 2026 Mounica Goriparti. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This package is a placeholder and contains no functional software.
|
|
4
|
+
No license, express or implied, is granted under any copyright,
|
|
5
|
+
patent, patent application or other intellectual property right.
|
|
6
|
+
|
|
7
|
+
Patent pending.
|
|
8
|
+
|
|
9
|
+
Licensing enquiries: mounica.goriparti@gmail.com
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: memorydrift
|
|
3
|
+
Version: 3.0.3
|
|
4
|
+
Summary: MemoryLayer is not currently publicly available.
|
|
5
|
+
Author: Mounica Goriparti
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# memorydrift
|
|
13
|
+
|
|
14
|
+
MemoryLayer is not currently publicly available.
|
|
15
|
+
|
|
16
|
+
For commercial licensing enquiries, contact: mounica.goriparti@gmail.com
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2026 Mounica Goriparti. All rights reserved. Patent pending.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "memorydrift"
|
|
7
|
+
version = "3.0.3"
|
|
8
|
+
description = "MemoryLayer is not currently publicly available."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "LicenseRef-Proprietary"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [{ name = "Mounica Goriparti" }]
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
|
|
15
|
+
[tool.setuptools.packages.find]
|
|
16
|
+
where = ["src"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: memorydrift
|
|
3
|
+
Version: 3.0.3
|
|
4
|
+
Summary: MemoryLayer is not currently publicly available.
|
|
5
|
+
Author: Mounica Goriparti
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# memorydrift
|
|
13
|
+
|
|
14
|
+
MemoryLayer is not currently publicly available.
|
|
15
|
+
|
|
16
|
+
For commercial licensing enquiries, contact: mounica.goriparti@gmail.com
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2026 Mounica Goriparti. All rights reserved. Patent pending.
|
memorydrift-3.0.2/PKG-INFO
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: memorydrift
|
|
3
|
-
Version: 3.0.2
|
|
4
|
-
Summary: AI memory that decays, degrades, and drifts the way human memory does
|
|
5
|
-
Author-email: Mounica Goriparti <mounica.goriparti@gmail.com>
|
|
6
|
-
License-Expression: LicenseRef-Proprietary
|
|
7
|
-
Project-URL: Homepage, https://github.com/mounica-goriparti/memorylayer
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/mounica-goriparti/memorylayer/issues
|
|
9
|
-
Keywords: AI memory,cognitive AI,LLM,agent memory,episodic memory,memory decay,NLP
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Intended Audience :: Science/Research
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
-
Requires-Python: >=3.9
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
Provides-Extra: embed
|
|
22
|
-
Requires-Dist: sentence-transformers>=2.2; extra == "embed"
|
|
23
|
-
Provides-Extra: neural
|
|
24
|
-
Requires-Dist: transformers>=4.30; extra == "neural"
|
|
25
|
-
Requires-Dist: torch>=2.0; extra == "neural"
|
|
26
|
-
Provides-Extra: ui
|
|
27
|
-
Requires-Dist: streamlit>=1.30; extra == "ui"
|
|
28
|
-
Requires-Dist: plotly>=5.0; extra == "ui"
|
|
29
|
-
Requires-Dist: pandas>=2.0; extra == "ui"
|
|
30
|
-
Provides-Extra: full
|
|
31
|
-
Requires-Dist: sentence-transformers>=2.2; extra == "full"
|
|
32
|
-
Requires-Dist: transformers>=4.30; extra == "full"
|
|
33
|
-
Requires-Dist: torch>=2.0; extra == "full"
|
|
34
|
-
|
|
35
|
-
# MemoryLayer
|
|
36
|
-
|
|
37
|
-
AI memory that decays, degrades, and drifts the way human memory does.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Install
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pip install memorydrift
|
|
45
|
-
pip install "memorydrift[embed]"
|
|
46
|
-
pip install "memorydrift[full]"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Quickstart
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
from memorylayer import MemoryStore, MemoryLayer
|
|
53
|
-
|
|
54
|
-
store = MemoryStore(auto_embed=True)
|
|
55
|
-
|
|
56
|
-
store.write("I saved the blacksmith's son", emotional_weight=0.9, age_at_encoding=28)
|
|
57
|
-
store.write("The dragon was defeated in the northern tower", emotional_weight=0.7)
|
|
58
|
-
|
|
59
|
-
for r in store.retrieve():
|
|
60
|
-
print(r.display_content) # "I clearly remember: I saved the blacksmith's son"
|
|
61
|
-
print(r.decay.fidelity) # VIVID / CLEAR / FADED / VAGUE / FEELING
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Spreading activation fires automatically — semantically similar memories surface together.
|
|
65
|
-
|
|
66
|
-
## What makes it different
|
|
67
|
-
|
|
68
|
-
Every other AI memory system is a key-value store. MemoryLayer implements the neuroscience:
|
|
69
|
-
|
|
70
|
-
| Human memory property | MemoryLayer |
|
|
71
|
-
|---|---|
|
|
72
|
-
| Emotional memories last longer | `emotional_weight` stretches halflife up to 3× |
|
|
73
|
-
| Details fade before the gist | Fidelity degrades: VIVID → CLEAR → FADED → VAGUE → FEELING |
|
|
74
|
-
| Rehearsal keeps memories strong | `repetition_count` boosts stability (spaced repetition) |
|
|
75
|
-
| Related memories surface together | Spreading activation via semantic embeddings |
|
|
76
|
-
| Weak memories drift on recall | Reconsolidation: content rewrites toward current context |
|
|
77
|
-
| Childhood memories are hazy | Age-at-encoding: childhood amnesia + reminiscence bump (Rubin 1997) |
|
|
78
|
-
| Sleep consolidates the day | `simulate_sleep()` adds replay repetitions, tags CLEAR+ for promotion |
|
|
79
|
-
|
|
80
|
-
## Memory layers
|
|
81
|
-
|
|
82
|
-
| Layer | Halflife | Use for |
|
|
83
|
-
|---|---|---|
|
|
84
|
-
| `WORKING` | ~1 hour | Active conversation context |
|
|
85
|
-
| `EPISODIC` | 1 year | Events and experiences |
|
|
86
|
-
| `SEMANTIC` | 5 years | Facts and knowledge |
|
|
87
|
-
| `PROSPECTIVE` | 3 days | Intentions that fade if unacted on |
|
|
88
|
-
| `IDENTITY` | Forever | Core beliefs and self-concept |
|
|
89
|
-
|
|
90
|
-
## Advanced API
|
|
91
|
-
|
|
92
|
-
```python
|
|
93
|
-
from memorylayer import (
|
|
94
|
-
# Prospective memory — intentions
|
|
95
|
-
write_intention, complete_intention, get_overdue_intentions,
|
|
96
|
-
|
|
97
|
-
# Collective memory — shared events, per-entity emotional weight
|
|
98
|
-
CollectiveMemoryStore,
|
|
99
|
-
|
|
100
|
-
# Sleep consolidation
|
|
101
|
-
simulate_sleep, SleepSession,
|
|
102
|
-
|
|
103
|
-
# Reconsolidation — memory drift on recall
|
|
104
|
-
reconsolidate_sync,
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
# Prospective memory
|
|
108
|
-
store = MemoryStore()
|
|
109
|
-
intention = write_intention(store, "Call the lawyer", due_in_days=3)
|
|
110
|
-
complete_intention(store, intention.id) # converts to episodic on completion
|
|
111
|
-
|
|
112
|
-
# Collective memory
|
|
113
|
-
shared = CollectiveMemoryStore()
|
|
114
|
-
event = shared.write_event(
|
|
115
|
-
"The team won the championship",
|
|
116
|
-
participants={"alice": 0.95, "bob": 0.40}, # alice scored; bob watched
|
|
117
|
-
)
|
|
118
|
-
alice_memories = shared.recall_for("alice") # stronger than bob's
|
|
119
|
-
|
|
120
|
-
# Sleep consolidation
|
|
121
|
-
result = simulate_sleep(store, SleepSession(quality=0.85, duration_hours=7.5))
|
|
122
|
-
print(f"Strengthened: {result.memories_strengthened}")
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Fidelity levels
|
|
126
|
-
|
|
127
|
-
When a memory is retrieved, its content is automatically degraded to match its strength:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
VIVID (> 0.70) "I clearly remember: she smiled at the coffee shop."
|
|
131
|
-
CLEAR (0.45–) "I remember: something about a coffee shop."
|
|
132
|
-
FADED (0.22–) "I vaguely recall: she smiled."
|
|
133
|
-
VAGUE (0.08–) "I have a faint sense that: she smiled…"
|
|
134
|
-
FEELING (0.03–) "I don't remember what happened, but I remember warmth and joy."
|
|
135
|
-
FORGOTTEN(< 0.03) [not returned — the memory is gone]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Patent
|
|
139
|
-
|
|
140
|
-
MemoryLayer implements three novel mechanisms filed with the Indian Patent Office (June 2026):
|
|
141
|
-
|
|
142
|
-
1. **Emotionally-modulated decay floor** — high-emotion memories asymptotically approach a floor rather than decaying to zero.
|
|
143
|
-
2. **Fidelity-degraded retrieval** — content specificity decreases proportionally to computed temporal strength.
|
|
144
|
-
3. **Post-retrieval reconsolidation** — weak memories are rewritten toward current context on each recall.
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
*Author: Mounica Goriparti · mounica.goriparti@gmail.com*
|
memorydrift-3.0.2/README.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# MemoryLayer
|
|
2
|
-
|
|
3
|
-
AI memory that decays, degrades, and drifts the way human memory does.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pip install memorydrift
|
|
11
|
-
pip install "memorydrift[embed]"
|
|
12
|
-
pip install "memorydrift[full]"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Quickstart
|
|
16
|
-
|
|
17
|
-
```python
|
|
18
|
-
from memorylayer import MemoryStore, MemoryLayer
|
|
19
|
-
|
|
20
|
-
store = MemoryStore(auto_embed=True)
|
|
21
|
-
|
|
22
|
-
store.write("I saved the blacksmith's son", emotional_weight=0.9, age_at_encoding=28)
|
|
23
|
-
store.write("The dragon was defeated in the northern tower", emotional_weight=0.7)
|
|
24
|
-
|
|
25
|
-
for r in store.retrieve():
|
|
26
|
-
print(r.display_content) # "I clearly remember: I saved the blacksmith's son"
|
|
27
|
-
print(r.decay.fidelity) # VIVID / CLEAR / FADED / VAGUE / FEELING
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Spreading activation fires automatically — semantically similar memories surface together.
|
|
31
|
-
|
|
32
|
-
## What makes it different
|
|
33
|
-
|
|
34
|
-
Every other AI memory system is a key-value store. MemoryLayer implements the neuroscience:
|
|
35
|
-
|
|
36
|
-
| Human memory property | MemoryLayer |
|
|
37
|
-
|---|---|
|
|
38
|
-
| Emotional memories last longer | `emotional_weight` stretches halflife up to 3× |
|
|
39
|
-
| Details fade before the gist | Fidelity degrades: VIVID → CLEAR → FADED → VAGUE → FEELING |
|
|
40
|
-
| Rehearsal keeps memories strong | `repetition_count` boosts stability (spaced repetition) |
|
|
41
|
-
| Related memories surface together | Spreading activation via semantic embeddings |
|
|
42
|
-
| Weak memories drift on recall | Reconsolidation: content rewrites toward current context |
|
|
43
|
-
| Childhood memories are hazy | Age-at-encoding: childhood amnesia + reminiscence bump (Rubin 1997) |
|
|
44
|
-
| Sleep consolidates the day | `simulate_sleep()` adds replay repetitions, tags CLEAR+ for promotion |
|
|
45
|
-
|
|
46
|
-
## Memory layers
|
|
47
|
-
|
|
48
|
-
| Layer | Halflife | Use for |
|
|
49
|
-
|---|---|---|
|
|
50
|
-
| `WORKING` | ~1 hour | Active conversation context |
|
|
51
|
-
| `EPISODIC` | 1 year | Events and experiences |
|
|
52
|
-
| `SEMANTIC` | 5 years | Facts and knowledge |
|
|
53
|
-
| `PROSPECTIVE` | 3 days | Intentions that fade if unacted on |
|
|
54
|
-
| `IDENTITY` | Forever | Core beliefs and self-concept |
|
|
55
|
-
|
|
56
|
-
## Advanced API
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from memorylayer import (
|
|
60
|
-
# Prospective memory — intentions
|
|
61
|
-
write_intention, complete_intention, get_overdue_intentions,
|
|
62
|
-
|
|
63
|
-
# Collective memory — shared events, per-entity emotional weight
|
|
64
|
-
CollectiveMemoryStore,
|
|
65
|
-
|
|
66
|
-
# Sleep consolidation
|
|
67
|
-
simulate_sleep, SleepSession,
|
|
68
|
-
|
|
69
|
-
# Reconsolidation — memory drift on recall
|
|
70
|
-
reconsolidate_sync,
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
# Prospective memory
|
|
74
|
-
store = MemoryStore()
|
|
75
|
-
intention = write_intention(store, "Call the lawyer", due_in_days=3)
|
|
76
|
-
complete_intention(store, intention.id) # converts to episodic on completion
|
|
77
|
-
|
|
78
|
-
# Collective memory
|
|
79
|
-
shared = CollectiveMemoryStore()
|
|
80
|
-
event = shared.write_event(
|
|
81
|
-
"The team won the championship",
|
|
82
|
-
participants={"alice": 0.95, "bob": 0.40}, # alice scored; bob watched
|
|
83
|
-
)
|
|
84
|
-
alice_memories = shared.recall_for("alice") # stronger than bob's
|
|
85
|
-
|
|
86
|
-
# Sleep consolidation
|
|
87
|
-
result = simulate_sleep(store, SleepSession(quality=0.85, duration_hours=7.5))
|
|
88
|
-
print(f"Strengthened: {result.memories_strengthened}")
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Fidelity levels
|
|
92
|
-
|
|
93
|
-
When a memory is retrieved, its content is automatically degraded to match its strength:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
VIVID (> 0.70) "I clearly remember: she smiled at the coffee shop."
|
|
97
|
-
CLEAR (0.45–) "I remember: something about a coffee shop."
|
|
98
|
-
FADED (0.22–) "I vaguely recall: she smiled."
|
|
99
|
-
VAGUE (0.08–) "I have a faint sense that: she smiled…"
|
|
100
|
-
FEELING (0.03–) "I don't remember what happened, but I remember warmth and joy."
|
|
101
|
-
FORGOTTEN(< 0.03) [not returned — the memory is gone]
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Patent
|
|
105
|
-
|
|
106
|
-
MemoryLayer implements three novel mechanisms filed with the Indian Patent Office (June 2026):
|
|
107
|
-
|
|
108
|
-
1. **Emotionally-modulated decay floor** — high-emotion memories asymptotically approach a floor rather than decaying to zero.
|
|
109
|
-
2. **Fidelity-degraded retrieval** — content specificity decreases proportionally to computed temporal strength.
|
|
110
|
-
3. **Post-retrieval reconsolidation** — weak memories are rewritten toward current context on each recall.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
*Author: Mounica Goriparti · mounica.goriparti@gmail.com*
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: memorydrift
|
|
3
|
-
Version: 3.0.2
|
|
4
|
-
Summary: AI memory that decays, degrades, and drifts the way human memory does
|
|
5
|
-
Author-email: Mounica Goriparti <mounica.goriparti@gmail.com>
|
|
6
|
-
License-Expression: LicenseRef-Proprietary
|
|
7
|
-
Project-URL: Homepage, https://github.com/mounica-goriparti/memorylayer
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/mounica-goriparti/memorylayer/issues
|
|
9
|
-
Keywords: AI memory,cognitive AI,LLM,agent memory,episodic memory,memory decay,NLP
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Intended Audience :: Science/Research
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
-
Requires-Python: >=3.9
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
Provides-Extra: embed
|
|
22
|
-
Requires-Dist: sentence-transformers>=2.2; extra == "embed"
|
|
23
|
-
Provides-Extra: neural
|
|
24
|
-
Requires-Dist: transformers>=4.30; extra == "neural"
|
|
25
|
-
Requires-Dist: torch>=2.0; extra == "neural"
|
|
26
|
-
Provides-Extra: ui
|
|
27
|
-
Requires-Dist: streamlit>=1.30; extra == "ui"
|
|
28
|
-
Requires-Dist: plotly>=5.0; extra == "ui"
|
|
29
|
-
Requires-Dist: pandas>=2.0; extra == "ui"
|
|
30
|
-
Provides-Extra: full
|
|
31
|
-
Requires-Dist: sentence-transformers>=2.2; extra == "full"
|
|
32
|
-
Requires-Dist: transformers>=4.30; extra == "full"
|
|
33
|
-
Requires-Dist: torch>=2.0; extra == "full"
|
|
34
|
-
|
|
35
|
-
# MemoryLayer
|
|
36
|
-
|
|
37
|
-
AI memory that decays, degrades, and drifts the way human memory does.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
## Install
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
pip install memorydrift
|
|
45
|
-
pip install "memorydrift[embed]"
|
|
46
|
-
pip install "memorydrift[full]"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Quickstart
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
from memorylayer import MemoryStore, MemoryLayer
|
|
53
|
-
|
|
54
|
-
store = MemoryStore(auto_embed=True)
|
|
55
|
-
|
|
56
|
-
store.write("I saved the blacksmith's son", emotional_weight=0.9, age_at_encoding=28)
|
|
57
|
-
store.write("The dragon was defeated in the northern tower", emotional_weight=0.7)
|
|
58
|
-
|
|
59
|
-
for r in store.retrieve():
|
|
60
|
-
print(r.display_content) # "I clearly remember: I saved the blacksmith's son"
|
|
61
|
-
print(r.decay.fidelity) # VIVID / CLEAR / FADED / VAGUE / FEELING
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Spreading activation fires automatically — semantically similar memories surface together.
|
|
65
|
-
|
|
66
|
-
## What makes it different
|
|
67
|
-
|
|
68
|
-
Every other AI memory system is a key-value store. MemoryLayer implements the neuroscience:
|
|
69
|
-
|
|
70
|
-
| Human memory property | MemoryLayer |
|
|
71
|
-
|---|---|
|
|
72
|
-
| Emotional memories last longer | `emotional_weight` stretches halflife up to 3× |
|
|
73
|
-
| Details fade before the gist | Fidelity degrades: VIVID → CLEAR → FADED → VAGUE → FEELING |
|
|
74
|
-
| Rehearsal keeps memories strong | `repetition_count` boosts stability (spaced repetition) |
|
|
75
|
-
| Related memories surface together | Spreading activation via semantic embeddings |
|
|
76
|
-
| Weak memories drift on recall | Reconsolidation: content rewrites toward current context |
|
|
77
|
-
| Childhood memories are hazy | Age-at-encoding: childhood amnesia + reminiscence bump (Rubin 1997) |
|
|
78
|
-
| Sleep consolidates the day | `simulate_sleep()` adds replay repetitions, tags CLEAR+ for promotion |
|
|
79
|
-
|
|
80
|
-
## Memory layers
|
|
81
|
-
|
|
82
|
-
| Layer | Halflife | Use for |
|
|
83
|
-
|---|---|---|
|
|
84
|
-
| `WORKING` | ~1 hour | Active conversation context |
|
|
85
|
-
| `EPISODIC` | 1 year | Events and experiences |
|
|
86
|
-
| `SEMANTIC` | 5 years | Facts and knowledge |
|
|
87
|
-
| `PROSPECTIVE` | 3 days | Intentions that fade if unacted on |
|
|
88
|
-
| `IDENTITY` | Forever | Core beliefs and self-concept |
|
|
89
|
-
|
|
90
|
-
## Advanced API
|
|
91
|
-
|
|
92
|
-
```python
|
|
93
|
-
from memorylayer import (
|
|
94
|
-
# Prospective memory — intentions
|
|
95
|
-
write_intention, complete_intention, get_overdue_intentions,
|
|
96
|
-
|
|
97
|
-
# Collective memory — shared events, per-entity emotional weight
|
|
98
|
-
CollectiveMemoryStore,
|
|
99
|
-
|
|
100
|
-
# Sleep consolidation
|
|
101
|
-
simulate_sleep, SleepSession,
|
|
102
|
-
|
|
103
|
-
# Reconsolidation — memory drift on recall
|
|
104
|
-
reconsolidate_sync,
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
# Prospective memory
|
|
108
|
-
store = MemoryStore()
|
|
109
|
-
intention = write_intention(store, "Call the lawyer", due_in_days=3)
|
|
110
|
-
complete_intention(store, intention.id) # converts to episodic on completion
|
|
111
|
-
|
|
112
|
-
# Collective memory
|
|
113
|
-
shared = CollectiveMemoryStore()
|
|
114
|
-
event = shared.write_event(
|
|
115
|
-
"The team won the championship",
|
|
116
|
-
participants={"alice": 0.95, "bob": 0.40}, # alice scored; bob watched
|
|
117
|
-
)
|
|
118
|
-
alice_memories = shared.recall_for("alice") # stronger than bob's
|
|
119
|
-
|
|
120
|
-
# Sleep consolidation
|
|
121
|
-
result = simulate_sleep(store, SleepSession(quality=0.85, duration_hours=7.5))
|
|
122
|
-
print(f"Strengthened: {result.memories_strengthened}")
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Fidelity levels
|
|
126
|
-
|
|
127
|
-
When a memory is retrieved, its content is automatically degraded to match its strength:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
VIVID (> 0.70) "I clearly remember: she smiled at the coffee shop."
|
|
131
|
-
CLEAR (0.45–) "I remember: something about a coffee shop."
|
|
132
|
-
FADED (0.22–) "I vaguely recall: she smiled."
|
|
133
|
-
VAGUE (0.08–) "I have a faint sense that: she smiled…"
|
|
134
|
-
FEELING (0.03–) "I don't remember what happened, but I remember warmth and joy."
|
|
135
|
-
FORGOTTEN(< 0.03) [not returned — the memory is gone]
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Patent
|
|
139
|
-
|
|
140
|
-
MemoryLayer implements three novel mechanisms filed with the Indian Patent Office (June 2026):
|
|
141
|
-
|
|
142
|
-
1. **Emotionally-modulated decay floor** — high-emotion memories asymptotically approach a floor rather than decaying to zero.
|
|
143
|
-
2. **Fidelity-degraded retrieval** — content specificity decreases proportionally to computed temporal strength.
|
|
144
|
-
3. **Post-retrieval reconsolidation** — weak memories are rewritten toward current context on each recall.
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
*Author: Mounica Goriparti · mounica.goriparti@gmail.com*
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
README.md
|
|
2
|
-
pyproject.toml
|
|
3
|
-
memorydrift.egg-info/PKG-INFO
|
|
4
|
-
memorydrift.egg-info/SOURCES.txt
|
|
5
|
-
memorydrift.egg-info/dependency_links.txt
|
|
6
|
-
memorydrift.egg-info/requires.txt
|
|
7
|
-
memorydrift.egg-info/top_level.txt
|
|
8
|
-
memorylayer/__init__.py
|
|
9
|
-
memorylayer/collective.py
|
|
10
|
-
memorylayer/consolidation.py
|
|
11
|
-
memorylayer/decay.py
|
|
12
|
-
memorylayer/embedding.py
|
|
13
|
-
memorylayer/emotion.py
|
|
14
|
-
memorylayer/fidelity.py
|
|
15
|
-
memorylayer/memory_store.py
|
|
16
|
-
memorylayer/prospective.py
|
|
17
|
-
memorylayer/reconsolidation.py
|
|
18
|
-
memorylayer/sleep.py
|
|
19
|
-
tests/test_decay.py
|
|
20
|
-
tests/test_enhancements.py
|
|
21
|
-
tests/test_memory.py
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
MemoryLayer — AI That Remembers The Way You Do
|
|
3
|
-
|
|
4
|
-
Primary import:
|
|
5
|
-
from memorylayer import MemoryStore, MemoryLayer
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
# ── Primary API ───────────────────────────────────────────────────────────────
|
|
9
|
-
from .memory_store import MemoryStore, Memory, RetrievedMemory, spreading_activation
|
|
10
|
-
from .decay import (
|
|
11
|
-
MemoryLayer, FidelityLevel, DecayResult,
|
|
12
|
-
compute_strength,
|
|
13
|
-
age_encoding_factor, age_encoding_factor_smooth, emotional_early_floor,
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
# ── Emotion + Fidelity ────────────────────────────────────────────────────────
|
|
17
|
-
from .emotion import classify, neural_emotional_weight, NEURAL_AVAILABLE
|
|
18
|
-
from .fidelity import degrade_content, build_prompt_context
|
|
19
|
-
|
|
20
|
-
# ── Consolidation + Reconsolidation ──────────────────────────────────────────
|
|
21
|
-
from .consolidation import run_consolidation
|
|
22
|
-
from .reconsolidation import (
|
|
23
|
-
reconsolidate_sync, reconsolidate_async,
|
|
24
|
-
RECONSOLIDATION_THRESHOLD, MAX_RECONSOLIDATIONS,
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
# ── Extensions ────────────────────────────────────────────────────────────────
|
|
28
|
-
from .embedding import embed, get_embedder, EMBED_AVAILABLE
|
|
29
|
-
from .prospective import (
|
|
30
|
-
write_intention, complete_intention,
|
|
31
|
-
get_pending_intentions, get_overdue_intentions, is_overdue,
|
|
32
|
-
)
|
|
33
|
-
from .collective import CollectiveMemoryStore, CollectiveMemory, EntityRecall
|
|
34
|
-
from .sleep import simulate_sleep, SleepSession, SleepConsolidationResult
|
|
35
|
-
|
|
36
|
-
__version__ = "3.0.0"
|
|
37
|
-
__author__ = "Mounica Goriparti"
|
|
38
|
-
__license__ = "Proprietary"
|
|
39
|
-
__all__ = [
|
|
40
|
-
# Core
|
|
41
|
-
"MemoryStore", "Memory", "RetrievedMemory", "spreading_activation",
|
|
42
|
-
"MemoryLayer", "FidelityLevel", "DecayResult",
|
|
43
|
-
# Emotion + Fidelity
|
|
44
|
-
"classify", "neural_emotional_weight", "NEURAL_AVAILABLE",
|
|
45
|
-
"degrade_content", "build_prompt_context",
|
|
46
|
-
# Consolidation
|
|
47
|
-
"run_consolidation",
|
|
48
|
-
"reconsolidate_sync", "reconsolidate_async",
|
|
49
|
-
"RECONSOLIDATION_THRESHOLD", "MAX_RECONSOLIDATIONS",
|
|
50
|
-
# Embeddings
|
|
51
|
-
"embed", "get_embedder", "EMBED_AVAILABLE",
|
|
52
|
-
# Prospective
|
|
53
|
-
"write_intention", "complete_intention",
|
|
54
|
-
"get_pending_intentions", "get_overdue_intentions", "is_overdue",
|
|
55
|
-
# Collective
|
|
56
|
-
"CollectiveMemoryStore", "CollectiveMemory", "EntityRecall",
|
|
57
|
-
# Sleep
|
|
58
|
-
"simulate_sleep", "SleepSession", "SleepConsolidationResult",
|
|
59
|
-
]
|