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.
Files changed (60) hide show
  1. {yourmemory-1.4.76 → yourmemory-1.4.77}/PKG-INFO +1 -1
  2. {yourmemory-1.4.76 → yourmemory-1.4.77}/pyproject.toml +1 -1
  3. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/compact.py +32 -2
  4. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/PKG-INFO +1 -1
  5. {yourmemory-1.4.76 → yourmemory-1.4.77}/LICENSE +0 -0
  6. {yourmemory-1.4.76 → yourmemory-1.4.77}/README.md +0 -0
  7. {yourmemory-1.4.76 → yourmemory-1.4.77}/memory_mcp.py +0 -0
  8. {yourmemory-1.4.76 → yourmemory-1.4.77}/setup.cfg +0 -0
  9. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/__init__.py +0 -0
  10. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/app.py +0 -0
  11. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/connection.py +0 -0
  12. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/duckdb_schema.sql +0 -0
  13. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/migrate.py +0 -0
  14. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/schema.sql +0 -0
  15. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/db/sqlite_schema.sql +0 -0
  16. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/__init__.py +0 -0
  17. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/backend.py +0 -0
  18. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/graph_store.py +0 -0
  19. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/neo4j_backend.py +0 -0
  20. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/networkx_backend.py +0 -0
  21. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/graph/svo_extract.py +0 -0
  22. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/__init__.py +0 -0
  23. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_observe.py +0 -0
  24. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_recall.py +0 -0
  25. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_recall.sh +0 -0
  26. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_server.py +0 -0
  27. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_store.py +0 -0
  28. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/hook_templates/yourmemory_user.sh +0 -0
  29. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/jobs/decay_job.py +0 -0
  30. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/__init__.py +0 -0
  31. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/agents.py +0 -0
  32. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/audit.py +0 -0
  33. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/dsar.py +0 -0
  34. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/graph_viz.py +0 -0
  35. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/memories.py +0 -0
  36. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/proxy.py +0 -0
  37. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/retrieve.py +0 -0
  38. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/routes/ui.py +0 -0
  39. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/__init__.py +0 -0
  40. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/agent_registry.py +0 -0
  41. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/api_keys.py +0 -0
  42. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/audit.py +0 -0
  43. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/compaction.py +0 -0
  44. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/decay.py +0 -0
  45. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/embed.py +0 -0
  46. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/extract.py +0 -0
  47. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/extract_fallback.py +0 -0
  48. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/resolve.py +0 -0
  49. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/resolve_fallback.py +0 -0
  50. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/retrieve.py +0 -0
  51. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/session.py +0 -0
  52. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/temporal.py +0 -0
  53. {yourmemory-1.4.76 → yourmemory-1.4.77}/src/services/utils.py +0 -0
  54. {yourmemory-1.4.76 → yourmemory-1.4.77}/tests/test_features.py +0 -0
  55. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/SOURCES.txt +0 -0
  56. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/dependency_links.txt +0 -0
  57. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/entry_points.txt +0 -0
  58. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/requires.txt +0 -0
  59. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory.egg-info/top_level.txt +0 -0
  60. {yourmemory-1.4.76 → yourmemory-1.4.77}/yourmemory_run.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yourmemory
3
- Version: 1.4.76
3
+ Version: 1.4.77
4
4
  Summary: Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native
5
5
  Author: Sachit Misra
6
6
  Author-email: mishrasachit1@gmail.com
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "yourmemory"
7
- version = "1.4.76"
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 fastapi import APIRouter, Query
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
- return compact_user(userId, min_cluster=minCluster, sim_threshold=simThreshold)
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yourmemory
3
- Version: 1.4.76
3
+ Version: 1.4.77
4
4
  Summary: Persistent memory for Claude — Ebbinghaus forgetting curve, semantic deduplication, MCP-native
5
5
  Author: Sachit Misra
6
6
  Author-email: mishrasachit1@gmail.com
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes