holographic-memory-engine 1.0.2__py3-none-any.whl

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.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: holographic-memory-engine
3
+ Version: 1.0.2
4
+ Summary: A universal phase-space memory engine that retrieves knowledge via holographic interference instead of vector similarity search.
5
+ Home-page: https://github.com/Luckyy0311
6
+ Author: Abdul Mofique Siddiqui
7
+ Author-email: mofique7860@gmail.com
8
+ License: MIT
9
+ Keywords: holographic-memory,rag,vector-search,ai,retrieval
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: numpy>=1.21
24
+ Provides-Extra: gpu
25
+ Requires-Dist: cupy>=12.0; extra == "gpu"
26
+ Provides-Extra: neural
27
+ Requires-Dist: sentence-transformers>=2.2; extra == "neural"
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0; extra == "dev"
30
+ Requires-Dist: build>=1.0; extra == "dev"
31
+ Requires-Dist: twine>=4.0; extra == "dev"
32
+ Dynamic: author
33
+ Dynamic: author-email
34
+ Dynamic: classifier
35
+ Dynamic: description
36
+ Dynamic: description-content-type
37
+ Dynamic: home-page
38
+ Dynamic: keywords
39
+ Dynamic: license
40
+ Dynamic: provides-extra
41
+ Dynamic: requires-dist
42
+ Dynamic: requires-python
43
+ Dynamic: summary
44
+
45
+ # holographic-memory-engine
46
+
47
+ A universal phase-space memory engine that retrieves knowledge via **holographic
48
+ interference** instead of vector similarity search.
49
+
50
+
51
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
52
+
53
+ ---
54
+
55
+ ## Why?
56
+
57
+ Classic RAG retrieves text chunks by cosine similarity and stuffs them into a
58
+ prompt. This returns **passages**, not answers, and pollutes the context window.
59
+
60
+ `holographic-memory` binds `key -> value` pairs into complex phase vectors and
61
+ retrieves by **constructive / destructive wave interference**. The result is the
62
+ exact value, directly, with no chunk stuffing.
63
+
64
+ | Feature | Classic RAG | holographic-memory |
65
+ |---|---|---|
66
+ | Retrieval signal | Cosine similarity | Phase interference |
67
+ | Returns | Text chunk | Exact value |
68
+ | Context pollution | High | None |
69
+ | Answer verbosity | High | Minimal |
70
+
71
+ ---
72
+
73
+ ## Installation
74
+
75
+ ```bash
76
+ pip install holographic-memory
77
+ ```
78
+
79
+ Optional extras:
80
+
81
+ ```bash
82
+ # GPU acceleration via CuPy
83
+ pip install holographic-memory[gpu]
84
+
85
+ # Neural (sentence-transformers) encoder
86
+ pip install holographic-memory[neural]
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Quick Start
92
+
93
+ ```python
94
+ from holographic import HolographicEngine, HashPhaseEncoder
95
+
96
+ engine = HolographicEngine(encoder=HashPhaseEncoder(dim=2048))
97
+
98
+ engine.add("capital France", "Paris")
99
+ engine.add("capital Japan", "Tokyo")
100
+ engine.add("ceo Tesla", "Elon Musk")
101
+ engine.build()
102
+
103
+ print(engine.ask("What is the capital of France?")["answer"])
104
+ # -> Paris
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Use a Neural Encoder
110
+
111
+ ```python
112
+ from holographic import HolographicEngine, NeuralPhaseEncoder
113
+
114
+ engine = HolographicEngine(encoder=NeuralPhaseEncoder(dim=2048))
115
+ # ... same API
116
+ ```
117
+
118
+ ## Custom Encoder
119
+
120
+ Any object with a `dim` attribute and an `encode(text) -> complex ndarray`
121
+ method works:
122
+
123
+ ```python
124
+ import numpy as np
125
+ from holographic import HolographicEngine
126
+
127
+ class MyEncoder:
128
+ dim = 2048
129
+ def encode(self, text: str) -> np.ndarray:
130
+ # your logic; return complex64 vector of shape (dim,)
131
+ ...
132
+
133
+ engine = HolographicEngine(encoder=MyEncoder())
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Ingest a Whole Document
139
+
140
+ ```python
141
+ from holographic import HolographicEngine, HashPhaseEncoder, ingest_text
142
+
143
+ engine = HolographicEngine(encoder=HashPhaseEncoder(dim=2048))
144
+ ingest_text(engine, open("handbook.txt").read(), source="handbook")
145
+ engine.build()
146
+ ```
147
+
148
+ ## Save / Load
149
+
150
+ ```python
151
+ from holographic import save_engine, load_engine
152
+
153
+ save_engine(engine, "memory.json")
154
+ load_engine(engine, "memory.json")
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Configuration
160
+
161
+ ```python
162
+ from holographic import HolographicConfig
163
+
164
+ config = HolographicConfig(
165
+ dim=4096, # vector dimensionality
166
+ shard_capacity=0, # 0 = single large shard
167
+ default_top_k=5,
168
+ score_threshold=0.0,
169
+ margin_ratio=1.02,
170
+ use_gpu=False,
171
+ )
172
+ ```
173
+
174
+ ---
175
+
176
+ ## How It Works
177
+
178
+ 1. **Bind** — `key` and `value` are encoded to constant-modulus complex vectors, then bound via element-wise multiplication: `key * value`.
179
+ 2. **Superpose** — all bindings are summed into a single memory vector.
180
+ 3. **Retrieve** — the query is multiplied by the conjugate of the memory. Matching keys resonate (constructive interference) and surface their bound values; non-matches cancel out (destructive interference).
181
+
182
+ ---
183
+
184
+ ## Running the Benchmark
185
+
186
+ ```bash
187
+ pip install -e .
188
+ python examples/evaluate.py
189
+ ```
190
+
191
+ ---
192
+
193
+ ## License
194
+
195
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ holographic_memory_engine-1.0.2.dist-info/METADATA,sha256=9QRN-oCxPfN1GxCw-VWeZwKJpwp1y56VejvHlqAWx8g,5180
2
+ holographic_memory_engine-1.0.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
3
+ holographic_memory_engine-1.0.2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ holographic_memory_engine-1.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+