cuemap 0.2.0__tar.gz → 0.2.1__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.
- cuemap-0.2.1/MANIFEST.in +8 -0
- {cuemap-0.2.0/cuemap.egg-info → cuemap-0.2.1}/PKG-INFO +71 -12
- cuemap-0.2.0/PKG-INFO → cuemap-0.2.1/README.md +51 -27
- cuemap-0.2.0/README.md → cuemap-0.2.1/cuemap.egg-info/PKG-INFO +86 -8
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap.egg-info/SOURCES.txt +5 -1
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap.egg-info/requires.txt +2 -0
- cuemap-0.2.1/examples/pure_usage.py +96 -0
- cuemap-0.2.1/examples/with_local_llm.py +85 -0
- cuemap-0.2.1/examples/with_openai.py +131 -0
- cuemap-0.2.1/pyproject.toml +48 -0
- cuemap-0.2.0/pyproject.toml +0 -28
- {cuemap-0.2.0 → cuemap-0.2.1}/LICENSE +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap/__init__.py +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap/client.py +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap/exceptions.py +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap/models.py +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap.egg-info/dependency_links.txt +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/cuemap.egg-info/top_level.txt +0 -0
- {cuemap-0.2.0 → cuemap-0.2.1}/setup.cfg +0 -0
cuemap-0.2.1/MANIFEST.in
ADDED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cuemap
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Redis for AI Agents - High-performance temporal-associative memory
|
|
5
|
+
Author-email: CueMap Team <hello@cuemap.dev>
|
|
5
6
|
License: MIT
|
|
6
|
-
Project-URL: Homepage, https://cuemap
|
|
7
|
-
Project-URL: Documentation, https://
|
|
7
|
+
Project-URL: Homepage, https://github.com/cuemap/cuemap
|
|
8
|
+
Project-URL: Documentation, https://github.com/cuemap/cuemap#readme
|
|
8
9
|
Project-URL: Repository, https://github.com/cuemap/cuemap
|
|
9
|
-
|
|
10
|
+
Project-URL: Issues, https://github.com/cuemap/cuemap/issues
|
|
11
|
+
Project-URL: Docker, https://hub.docker.com/r/cuemap/engine
|
|
12
|
+
Keywords: ai,memory,agents,redis,temporal,associative,llm,rag
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
10
24
|
Requires-Python: >=3.8
|
|
11
25
|
Description-Content-Type: text/markdown
|
|
12
26
|
License-File: LICENSE
|
|
@@ -15,6 +29,8 @@ Requires-Dist: pydantic>=2.0.0
|
|
|
15
29
|
Provides-Extra: dev
|
|
16
30
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
17
31
|
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
18
34
|
Dynamic: license-file
|
|
19
35
|
|
|
20
36
|
# CueMap: Redis for AI Agents
|
|
@@ -43,6 +59,14 @@ That's it. No ML models. No transformers. Just pure speed.
|
|
|
43
59
|
|
|
44
60
|
## Quick Start
|
|
45
61
|
|
|
62
|
+
### 1. Start the Engine
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. Use the SDK
|
|
69
|
+
|
|
46
70
|
```python
|
|
47
71
|
from cuemap import CueMap
|
|
48
72
|
|
|
@@ -193,23 +217,57 @@ client.recall(["deployment", "kubernetes"])
|
|
|
193
217
|
client.recall(["api", "users"])
|
|
194
218
|
```
|
|
195
219
|
|
|
220
|
+
## Running the Engine
|
|
221
|
+
|
|
222
|
+
CueMap requires a running engine. Choose your deployment:
|
|
223
|
+
|
|
224
|
+
### Option 1: Docker (Recommended)
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Option 2: From Source
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
git clone https://github.com/cuemap/cuemap
|
|
234
|
+
cd cuemap/rust_engine
|
|
235
|
+
cargo build --release
|
|
236
|
+
./target/release/cuemap-rust --port 8080
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Option 3: Docker Compose
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
git clone https://github.com/cuemap/cuemap
|
|
243
|
+
cd cuemap
|
|
244
|
+
docker-compose up -d
|
|
245
|
+
```
|
|
246
|
+
|
|
196
247
|
## Configuration
|
|
197
248
|
|
|
198
|
-
###
|
|
249
|
+
### Connect to Engine
|
|
199
250
|
|
|
200
251
|
```python
|
|
252
|
+
# Default (localhost)
|
|
253
|
+
client = CueMap()
|
|
254
|
+
|
|
255
|
+
# Custom URL
|
|
256
|
+
client = CueMap(url="http://your-server:8080")
|
|
257
|
+
|
|
258
|
+
# With authentication
|
|
201
259
|
client = CueMap(
|
|
202
|
-
url="
|
|
203
|
-
api_key="your-
|
|
260
|
+
url="http://your-server:8080",
|
|
261
|
+
api_key="your-secret-key"
|
|
204
262
|
)
|
|
205
263
|
```
|
|
206
264
|
|
|
207
265
|
### Multi-tenancy
|
|
208
266
|
|
|
209
267
|
```python
|
|
268
|
+
# Use project isolation
|
|
210
269
|
client = CueMap(
|
|
211
|
-
url="
|
|
212
|
-
api_key="your-api-key",
|
|
270
|
+
url="http://your-server:8080",
|
|
213
271
|
project_id="my-project"
|
|
214
272
|
)
|
|
215
273
|
```
|
|
@@ -265,9 +323,10 @@ async with AsyncCueMap() as client:
|
|
|
265
323
|
|
|
266
324
|
## Documentation
|
|
267
325
|
|
|
268
|
-
- [
|
|
269
|
-
- [
|
|
270
|
-
- [
|
|
326
|
+
- [GitHub Repository](https://github.com/cuemap/cuemap)
|
|
327
|
+
- [Production Guide](https://github.com/cuemap/cuemap/blob/main/rust_engine/PRODUCTION.md)
|
|
328
|
+
- [Docker Hub](https://hub.docker.com/r/cuemap/engine)
|
|
329
|
+
- [Examples](https://github.com/cuemap/cuemap/tree/main/cuemap-sdk/examples)
|
|
271
330
|
|
|
272
331
|
## License
|
|
273
332
|
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: cuemap
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Redis for AI Agents - High-performance temporal-associative memory
|
|
5
|
-
License: MIT
|
|
6
|
-
Project-URL: Homepage, https://cuemap.dev
|
|
7
|
-
Project-URL: Documentation, https://docs.cuemap.dev
|
|
8
|
-
Project-URL: Repository, https://github.com/cuemap/cuemap
|
|
9
|
-
Keywords: ai,memory,agents,redis,temporal
|
|
10
|
-
Requires-Python: >=3.8
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: httpx>=0.25.0
|
|
14
|
-
Requires-Dist: pydantic>=2.0.0
|
|
15
|
-
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
17
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
18
|
-
Dynamic: license-file
|
|
19
|
-
|
|
20
1
|
# CueMap: Redis for AI Agents
|
|
21
2
|
|
|
22
3
|
**High-performance, temporal-associative memory store.**
|
|
@@ -43,6 +24,14 @@ That's it. No ML models. No transformers. Just pure speed.
|
|
|
43
24
|
|
|
44
25
|
## Quick Start
|
|
45
26
|
|
|
27
|
+
### 1. Start the Engine
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Use the SDK
|
|
34
|
+
|
|
46
35
|
```python
|
|
47
36
|
from cuemap import CueMap
|
|
48
37
|
|
|
@@ -193,23 +182,57 @@ client.recall(["deployment", "kubernetes"])
|
|
|
193
182
|
client.recall(["api", "users"])
|
|
194
183
|
```
|
|
195
184
|
|
|
185
|
+
## Running the Engine
|
|
186
|
+
|
|
187
|
+
CueMap requires a running engine. Choose your deployment:
|
|
188
|
+
|
|
189
|
+
### Option 1: Docker (Recommended)
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Option 2: From Source
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git clone https://github.com/cuemap/cuemap
|
|
199
|
+
cd cuemap/rust_engine
|
|
200
|
+
cargo build --release
|
|
201
|
+
./target/release/cuemap-rust --port 8080
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Option 3: Docker Compose
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
git clone https://github.com/cuemap/cuemap
|
|
208
|
+
cd cuemap
|
|
209
|
+
docker-compose up -d
|
|
210
|
+
```
|
|
211
|
+
|
|
196
212
|
## Configuration
|
|
197
213
|
|
|
198
|
-
###
|
|
214
|
+
### Connect to Engine
|
|
199
215
|
|
|
200
216
|
```python
|
|
217
|
+
# Default (localhost)
|
|
218
|
+
client = CueMap()
|
|
219
|
+
|
|
220
|
+
# Custom URL
|
|
221
|
+
client = CueMap(url="http://your-server:8080")
|
|
222
|
+
|
|
223
|
+
# With authentication
|
|
201
224
|
client = CueMap(
|
|
202
|
-
url="
|
|
203
|
-
api_key="your-
|
|
225
|
+
url="http://your-server:8080",
|
|
226
|
+
api_key="your-secret-key"
|
|
204
227
|
)
|
|
205
228
|
```
|
|
206
229
|
|
|
207
230
|
### Multi-tenancy
|
|
208
231
|
|
|
209
232
|
```python
|
|
233
|
+
# Use project isolation
|
|
210
234
|
client = CueMap(
|
|
211
|
-
url="
|
|
212
|
-
api_key="your-api-key",
|
|
235
|
+
url="http://your-server:8080",
|
|
213
236
|
project_id="my-project"
|
|
214
237
|
)
|
|
215
238
|
```
|
|
@@ -265,9 +288,10 @@ async with AsyncCueMap() as client:
|
|
|
265
288
|
|
|
266
289
|
## Documentation
|
|
267
290
|
|
|
268
|
-
- [
|
|
269
|
-
- [
|
|
270
|
-
- [
|
|
291
|
+
- [GitHub Repository](https://github.com/cuemap/cuemap)
|
|
292
|
+
- [Production Guide](https://github.com/cuemap/cuemap/blob/main/rust_engine/PRODUCTION.md)
|
|
293
|
+
- [Docker Hub](https://hub.docker.com/r/cuemap/engine)
|
|
294
|
+
- [Examples](https://github.com/cuemap/cuemap/tree/main/cuemap-sdk/examples)
|
|
271
295
|
|
|
272
296
|
## License
|
|
273
297
|
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cuemap
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Redis for AI Agents - High-performance temporal-associative memory
|
|
5
|
+
Author-email: CueMap Team <hello@cuemap.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/cuemap/cuemap
|
|
8
|
+
Project-URL: Documentation, https://github.com/cuemap/cuemap#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/cuemap/cuemap
|
|
10
|
+
Project-URL: Issues, https://github.com/cuemap/cuemap/issues
|
|
11
|
+
Project-URL: Docker, https://hub.docker.com/r/cuemap/engine
|
|
12
|
+
Keywords: ai,memory,agents,redis,temporal,associative,llm,rag
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: httpx>=0.25.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
1
36
|
# CueMap: Redis for AI Agents
|
|
2
37
|
|
|
3
38
|
**High-performance, temporal-associative memory store.**
|
|
@@ -24,6 +59,14 @@ That's it. No ML models. No transformers. Just pure speed.
|
|
|
24
59
|
|
|
25
60
|
## Quick Start
|
|
26
61
|
|
|
62
|
+
### 1. Start the Engine
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. Use the SDK
|
|
69
|
+
|
|
27
70
|
```python
|
|
28
71
|
from cuemap import CueMap
|
|
29
72
|
|
|
@@ -174,23 +217,57 @@ client.recall(["deployment", "kubernetes"])
|
|
|
174
217
|
client.recall(["api", "users"])
|
|
175
218
|
```
|
|
176
219
|
|
|
220
|
+
## Running the Engine
|
|
221
|
+
|
|
222
|
+
CueMap requires a running engine. Choose your deployment:
|
|
223
|
+
|
|
224
|
+
### Option 1: Docker (Recommended)
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
docker run -p 8080:8080 cuemap/engine:latest
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Option 2: From Source
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
git clone https://github.com/cuemap/cuemap
|
|
234
|
+
cd cuemap/rust_engine
|
|
235
|
+
cargo build --release
|
|
236
|
+
./target/release/cuemap-rust --port 8080
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Option 3: Docker Compose
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
git clone https://github.com/cuemap/cuemap
|
|
243
|
+
cd cuemap
|
|
244
|
+
docker-compose up -d
|
|
245
|
+
```
|
|
246
|
+
|
|
177
247
|
## Configuration
|
|
178
248
|
|
|
179
|
-
###
|
|
249
|
+
### Connect to Engine
|
|
180
250
|
|
|
181
251
|
```python
|
|
252
|
+
# Default (localhost)
|
|
253
|
+
client = CueMap()
|
|
254
|
+
|
|
255
|
+
# Custom URL
|
|
256
|
+
client = CueMap(url="http://your-server:8080")
|
|
257
|
+
|
|
258
|
+
# With authentication
|
|
182
259
|
client = CueMap(
|
|
183
|
-
url="
|
|
184
|
-
api_key="your-
|
|
260
|
+
url="http://your-server:8080",
|
|
261
|
+
api_key="your-secret-key"
|
|
185
262
|
)
|
|
186
263
|
```
|
|
187
264
|
|
|
188
265
|
### Multi-tenancy
|
|
189
266
|
|
|
190
267
|
```python
|
|
268
|
+
# Use project isolation
|
|
191
269
|
client = CueMap(
|
|
192
|
-
url="
|
|
193
|
-
api_key="your-api-key",
|
|
270
|
+
url="http://your-server:8080",
|
|
194
271
|
project_id="my-project"
|
|
195
272
|
)
|
|
196
273
|
```
|
|
@@ -246,9 +323,10 @@ async with AsyncCueMap() as client:
|
|
|
246
323
|
|
|
247
324
|
## Documentation
|
|
248
325
|
|
|
249
|
-
- [
|
|
250
|
-
- [
|
|
251
|
-
- [
|
|
326
|
+
- [GitHub Repository](https://github.com/cuemap/cuemap)
|
|
327
|
+
- [Production Guide](https://github.com/cuemap/cuemap/blob/main/rust_engine/PRODUCTION.md)
|
|
328
|
+
- [Docker Hub](https://hub.docker.com/r/cuemap/engine)
|
|
329
|
+
- [Examples](https://github.com/cuemap/cuemap/tree/main/cuemap-sdk/examples)
|
|
252
330
|
|
|
253
331
|
## License
|
|
254
332
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
2
3
|
README.md
|
|
3
4
|
pyproject.toml
|
|
4
5
|
cuemap/__init__.py
|
|
@@ -9,4 +10,7 @@ cuemap.egg-info/PKG-INFO
|
|
|
9
10
|
cuemap.egg-info/SOURCES.txt
|
|
10
11
|
cuemap.egg-info/dependency_links.txt
|
|
11
12
|
cuemap.egg-info/requires.txt
|
|
12
|
-
cuemap.egg-info/top_level.txt
|
|
13
|
+
cuemap.egg-info/top_level.txt
|
|
14
|
+
examples/pure_usage.py
|
|
15
|
+
examples/with_local_llm.py
|
|
16
|
+
examples/with_openai.py
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Pure CueMap usage - no magic, just speed."""
|
|
2
|
+
|
|
3
|
+
from cuemap import CueMap
|
|
4
|
+
|
|
5
|
+
def main():
|
|
6
|
+
print("="*70)
|
|
7
|
+
print("CUEMAP: REDIS FOR AI AGENTS")
|
|
8
|
+
print("Pure, Fast, Predictable")
|
|
9
|
+
print("="*70)
|
|
10
|
+
|
|
11
|
+
client = CueMap()
|
|
12
|
+
|
|
13
|
+
# Add memories with explicit cues
|
|
14
|
+
print("\nAdding memories with explicit cues...")
|
|
15
|
+
|
|
16
|
+
client.add(
|
|
17
|
+
"I love Italian food, especially pizza and pasta",
|
|
18
|
+
cues=["food", "italian", "pizza", "pasta", "preferences"]
|
|
19
|
+
)
|
|
20
|
+
print("✓ Food memory")
|
|
21
|
+
|
|
22
|
+
client.add(
|
|
23
|
+
"My favorite color is blue, like the ocean",
|
|
24
|
+
cues=["color", "blue", "favorite", "preferences"]
|
|
25
|
+
)
|
|
26
|
+
print("✓ Color memory")
|
|
27
|
+
|
|
28
|
+
client.add(
|
|
29
|
+
"I work as a software engineer at a tech startup",
|
|
30
|
+
cues=["work", "job", "engineer", "software", "career"]
|
|
31
|
+
)
|
|
32
|
+
print("✓ Work memory")
|
|
33
|
+
|
|
34
|
+
client.add(
|
|
35
|
+
"I enjoy hiking in the mountains on weekends",
|
|
36
|
+
cues=["hobbies", "hiking", "mountains", "outdoor", "recreation"]
|
|
37
|
+
)
|
|
38
|
+
print("✓ Hobbies memory")
|
|
39
|
+
|
|
40
|
+
# Query with explicit cues
|
|
41
|
+
print("\n" + "="*70)
|
|
42
|
+
print("QUERYING WITH EXPLICIT CUES")
|
|
43
|
+
print("="*70)
|
|
44
|
+
|
|
45
|
+
queries = [
|
|
46
|
+
(["food"], "Food preferences"),
|
|
47
|
+
(["color", "favorite"], "Favorite color"),
|
|
48
|
+
(["work"], "Work information"),
|
|
49
|
+
(["hobbies"], "Hobbies")
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
for cues, description in queries:
|
|
53
|
+
print(f"\nQuery: {description}")
|
|
54
|
+
print(f"Cues: {cues}")
|
|
55
|
+
|
|
56
|
+
results = client.recall(cues, limit=1)
|
|
57
|
+
|
|
58
|
+
if results:
|
|
59
|
+
print(f"✅ {results[0].content}")
|
|
60
|
+
print(f" Score: {results[0].score:.2f}")
|
|
61
|
+
print(f" Intersection: {results[0].intersection_count}")
|
|
62
|
+
else:
|
|
63
|
+
print("❌ No results")
|
|
64
|
+
|
|
65
|
+
# Show the power of intersection
|
|
66
|
+
print("\n" + "="*70)
|
|
67
|
+
print("INTERSECTION SCORING DEMO")
|
|
68
|
+
print("="*70)
|
|
69
|
+
|
|
70
|
+
print("\nQuery with 1 cue: ['food']")
|
|
71
|
+
results = client.recall(["food"], limit=3)
|
|
72
|
+
print(f"Found {len(results)} results")
|
|
73
|
+
for r in results:
|
|
74
|
+
print(f" - {r.content[:50]}... (intersection: {r.intersection_count})")
|
|
75
|
+
|
|
76
|
+
print("\nQuery with 2 cues: ['food', 'italian']")
|
|
77
|
+
results = client.recall(["food", "italian"], limit=3)
|
|
78
|
+
print(f"Found {len(results)} results")
|
|
79
|
+
for r in results:
|
|
80
|
+
print(f" - {r.content[:50]}... (intersection: {r.intersection_count})")
|
|
81
|
+
|
|
82
|
+
# Stats
|
|
83
|
+
print("\n" + "="*70)
|
|
84
|
+
print("STATISTICS")
|
|
85
|
+
print("="*70)
|
|
86
|
+
|
|
87
|
+
stats = client.stats()
|
|
88
|
+
print(f"Total memories: {stats['total_memories']}")
|
|
89
|
+
print(f"Total cues: {stats['total_cues']}")
|
|
90
|
+
|
|
91
|
+
client.close()
|
|
92
|
+
print("\n✓ Done!")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
main()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Recipe: Using CueMap with local LLM (Ollama/llama.cpp)."""
|
|
2
|
+
|
|
3
|
+
from cuemap import CueMap
|
|
4
|
+
|
|
5
|
+
def extract_cues_with_llm(content: str) -> list[str]:
|
|
6
|
+
"""
|
|
7
|
+
Extract cues using local LLM.
|
|
8
|
+
|
|
9
|
+
In real usage, call Ollama or llama.cpp:
|
|
10
|
+
- ollama run llama2 "Extract tags: {content}"
|
|
11
|
+
- Or use llama-cpp-python
|
|
12
|
+
"""
|
|
13
|
+
# Mock for demonstration
|
|
14
|
+
# In real usage: call your local LLM
|
|
15
|
+
|
|
16
|
+
content_lower = content.lower()
|
|
17
|
+
cues = []
|
|
18
|
+
|
|
19
|
+
# Simple extraction (replace with LLM call)
|
|
20
|
+
words = content_lower.split()
|
|
21
|
+
keywords = [w for w in words if len(w) > 4]
|
|
22
|
+
|
|
23
|
+
return keywords[:5]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def main():
|
|
27
|
+
print("="*70)
|
|
28
|
+
print("RECIPE: CUEMAP + LOCAL LLM")
|
|
29
|
+
print("="*70)
|
|
30
|
+
|
|
31
|
+
client = CueMap()
|
|
32
|
+
|
|
33
|
+
print("\nExample with Ollama:")
|
|
34
|
+
print("""
|
|
35
|
+
# Install Ollama: https://ollama.ai
|
|
36
|
+
# Run: ollama run llama2
|
|
37
|
+
|
|
38
|
+
import subprocess
|
|
39
|
+
import json
|
|
40
|
+
|
|
41
|
+
def extract_cues_ollama(content: str) -> list[str]:
|
|
42
|
+
prompt = f'''Extract 3-5 search tags from this text.
|
|
43
|
+
Return only a JSON array.
|
|
44
|
+
|
|
45
|
+
Text: {content}
|
|
46
|
+
|
|
47
|
+
Tags:'''
|
|
48
|
+
|
|
49
|
+
result = subprocess.run(
|
|
50
|
+
["ollama", "run", "llama2", prompt],
|
|
51
|
+
capture_output=True,
|
|
52
|
+
text=True
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Parse JSON response
|
|
56
|
+
tags = json.loads(result.stdout.strip())
|
|
57
|
+
return tags
|
|
58
|
+
|
|
59
|
+
# Use with CueMap
|
|
60
|
+
cues = extract_cues_ollama("I love hiking")
|
|
61
|
+
client.add("I love hiking", cues=cues)
|
|
62
|
+
""")
|
|
63
|
+
|
|
64
|
+
print("\n" + "="*70)
|
|
65
|
+
print("DEMO WITH MOCK LLM")
|
|
66
|
+
print("="*70)
|
|
67
|
+
|
|
68
|
+
# Demo with mock
|
|
69
|
+
memories = [
|
|
70
|
+
"I love Italian food, especially pizza and pasta",
|
|
71
|
+
"My favorite color is blue, like the ocean",
|
|
72
|
+
"I work as a software engineer at a tech startup"
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
for memory in memories:
|
|
76
|
+
cues = extract_cues_with_llm(memory)
|
|
77
|
+
client.add(memory, cues=cues)
|
|
78
|
+
print(f"\n✓ Added: {memory[:50]}...")
|
|
79
|
+
print(f" Cues: {cues}")
|
|
80
|
+
|
|
81
|
+
client.close()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
main()
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Recipe: Using CueMap with OpenAI for auto-tagging."""
|
|
2
|
+
|
|
3
|
+
from cuemap import CueMap
|
|
4
|
+
import json
|
|
5
|
+
|
|
6
|
+
# Mock OpenAI for demonstration
|
|
7
|
+
class MockOpenAI:
|
|
8
|
+
"""Mock OpenAI client for demonstration."""
|
|
9
|
+
|
|
10
|
+
@staticmethod
|
|
11
|
+
def extract_tags(content: str) -> list[str]:
|
|
12
|
+
"""Extract tags using 'AI' (mocked for demo)."""
|
|
13
|
+
# In real usage, this would call OpenAI API
|
|
14
|
+
# For demo, we'll use simple rules
|
|
15
|
+
|
|
16
|
+
content_lower = content.lower()
|
|
17
|
+
tags = []
|
|
18
|
+
|
|
19
|
+
# Category detection
|
|
20
|
+
if any(word in content_lower for word in ["love", "like", "enjoy", "favorite"]):
|
|
21
|
+
tags.append("preferences")
|
|
22
|
+
|
|
23
|
+
if any(word in content_lower for word in ["work", "job", "career", "engineer"]):
|
|
24
|
+
tags.append("work")
|
|
25
|
+
|
|
26
|
+
if any(word in content_lower for word in ["hobby", "hobbies", "recreation", "fun"]):
|
|
27
|
+
tags.append("hobbies")
|
|
28
|
+
|
|
29
|
+
# Extract nouns (simple approach)
|
|
30
|
+
words = content_lower.split()
|
|
31
|
+
nouns = [w for w in words if len(w) > 4 and w not in [
|
|
32
|
+
"especially", "really", "about", "would", "could", "should"
|
|
33
|
+
]]
|
|
34
|
+
|
|
35
|
+
tags.extend(nouns[:5])
|
|
36
|
+
|
|
37
|
+
return list(set(tags))[:7] # Max 7 tags
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def main():
|
|
41
|
+
print("="*70)
|
|
42
|
+
print("RECIPE: CUEMAP + OPENAI AUTO-TAGGING")
|
|
43
|
+
print("="*70)
|
|
44
|
+
|
|
45
|
+
client = CueMap()
|
|
46
|
+
openai = MockOpenAI() # Replace with real OpenAI client
|
|
47
|
+
|
|
48
|
+
# Helper function
|
|
49
|
+
def smart_add(content: str) -> str:
|
|
50
|
+
"""Add memory with AI-generated tags."""
|
|
51
|
+
# Step 1: Ask AI for tags
|
|
52
|
+
cues = openai.extract_tags(content)
|
|
53
|
+
|
|
54
|
+
print(f"\nContent: {content}")
|
|
55
|
+
print(f"AI-extracted cues: {cues}")
|
|
56
|
+
|
|
57
|
+
# Step 2: Store in CueMap
|
|
58
|
+
memory_id = client.add(content, cues=cues)
|
|
59
|
+
print(f"✓ Stored: {memory_id}")
|
|
60
|
+
|
|
61
|
+
return memory_id
|
|
62
|
+
|
|
63
|
+
# Add memories with AI tagging
|
|
64
|
+
print("\nAdding memories with AI-generated tags...")
|
|
65
|
+
|
|
66
|
+
smart_add("I love Italian food, especially pizza and pasta")
|
|
67
|
+
smart_add("My favorite color is blue, like the ocean")
|
|
68
|
+
smart_add("I work as a software engineer at a tech startup")
|
|
69
|
+
smart_add("I enjoy hiking in the mountains on weekends")
|
|
70
|
+
|
|
71
|
+
# Query
|
|
72
|
+
print("\n" + "="*70)
|
|
73
|
+
print("QUERYING")
|
|
74
|
+
print("="*70)
|
|
75
|
+
|
|
76
|
+
queries = [
|
|
77
|
+
["preferences", "italian"],
|
|
78
|
+
["work", "engineer"],
|
|
79
|
+
["hobbies", "hiking"]
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
for cues in queries:
|
|
83
|
+
print(f"\nCues: {cues}")
|
|
84
|
+
results = client.recall(cues, limit=1)
|
|
85
|
+
|
|
86
|
+
if results:
|
|
87
|
+
print(f"✅ {results[0].content}")
|
|
88
|
+
else:
|
|
89
|
+
print("❌ No results")
|
|
90
|
+
|
|
91
|
+
print("\n" + "="*70)
|
|
92
|
+
print("REAL OPENAI INTEGRATION")
|
|
93
|
+
print("="*70)
|
|
94
|
+
|
|
95
|
+
print("""
|
|
96
|
+
# Real implementation with OpenAI:
|
|
97
|
+
|
|
98
|
+
import openai
|
|
99
|
+
from cuemap import CueMap
|
|
100
|
+
|
|
101
|
+
client = CueMap()
|
|
102
|
+
|
|
103
|
+
def extract_cues_with_openai(content: str) -> list[str]:
|
|
104
|
+
response = openai.chat.completions.create(
|
|
105
|
+
model="gpt-4",
|
|
106
|
+
messages=[
|
|
107
|
+
{
|
|
108
|
+
"role": "system",
|
|
109
|
+
"content": "Extract 3-5 search tags from the text. "
|
|
110
|
+
"Return only a JSON array of strings."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"role": "user",
|
|
114
|
+
"content": content
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
response_format={"type": "json_object"}
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
return json.loads(response.choices[0].message.content)["tags"]
|
|
121
|
+
|
|
122
|
+
# Use it
|
|
123
|
+
cues = extract_cues_with_openai("I love hiking in the mountains")
|
|
124
|
+
client.add("I love hiking in the mountains", cues=cues)
|
|
125
|
+
""")
|
|
126
|
+
|
|
127
|
+
client.close()
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
if __name__ == "__main__":
|
|
131
|
+
main()
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "cuemap"
|
|
7
|
+
version = "0.2.1"
|
|
8
|
+
description = "Redis for AI Agents - High-performance temporal-associative memory"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
keywords = ["ai", "memory", "agents", "redis", "temporal", "associative", "llm", "rag"]
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "CueMap Team", email = "hello@cuemap.dev"}
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
dependencies = [
|
|
31
|
+
"httpx>=0.25.0",
|
|
32
|
+
"pydantic>=2.0.0",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=7.0.0",
|
|
38
|
+
"pytest-asyncio>=0.21.0",
|
|
39
|
+
"build>=1.0.0",
|
|
40
|
+
"twine>=4.0.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/cuemap/cuemap"
|
|
45
|
+
Documentation = "https://github.com/cuemap/cuemap#readme"
|
|
46
|
+
Repository = "https://github.com/cuemap/cuemap"
|
|
47
|
+
Issues = "https://github.com/cuemap/cuemap/issues"
|
|
48
|
+
Docker = "https://hub.docker.com/r/cuemap/engine"
|
cuemap-0.2.0/pyproject.toml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "cuemap"
|
|
7
|
-
version = "0.2.0"
|
|
8
|
-
description = "Redis for AI Agents - High-performance temporal-associative memory"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.8"
|
|
11
|
-
license = {text = "MIT"}
|
|
12
|
-
keywords = ["ai", "memory", "agents", "redis", "temporal"]
|
|
13
|
-
|
|
14
|
-
dependencies = [
|
|
15
|
-
"httpx>=0.25.0",
|
|
16
|
-
"pydantic>=2.0.0",
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
[project.optional-dependencies]
|
|
20
|
-
dev = [
|
|
21
|
-
"pytest>=7.0.0",
|
|
22
|
-
"pytest-asyncio>=0.21.0",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
[project.urls]
|
|
26
|
-
Homepage = "https://cuemap.dev"
|
|
27
|
-
Documentation = "https://docs.cuemap.dev"
|
|
28
|
-
Repository = "https://github.com/cuemap/cuemap"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|