ltcai 6.4.0 → 6.5.0

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.
@@ -19,7 +19,7 @@ from datetime import datetime
19
19
  from typing import Any, Callable, Dict, List, Optional
20
20
 
21
21
 
22
- MULTI_AGENT_VERSION = "6.4.0"
22
+ MULTI_AGENT_VERSION = "6.5.0"
23
23
 
24
24
  AGENT_ROLES = ("researcher", "planner", "executor", "reviewer", "release")
25
25
  CORE_PIPELINE = ("planner", "executor", "reviewer")
@@ -1,3 +1,3 @@
1
1
  """Lattice AI - modular server package."""
2
2
 
3
- __version__ = "6.4.0"
3
+ __version__ = "6.5.0"
@@ -51,6 +51,12 @@ def create_memory_router(
51
51
  scope = gate_read(request)
52
52
  return service.manager(user_email=user, workspace_id=scope)
53
53
 
54
+ @router.get("/api/memory/brain-quality")
55
+ async def brain_quality_summary(request: Request):
56
+ user = require_user(request)
57
+ scope = gate_read(request)
58
+ return service.brain_quality_summary(user_email=user, workspace_id=scope)
59
+
54
60
  @router.get("/api/memory/tiers")
55
61
  async def memory_tiers(request: Request):
56
62
  require_user(request)
@@ -11,7 +11,7 @@ from copy import deepcopy
11
11
  from typing import Any, Dict, List, Optional
12
12
 
13
13
 
14
- MARKETPLACE_VERSION = "6.4.0"
14
+ MARKETPLACE_VERSION = "6.5.0"
15
15
  TEMPLATE_KINDS = ("plugin", "workflow", "agent")
16
16
 
17
17
 
@@ -19,7 +19,7 @@ from pathlib import Path
19
19
  from typing import Any, Callable, Dict, Iterable, List, Optional
20
20
 
21
21
 
22
- WORKSPACE_OS_VERSION = "6.4.0"
22
+ WORKSPACE_OS_VERSION = "6.5.0"
23
23
 
24
24
  # Workspace types separate single-user Personal workspaces from shared
25
25
  # Organization workspaces. Both keep the same local-first JSON store; the type
@@ -132,6 +132,60 @@ class MemoryService:
132
132
  return None
133
133
 
134
134
  # ── Memory Manager: sources / usage / health ──────────────────────────
135
+ def _brain_readiness(
136
+ self,
137
+ *,
138
+ memory_count: int,
139
+ concept_count: Optional[int],
140
+ relationship_count: Optional[int],
141
+ healthy_sources: int,
142
+ ) -> Dict[str, Any]:
143
+ """Summarize how ready the user's Brain is for the product UI.
144
+
145
+ The frontend should render this signal instead of re-deriving it from
146
+ UI fragments. Keeping it here makes the score auditable and keeps the
147
+ Memory Manager as the single owner of cross-tier Brain growth signals.
148
+ """
149
+ concepts = max(0, int(concept_count or 0))
150
+ relationships = max(0, int(relationship_count or 0))
151
+ memories = max(0, int(memory_count or 0))
152
+ healthy = max(0, int(healthy_sources or 0))
153
+ score = min(100, round(memories * 12 + concepts * 8 + relationships * 4 + healthy * 3))
154
+
155
+ if memories < 1 and concepts < 1:
156
+ state = "quiet"
157
+ depth = 2
158
+ title_key = "brain.readiness.quiet"
159
+ action_key = "brain.readiness.start"
160
+ score = max(12, score)
161
+ elif concepts < 3 or relationships < 2:
162
+ state = "forming"
163
+ depth = 3 if concepts < 3 else 4
164
+ title_key = "brain.readiness.forming"
165
+ action_key = "brain.readiness.grow"
166
+ score = max(38, score)
167
+ else:
168
+ state = "alive"
169
+ depth = 5
170
+ title_key = "brain.readiness.alive"
171
+ action_key = "brain.readiness.map"
172
+ score = max(72, score)
173
+
174
+ return {
175
+ "score": score,
176
+ "state": state,
177
+ "depth": depth,
178
+ "title_key": title_key,
179
+ "action_key": action_key,
180
+ "signals": {
181
+ "memory_count": memories,
182
+ "concept_count": concepts,
183
+ "relationship_count": relationships,
184
+ "healthy_sources": healthy,
185
+ },
186
+ "source": "memory_service",
187
+ }
188
+
135
189
  def manager(self, *, user_email: Optional[str] = None, workspace_id: Optional[str] = None) -> Dict[str, Any]:
136
190
  ws_mem = self._workspace_memories(user_email=user_email, workspace_id=workspace_id or "personal")
137
191
  if workspace_id is None:
@@ -198,15 +252,27 @@ class MemoryService:
198
252
  total_bytes = ws_bytes + kg_bytes + conv_bytes
199
253
  healthy = sum(1 for s in sources if s["health"] == "ok")
200
254
  overall = "ok" if healthy >= 4 else "degraded" if healthy >= 1 else "unavailable"
255
+ memory_ids = {m.get("id") for m in [*ws_mem, *project_mem] if m.get("id")}
256
+ memory_count = len(memory_ids) + len(snaps) + len(convs)
201
257
  return {
202
258
  "sources": sources,
203
259
  "tiers": list(TIERS),
204
260
  "usage": {"total_items": total_items, "total_bytes": total_bytes, "sources": len(sources)},
261
+ "brain_readiness": self._brain_readiness(
262
+ memory_count=memory_count,
263
+ concept_count=node_total,
264
+ relationship_count=edge_total,
265
+ healthy_sources=healthy,
266
+ ),
205
267
  "health": overall,
206
268
  "graph_enabled": self._enable_graph,
207
269
  "generated_at": _now(),
208
270
  }
209
271
 
272
+ def brain_quality_summary(self, *, user_email: Optional[str] = None, workspace_id: Optional[str] = None) -> Dict[str, Any]:
273
+ """Return the backend-owned Brain readiness signal for API consumers."""
274
+ return self.manager(user_email=user_email, workspace_id=workspace_id)["brain_readiness"]
275
+
210
276
  def tiers(self) -> Dict[str, Any]:
211
277
  return {"tiers": list(TIERS), "workspace_kinds": list(WORKSPACE_KINDS)}
212
278
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ltcai",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "description": "Lattice AI — local-first Digital Brain that keeps your knowledge durable across any AI model.",
5
5
  "homepage": "https://github.com/TaeSooPark-PTS/LatticeAI#readme",
6
6
  "repository": {
@@ -1654,7 +1654,7 @@ dependencies = [
1654
1654
 
1655
1655
  [[package]]
1656
1656
  name = "lattice-ai-desktop"
1657
- version = "6.4.0"
1657
+ version = "6.5.0"
1658
1658
  dependencies = [
1659
1659
  "plist",
1660
1660
  "serde",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "lattice-ai-desktop"
3
- version = "6.4.0"
3
+ version = "6.5.0"
4
4
  description = "Lattice AI Digital Brain desktop shell"
5
5
  authors = ["TaeSoo Park"]
6
6
  edition = "2021"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://schema.tauri.app/config/2",
3
3
  "productName": "Lattice AI",
4
- "version": "6.4.0",
4
+ "version": "6.5.0",
5
5
  "identifier": "ai.lattice.desktop",
6
6
  "build": {
7
7
  "beforeDevCommand": "npm run frontend:dev",
@@ -1,13 +1,13 @@
1
1
  {
2
- "version": "6.4.0",
2
+ "version": "6.5.0",
3
3
  "generated_at": "vite",
4
4
  "entrypoints": {
5
5
  "app": "/static/app/index.html"
6
6
  },
7
7
  "assets": {
8
8
  "../node_modules/@tauri-apps/api/core.js": "/static/app/assets/core-CwxXejkd.js",
9
- "index.html": "/static/app/assets/index-t1jx1BR9.js",
10
- "assets/index-Div5vMlq.css": "/static/app/assets/index-Div5vMlq.css"
9
+ "index.html": "/static/app/assets/index-C1J_1441.js",
10
+ "assets/index-CdCVz_i4.css": "/static/app/assets/index-CdCVz_i4.css"
11
11
  },
12
12
  "vite": {
13
13
  "../node_modules/@tauri-apps/api/core.js": {
@@ -17,7 +17,7 @@
17
17
  "isDynamicEntry": true
18
18
  },
19
19
  "index.html": {
20
- "file": "assets/index-t1jx1BR9.js",
20
+ "file": "assets/index-C1J_1441.js",
21
21
  "name": "index",
22
22
  "src": "index.html",
23
23
  "isEntry": true,
@@ -25,7 +25,7 @@
25
25
  "../node_modules/@tauri-apps/api/core.js"
26
26
  ],
27
27
  "css": [
28
- "assets/index-Div5vMlq.css"
28
+ "assets/index-CdCVz_i4.css"
29
29
  ]
30
30
  }
31
31
  }