yourmemory 1.4.76__tar.gz → 1.4.77__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.
- {yourmemory-1.4.76 → yourmemory-1.4.77}/PKG-INFO +1 -1
- {yourmemory-1.4.76 → yourmemory-1.4.77}/pyproject.toml +1 -1
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/compact.py +32 -2
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/PKG-INFO +1 -1
- {yourmemory-1.4.76 → yourmemory-1.4.77}/LICENSE +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/README.md +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/memory_mcp.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/setup.cfg +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/__init__.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/app.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/connection.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/duckdb_schema.sql +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/migrate.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/schema.sql +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/sqlite_schema.sql +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/__init__.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/backend.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/graph_store.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/neo4j_backend.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/networkx_backend.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/svo_extract.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/__init__.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_observe.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_recall.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_recall.sh +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_server.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_store.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_user.sh +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/jobs/decay_job.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/__init__.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/agents.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/audit.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/dsar.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/graph_viz.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/memories.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/proxy.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/retrieve.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/ui.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/__init__.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/agent_registry.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/api_keys.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/audit.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/compaction.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/decay.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/embed.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/extract.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/extract_fallback.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/resolve.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/resolve_fallback.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/retrieve.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/session.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/temporal.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/utils.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/tests/test_features.py +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/SOURCES.txt +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/dependency_links.txt +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/entry_points.txt +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/requires.txt +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/top_level.txt +0 -0
- {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory_run.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "yourmemory"
|
|
7
|
-
version = "1.4.
|
|
7
|
+
version = "1.4.77"
|
|
8
8
|
description = "Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -7,7 +7,8 @@ Memory compaction endpoints.
|
|
|
7
7
|
Compaction also runs daily when YOURMEMORY_COMPACTION=1. See src/services/compaction.py.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from threading import Lock
|
|
11
|
+
from fastapi import APIRouter, BackgroundTasks, Query
|
|
11
12
|
from typing import Optional
|
|
12
13
|
|
|
13
14
|
from src.services.compaction import compact_user
|
|
@@ -15,14 +16,43 @@ from src.db.connection import get_backend, get_conn, duckdb_rows
|
|
|
15
16
|
|
|
16
17
|
router = APIRouter()
|
|
17
18
|
|
|
19
|
+
# A full-scan compaction can take minutes on a large store, so it runs in the background
|
|
20
|
+
# by default and the endpoint returns immediately. This guard stops a second request from
|
|
21
|
+
# launching a duplicate run for the same user while one is in flight.
|
|
22
|
+
_running: set = set()
|
|
23
|
+
_running_lock = Lock()
|
|
24
|
+
|
|
18
25
|
|
|
19
26
|
@router.post("/compact")
|
|
20
27
|
def run_compaction(
|
|
28
|
+
background: BackgroundTasks,
|
|
21
29
|
userId: str = Query(..., description="User whose memories to compact"),
|
|
22
30
|
minCluster: Optional[int] = Query(None, ge=2, le=100),
|
|
23
31
|
simThreshold: Optional[float] = Query(None, ge=0.3, le=0.99),
|
|
32
|
+
wait: bool = Query(False, description="Run synchronously and return stats (small stores only)"),
|
|
24
33
|
):
|
|
25
|
-
|
|
34
|
+
uid = userId.strip().lower()
|
|
35
|
+
|
|
36
|
+
# Synchronous mode (opt-in) — returns the full stats; only use on small stores.
|
|
37
|
+
if wait:
|
|
38
|
+
return compact_user(uid, min_cluster=minCluster, sim_threshold=simThreshold)
|
|
39
|
+
|
|
40
|
+
# Default: fire-and-forget. Return immediately; observe via /users/{id}/archive or /audit.
|
|
41
|
+
with _running_lock:
|
|
42
|
+
if uid in _running:
|
|
43
|
+
return {"status": "already_running", "userId": uid}
|
|
44
|
+
_running.add(uid)
|
|
45
|
+
|
|
46
|
+
def _job():
|
|
47
|
+
try:
|
|
48
|
+
compact_user(uid, min_cluster=minCluster, sim_threshold=simThreshold)
|
|
49
|
+
finally:
|
|
50
|
+
with _running_lock:
|
|
51
|
+
_running.discard(uid)
|
|
52
|
+
|
|
53
|
+
background.add_task(_job)
|
|
54
|
+
return {"status": "started", "userId": uid,
|
|
55
|
+
"note": "compaction running in background — check /users/{id}/archive or /audit (operation=compact)"}
|
|
26
56
|
|
|
27
57
|
|
|
28
58
|
@router.get("/users/{user_id}/archive")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|