memocode 0.3.2__tar.gz → 0.3.4__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 (41) hide show
  1. {memocode-0.3.2 → memocode-0.3.4}/PKG-INFO +1 -1
  2. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/memory/core_memory.py +3 -2
  3. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/memory/forgetting.py +1 -4
  4. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/PKG-INFO +1 -1
  5. {memocode-0.3.2 → memocode-0.3.4}/pyproject.toml +1 -1
  6. {memocode-0.3.2 → memocode-0.3.4}/run.py +13 -1
  7. {memocode-0.3.2 → memocode-0.3.4}/README.md +0 -0
  8. {memocode-0.3.2 → memocode-0.3.4}/control/__init__.py +0 -0
  9. {memocode-0.3.2 → memocode-0.3.4}/control/audit.py +0 -0
  10. {memocode-0.3.2 → memocode-0.3.4}/control/brain.py +0 -0
  11. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/__init__.py +0 -0
  12. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/cli.py +0 -0
  13. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/compressor.py +0 -0
  14. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/config.py +0 -0
  15. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/context_manager.py +0 -0
  16. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/mcp_server.py +0 -0
  17. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/memory/__init__.py +0 -0
  18. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/memory/consolidation.py +0 -0
  19. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/memory/recent_memory.py +0 -0
  20. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/server.py +0 -0
  21. {memocode-0.3.2 → memocode-0.3.4}/control/chatmem/token_counter.py +0 -0
  22. {memocode-0.3.2 → memocode-0.3.4}/control/fmt.py +0 -0
  23. {memocode-0.3.2 → memocode-0.3.4}/control/llm.py +0 -0
  24. {memocode-0.3.2 → memocode-0.3.4}/control/planner.py +0 -0
  25. {memocode-0.3.2 → memocode-0.3.4}/control/project_manager.py +0 -0
  26. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/SOURCES.txt +0 -0
  27. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/dependency_links.txt +0 -0
  28. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/entry_points.txt +0 -0
  29. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/requires.txt +0 -0
  30. {memocode-0.3.2 → memocode-0.3.4}/memocode.egg-info/top_level.txt +0 -0
  31. {memocode-0.3.2 → memocode-0.3.4}/safety/__init__.py +0 -0
  32. {memocode-0.3.2 → memocode-0.3.4}/safety/backup.py +0 -0
  33. {memocode-0.3.2 → memocode-0.3.4}/safety/policy.py +0 -0
  34. {memocode-0.3.2 → memocode-0.3.4}/safety/safety.py +0 -0
  35. {memocode-0.3.2 → memocode-0.3.4}/setup.cfg +0 -0
  36. {memocode-0.3.2 → memocode-0.3.4}/tools/__init__.py +0 -0
  37. {memocode-0.3.2 → memocode-0.3.4}/tools/file.py +0 -0
  38. {memocode-0.3.2 → memocode-0.3.4}/tools/loader.py +0 -0
  39. {memocode-0.3.2 → memocode-0.3.4}/tools/registry.py +0 -0
  40. {memocode-0.3.2 → memocode-0.3.4}/tools/shell.py +0 -0
  41. {memocode-0.3.2 → memocode-0.3.4}/tools/web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memocode
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Personal AI coding agent with memory, tool execution, and safety controls
5
5
  Author: AssassinCHN
6
6
  Requires-Python: >=3.11
@@ -159,6 +159,7 @@ class CoreMemory:
159
159
  """
160
160
  dim_stability = self.dimensions[dimension].stability if dimension in self.dimensions else 25.0
161
161
  effective_stability = stability if stability is not None else dim_stability
162
+ max_stability = dim_stability * 2.0
162
163
  now = time.time()
163
164
  with self._conn() as conn:
164
165
  conn.execute(
@@ -167,10 +168,10 @@ class CoreMemory:
167
168
  ON CONFLICT(key) DO UPDATE SET
168
169
  value = excluded.value,
169
170
  dimension = excluded.dimension,
170
- stability = excluded.stability,
171
+ stability = MIN(core_memory.stability * 1.1, ?),
171
172
  score = 1.0,
172
173
  updated_at = excluded.updated_at""",
173
- (key, value, dimension, effective_stability, now, now),
174
+ (key, value, dimension, effective_stability, now, now, max_stability),
174
175
  )
175
176
 
176
177
  def judge_and_update(self, conversation_text: str) -> list[dict]:
@@ -12,7 +12,6 @@ if TYPE_CHECKING:
12
12
 
13
13
 
14
14
  def compute_score(
15
- access_count: int,
16
15
  created_at: float,
17
16
  stability: float,
18
17
  last_accessed_at: float | None = None,
@@ -20,8 +19,7 @@ def compute_score(
20
19
  now = time.time()
21
20
  reference_time = last_accessed_at if last_accessed_at else created_at
22
21
  days_elapsed = (now - reference_time) / 86400.0
23
- score = (access_count + 1) * math.exp(-days_elapsed / stability)
24
- return min(score, 1.0)
22
+ return min(math.exp(-days_elapsed / stability), 1.0)
25
23
 
26
24
 
27
25
  class ForgettingManager:
@@ -37,7 +35,6 @@ class ForgettingManager:
37
35
  entries = self.core.get_all_with_scores()
38
36
  for entry in entries:
39
37
  new_score = compute_score(
40
- access_count=0,
41
38
  created_at=entry["created_at"],
42
39
  stability=entry["stability"],
43
40
  last_accessed_at=entry.get("updated_at"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memocode
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Personal AI coding agent with memory, tool execution, and safety controls
5
5
  Author: AssassinCHN
6
6
  Requires-Python: >=3.11
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "memocode"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "Personal AI coding agent with memory, tool execution, and safety controls"
9
9
  readme = "README.md"
10
10
  authors = [{name = "AssassinCHN"}]
@@ -1112,7 +1112,19 @@ def main():
1112
1112
  logging.getLogger("chatmem").addHandler(_log_handler)
1113
1113
  logging.getLogger("chatmem").setLevel(logging.INFO)
1114
1114
 
1115
- brain = Brain(verbose=args.verbose or None, project=args.project or None)
1115
+ try:
1116
+ brain = Brain(verbose=args.verbose or None, project=args.project or None)
1117
+ except RuntimeError as e:
1118
+ from control.fmt import yellow, dim
1119
+ print(yellow(f"\n ✗ {e}"))
1120
+ print()
1121
+ print(" Quick setup:")
1122
+ print(" 1. Edit ~/.mcode/agent.json and set 'active_model'")
1123
+ print(" 2. Add your model config under 'models' (see README for examples)")
1124
+ print(" 3. Export the required API key, e.g.:")
1125
+ print(dim(" export MINIMAX_API_KEY=your_key_here"))
1126
+ print()
1127
+ raise SystemExit(1)
1116
1128
  verbose = brain.verbose
1117
1129
  session = _make_session(brain)
1118
1130
 
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