ltcai 2.2.7 → 3.1.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.
Files changed (122) hide show
  1. package/README.md +72 -34
  2. package/docs/CHANGELOG.md +119 -0
  3. package/docs/V3_BACKEND_ARCHITECTURE.md +138 -0
  4. package/docs/V3_FRONTEND.md +139 -0
  5. package/knowledge_graph.py +649 -21
  6. package/latticeai/__init__.py +1 -1
  7. package/latticeai/api/admin.py +47 -0
  8. package/latticeai/api/agents.py +54 -31
  9. package/latticeai/api/auth.py +5 -2
  10. package/latticeai/api/chat.py +10 -2
  11. package/latticeai/api/search.py +240 -0
  12. package/latticeai/api/static_routes.py +11 -2
  13. package/latticeai/core/config.py +18 -0
  14. package/latticeai/core/embedding_providers.py +625 -0
  15. package/latticeai/core/local_embeddings.py +86 -0
  16. package/latticeai/core/workspace_os.py +1 -1
  17. package/latticeai/server_app.py +65 -1
  18. package/latticeai/services/agent_runtime.py +245 -0
  19. package/latticeai/services/search_service.py +346 -0
  20. package/package.json +13 -6
  21. package/scripts/build_v3_assets.mjs +164 -0
  22. package/scripts/capture/README.md +28 -0
  23. package/scripts/capture/capture_enterprise.js +8 -0
  24. package/scripts/capture/capture_graph.js +8 -0
  25. package/scripts/capture/capture_onboarding.js +8 -0
  26. package/scripts/capture/capture_page.js +43 -0
  27. package/scripts/capture/capture_release_media.js +125 -0
  28. package/scripts/capture/capture_skills.js +8 -0
  29. package/scripts/capture/capture_workspace.js +8 -0
  30. package/scripts/generate_diagrams.py +513 -0
  31. package/scripts/lint_v3.mjs +33 -0
  32. package/scripts/release-0.3.1.sh +105 -0
  33. package/scripts/take_screenshots.js +69 -0
  34. package/scripts/validate_release_artifacts.py +167 -0
  35. package/static/account.html +9 -9
  36. package/static/activity.html +4 -4
  37. package/static/admin.html +8 -8
  38. package/static/agents.html +4 -4
  39. package/static/chat.html +10 -10
  40. package/static/css/reference/account.css +137 -1
  41. package/static/css/reference/chat.css +31 -37
  42. package/static/css/responsive.css +42 -0
  43. package/static/css/tokens.5a595671.css +260 -0
  44. package/static/css/tokens.css +125 -130
  45. package/static/graph.html +9 -9
  46. package/static/manifest.json +3 -3
  47. package/static/plugins.html +4 -4
  48. package/static/scripts/account.js +4 -4
  49. package/static/scripts/chat.js +40 -8
  50. package/static/scripts/workspace.js +78 -0
  51. package/static/sw.js +3 -1
  52. package/static/v3/asset-manifest.json +47 -0
  53. package/static/v3/css/lattice.base.css +128 -0
  54. package/static/v3/css/lattice.base.e4cdd05d.css +128 -0
  55. package/static/v3/css/lattice.components.011e988b.css +447 -0
  56. package/static/v3/css/lattice.components.css +447 -0
  57. package/static/v3/css/lattice.shell.4920f42d.css +407 -0
  58. package/static/v3/css/lattice.shell.css +407 -0
  59. package/static/v3/css/lattice.tokens.c597ff81.css +132 -0
  60. package/static/v3/css/lattice.tokens.css +132 -0
  61. package/static/v3/css/lattice.views.3ee19d4e.css +277 -0
  62. package/static/v3/css/lattice.views.css +277 -0
  63. package/static/v3/index.html +69 -0
  64. package/static/v3/js/app.46fb61d9.js +26 -0
  65. package/static/v3/js/app.js +26 -0
  66. package/static/v3/js/core/api.22a41d42.js +344 -0
  67. package/static/v3/js/core/api.js +344 -0
  68. package/static/v3/js/core/components.4c83e0a9.js +222 -0
  69. package/static/v3/js/core/components.js +222 -0
  70. package/static/v3/js/core/dom.a2773eb0.js +148 -0
  71. package/static/v3/js/core/dom.js +148 -0
  72. package/static/v3/js/core/router.584570f2.js +37 -0
  73. package/static/v3/js/core/router.js +37 -0
  74. package/static/v3/js/core/routes.f935dd50.js +78 -0
  75. package/static/v3/js/core/routes.js +78 -0
  76. package/static/v3/js/core/shell.1b6199d6.js +363 -0
  77. package/static/v3/js/core/shell.js +363 -0
  78. package/static/v3/js/core/store.34ebd5e6.js +113 -0
  79. package/static/v3/js/core/store.js +113 -0
  80. package/static/v3/js/views/admin-audit.660a1fb1.js +185 -0
  81. package/static/v3/js/views/admin-audit.js +185 -0
  82. package/static/v3/js/views/admin-permissions.a7ae5f09.js +177 -0
  83. package/static/v3/js/views/admin-permissions.js +177 -0
  84. package/static/v3/js/views/admin-policies.3658fd86.js +102 -0
  85. package/static/v3/js/views/admin-policies.js +102 -0
  86. package/static/v3/js/views/admin-private-vpc.7d342d36.js +135 -0
  87. package/static/v3/js/views/admin-private-vpc.js +135 -0
  88. package/static/v3/js/views/admin-security.07c66b72.js +180 -0
  89. package/static/v3/js/views/admin-security.js +180 -0
  90. package/static/v3/js/views/admin-users.03bac88c.js +168 -0
  91. package/static/v3/js/views/admin-users.js +168 -0
  92. package/static/v3/js/views/agents.14e48bdd.js +193 -0
  93. package/static/v3/js/views/agents.js +193 -0
  94. package/static/v3/js/views/chat.718144ce.js +449 -0
  95. package/static/v3/js/views/chat.js +449 -0
  96. package/static/v3/js/views/files.4935197e.js +186 -0
  97. package/static/v3/js/views/files.js +186 -0
  98. package/static/v3/js/views/home.cdde3b32.js +119 -0
  99. package/static/v3/js/views/home.js +119 -0
  100. package/static/v3/js/views/hybrid-search.b22b97e0.js +195 -0
  101. package/static/v3/js/views/hybrid-search.js +195 -0
  102. package/static/v3/js/views/knowledge-graph.a14ea7e7.js +237 -0
  103. package/static/v3/js/views/knowledge-graph.js +237 -0
  104. package/static/v3/js/views/models.a1ffa147.js +256 -0
  105. package/static/v3/js/views/models.js +256 -0
  106. package/static/v3/js/views/my-computer.1b2ff621.js +237 -0
  107. package/static/v3/js/views/my-computer.js +237 -0
  108. package/static/v3/js/views/pipeline.c522f1ce.js +157 -0
  109. package/static/v3/js/views/pipeline.js +157 -0
  110. package/static/v3/js/views/settings.4f777210.js +250 -0
  111. package/static/v3/js/views/settings.js +250 -0
  112. package/static/workflows.html +4 -4
  113. package/static/workspace.css +340 -2
  114. package/static/workspace.html +43 -24
  115. package/docs/images/tmp_frames/frame_00.png +0 -0
  116. package/docs/images/tmp_frames/frame_01.png +0 -0
  117. package/docs/images/tmp_frames/frame_02.png +0 -0
  118. package/docs/images/tmp_frames/frame_03.png +0 -0
  119. package/docs/images/tmp_frames/hero_00.png +0 -0
  120. package/docs/images/tmp_frames/hero_01.png +0 -0
  121. package/docs/images/tmp_frames/hero_02.png +0 -0
  122. package/docs/images/tmp_frames/hero_03.png +0 -0
package/README.md CHANGED
@@ -3,10 +3,11 @@
3
3
 
4
4
  # Lattice AI
5
5
 
6
- **Local-first AI workspace for knowledge graphs, AI pipelines, and multi-agent coding workflows.**
6
+ **Lattice AI v3 Local-First AI Workspace Platform.**
7
7
 
8
- Plan, execute, review, and remember work across local models, cloud models,
9
- files, and team workflows.
8
+ Work across Personal and Organization workspaces with Knowledge Graph,
9
+ Vector Index, Hybrid Search, Native Chat, agents, files, models, and
10
+ Basic / Advanced / Admin modes.
10
11
  </div>
11
12
 
12
13
  <div align="center">
@@ -15,7 +16,7 @@
15
16
  [![npm version](https://img.shields.io/npm/v/ltcai?label=npm)](https://www.npmjs.com/package/ltcai)
16
17
  [![VS Code Marketplace](https://vsmarketplacebadges.dev/version-short/parktaesoo.ltcai.svg)](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
17
18
  [![Open VSX](https://img.shields.io/open-vsx/v/parktaesoo/ltcai?label=Open%20VSX)](https://open-vsx.org/extension/parktaesoo/ltcai)
18
- [![GitHub release](https://img.shields.io/github/v/release/TaeSooPark-PTS/LatticeAI?label=GitHub%20release)](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v2.2.7)
19
+ [![GitHub release](https://img.shields.io/github/v/release/TaeSooPark-PTS/LatticeAI?label=GitHub%20release)](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v3.1.0)
19
20
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
20
21
  [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/)
21
22
  [![VS Code extension](https://img.shields.io/badge/VS%20Code-extension-blue?logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
@@ -48,7 +49,7 @@ Install the coding extension:
48
49
 
49
50
  - [VS Code Marketplace: parktaesoo.ltcai](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
50
51
  - [Open VSX: parktaesoo.ltcai](https://open-vsx.org/extension/parktaesoo/ltcai)
51
- - [GitHub Release v2.2.7](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v2.2.7)
52
+ - [GitHub Release v3.1.0](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v3.1.0)
52
53
 
53
54
  ## Quick Start
54
55
 
@@ -61,7 +62,7 @@ LTCAI
61
62
  Then open:
62
63
 
63
64
  ```text
64
- http://127.0.0.1:4825
65
+ http://127.0.0.1:4825/app
65
66
  ```
66
67
 
67
68
  Development checkout:
@@ -81,9 +82,14 @@ npm run build
81
82
 
82
83
  ## What Is Lattice AI?
83
84
 
84
- Lattice AI is a local-first AI workspace for people and teams who want their
85
- files, models, graph context, and agent workflows in one place.
85
+ Lattice AI v3 is a local-first AI workspace platform for people and teams who
86
+ want their files, models, graph context, retrieval, and agent workflows in one
87
+ place.
86
88
 
89
+ - **Primary app shell**: `/app` is the default product experience with Native
90
+ Chat, Knowledge Graph, Hybrid Search, Files, Pipeline, Agents, Models, My
91
+ Computer, Settings, and Admin areas. Classic pages remain compatibility
92
+ routes only; normal workflows stay in `/app`.
87
93
  - **Local-first AI Workspace**: work starts on your machine, with local data and
88
94
  workspace state by default.
89
95
  - **AI Pipeline Platform**: plan, execute, review, retry, and replay work across
@@ -94,11 +100,13 @@ files, models, graph context, and agent workflows in one place.
94
100
  - **Multi-Agent Workflow Platform**: agents hand off structured context, review
95
101
  work, retry with reasons, and keep timelines inspectable.
96
102
  - **Personal / Organization Workspace**: move between personal work and team
97
- workspaces with role-aware views.
103
+ workspaces with role-aware views and Basic / Advanced / Admin modes.
104
+ - **Vector Index and Hybrid Search**: local vector rows are derived from the
105
+ Knowledge Graph and fused with keyword and graph signals.
98
106
  - **Local Model Management**: choose current multimodal local models with source
99
107
  disclosure, hardware-aware recommendations, and cloud fallback options.
100
- - **SSO for teams**: organization workspaces can be paired with Okta or
101
- Microsoft Entra ID patterns for team access.
108
+ - **Community-first workspaces**: Personal and Organization workspaces ship in
109
+ the local product; enterprise SSO/SCIM/governance remain future extensions.
102
110
 
103
111
  ## Why Lattice AI?
104
112
 
@@ -114,28 +122,30 @@ and disconnected automations. Lattice AI keeps those parts together:
114
122
  - multi-agent workflows leave behind replayable plans, reviews, retries, and
115
123
  outcomes.
116
124
 
117
- ## v2.2.7 Visual Stabilization Highlights
118
-
119
- Lattice AI v2.2.7 is a visual stabilization release driven by rendered browser
120
- screens, not stylesheet cleanup alone. It keeps the existing design-token
121
- structure while making the app feel like one cohesive product.
122
-
123
- - The dark chat composer is now an intentional dark surface with a crisp outer
124
- focus state, no white haze, and no legacy inner textarea box.
125
- - Knowledge Graph canvas and Workspace OS panels no longer fall back to
126
- washed-out light surfaces in dark mode.
127
- - Workspace select, onboarding, recommendation, auto setup, mode select,
128
- pipeline, My Computer, profile, settings, VPC, and model-state surfaces use a
129
- shared modal/panel language.
130
- - Static frontend asset cache-busting is normalized to `?v=2.2.7`, including
131
- `/static/scripts/chat.js?v=2.2.7`.
132
- - Playwright visual coverage now locks the v2.2.7 composer, graph canvas,
133
- Workspace OS dark inputs/cards, and mobile composer behavior.
134
-
135
- Carried forward from v2.2.x: mobile-first responsive layout, design-token
136
- light/dark themes, keyboard-safe chat composer, Knowledge Graph responsive UX,
137
- Admin mobile card layout, drag-and-drop file attachment, and model-card source
138
- disclosure.
125
+ ## v3.1.0 Highlights
126
+
127
+ Lattice AI v3.1.0 completes the non-enterprise local-first workspace platform
128
+ around `/app`: Classic is retired from normal workflows, retrieval is wired
129
+ through a shared service layer, and browser assets are hash-manifested.
130
+
131
+ - Native v3 Chat lives inside `/app#/chat` and streams through the real
132
+ `POST /chat` backend while showing friendly setup guidance when no model is
133
+ loaded.
134
+ - Knowledge Graph, Vector Index, and Hybrid Search are first-class retrieval
135
+ surfaces. Hybrid results show keyword, local vector, and graph scores.
136
+ - Personal and Organization workspaces, plus Basic / Advanced / Admin modes,
137
+ are built into the shell.
138
+ - Models can load/unload from the native Models view; Agents read the
139
+ AgentRuntime boundary with run health, history, events, replay, and stop
140
+ affordances.
141
+ - Production embedding profiles cover local `bge-m3`, `nomic-embed-text`,
142
+ `e5-large`, `gte-large`, Ollama `nomic-embed-text`, `mxbai-embed-large`,
143
+ BGE-M3-compatible providers, MLX, and OpenAI-compatible
144
+ `text-embedding-3-small` / `text-embedding-3-large`. Hash embeddings remain
145
+ fallback only.
146
+ - `/app` loads `static/v3/asset-manifest.json` and build-generated hashed
147
+ assets such as `app.<hash>.js` and `lattice.base.<hash>.css`; manual `?v=`
148
+ cache-busting is no longer used by runtime HTML.
139
149
 
140
150
  ## Screenshots
141
151
 
@@ -175,6 +185,31 @@ files / documents / images / screenshots / conversations / decisions
175
185
 
176
186
  The graph keeps useful workspace context available even when you change models.
177
187
 
188
+ ## v3 Backend Retrieval
189
+
190
+ The v3 backend adds a local-first retrieval stack that combines the Knowledge
191
+ Graph, a SQLite vector index, and hybrid result fusion. It preserves existing
192
+ graph data while adding derived vector rows that can be rebuilt at any time.
193
+
194
+ Embedding status: production profiles are exposed through
195
+ `GET /api/embeddings/providers`, while `lattice-local-hash-v1` remains a
196
+ deterministic fallback for offline indexing and tests. It is never presented as
197
+ a production semantic embedding model.
198
+
199
+ Core API contracts:
200
+
201
+ - `POST /api/search/hybrid`
202
+ - `GET /api/search/keyword?q=...`
203
+ - `GET /api/search/vector?q=...`
204
+ - `GET /api/graph`
205
+ - `GET /api/graph/node?node_id=...`
206
+ - `GET /api/graph/relationship`
207
+ - `GET /api/index/status`
208
+ - `POST /api/index/rebuild`
209
+
210
+ See [docs/V3_BACKEND_ARCHITECTURE.md](docs/V3_BACKEND_ARCHITECTURE.md) for the
211
+ storage model, search model, migration behavior, and API response shape.
212
+
178
213
  ## Local Model Policy
179
214
 
180
215
  Lattice AI recommends current-generation multimodal models for local use and
@@ -230,7 +265,10 @@ Core areas:
230
265
 
231
266
  | Version | Theme |
232
267
  | --- | --- |
233
- | **2.2.7** | Visual system stabilizationcohesive dark/light screens, crisp chat composer, dark graph canvas, Workspace OS polish |
268
+ | **3.1.0** | Mainline platform completionnative `/app` workflows, Classic retired from normal paths, production embedding profiles, AgentRuntime/registries, hashed v3 assets |
269
+ | 3.0.1 | Release-blocker remediation — provider-backed embeddings (Hash/MLX/Ollama/OpenAI/Custom), unified AgentRuntime boundary, every v3 surface connected or clearly unavailable |
270
+ | 3.0.0 | v3 local-first AI workspace platform — `/app`, Native Chat, Knowledge Graph, Vector Index, Hybrid Search, workspace modes |
271
+ | 2.2.7 | Visual system stabilization — cohesive dark/light screens, crisp chat composer, dark graph canvas, Workspace OS polish |
234
272
  | 2.2.6 | Token-native CSS foundation |
235
273
  | 2.2.5 | Release hygiene hotfix — dark overlays, modal stack, cache-busting, favicon, and Telegram log masking |
236
274
  | 2.2.4 | Chat dark-mode completion |
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,124 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.0] - 2026-06-07
4
+
5
+ > v3.1 — Mainline Product Platform Completion. `/app` is now the full
6
+ > non-enterprise local-first workspace: Classic pages are compatibility routes,
7
+ > production embedding profiles are explicit, AgentRuntime and registries are
8
+ > the integration boundaries, and v3 runtime assets are hash-manifested.
9
+
10
+ ### Added
11
+
12
+ - **Hashed asset pipeline** — `npm run build:assets` writes
13
+ `static/v3/asset-manifest.json`, hashed CSS/JS siblings, and import-rewritten
14
+ ES modules. `/app` reads the manifest and loads hashed assets automatically.
15
+ - **Production embedding profiles** — local `bge-m3`, `nomic-embed-text`,
16
+ `e5-large`, `gte-large`; Ollama `nomic-embed-text`, `mxbai-embed-large`,
17
+ BGE-M3-compatible providers; MLX Apple Silicon profiles; and
18
+ OpenAI-compatible `text-embedding-3-small` / `text-embedding-3-large`.
19
+ - **Native model lifecycle controls** — `/app#/models` now calls the real
20
+ `/models/load` and `/models/unload/{model_id}` endpoints.
21
+
22
+ ### Changed
23
+
24
+ - **Classic retirement** — normal user workflows no longer link to Classic
25
+ Chat, Classic Runtime, or Classic Admin. Compatibility routes remain available
26
+ for rollback/debug.
27
+ - **Truthful unavailable states** — v3 fallback adapters return empty
28
+ unavailable payloads instead of sample data, fake counters, or fabricated
29
+ health.
30
+ - **Release metadata** — package, npm, VS Code extension, Workspace OS, docs,
31
+ and expected artifacts are aligned at `3.1.0`.
32
+
33
+ ### Validation
34
+
35
+ - Release target: `npm run lint`, `npm run typecheck`, `npm run check:python`,
36
+ backend/integration tests, Playwright visual tests, `python -m build`,
37
+ `npm run build`, `npm pack`, VSIX package, and exact-version artifact
38
+ validation.
39
+
40
+ ## [3.0.0] - 2026-06-07
41
+
42
+ > v3 — Local-first AI Workspace Platform. The hybrid-search
43
+ > backend and the token-native `/app` workspace shell now ship together: the
44
+ > shell's adapters call the real v3 retrieval APIs, and Chat is a first-class
45
+ > native view (no link-out to the legacy page). Legacy `/chat` remains available
46
+ > as a rollback/debug path.
47
+
48
+ ### Added — Backend retrieval
49
+
50
+ - **Hybrid search API** — added `/api/search/hybrid`, `/api/search/keyword`,
51
+ `/api/search/vector`, `/api/graph`, `/api/graph/node`,
52
+ `/api/graph/relationship`, `/api/index/status`, and `/api/index/rebuild`.
53
+ - **SQLite vector index** — added local deterministic embeddings,
54
+ `vector_embeddings`, and `vector_index_operations` for incremental indexing,
55
+ rebuilds, and status monitoring.
56
+ - **Embedding status** — the default `lattice-local-hash-v1` embedder is a
57
+ deterministic local fallback, not a production semantic embedding model.
58
+ Future providers may include Ollama, MLX, OpenAI-compatible providers, and
59
+ other local embedding runtimes.
60
+ - **Graph retrieval helpers** — added node lookup, relationship search, bounded
61
+ traversal, neighbor expansion, and service-level result fusion.
62
+ - **Backend architecture doc** — added `docs/V3_BACKEND_ARCHITECTURE.md` with
63
+ storage, search, API, and migration details.
64
+
65
+ ### Added — Native app shell (`/app`)
66
+
67
+ - **Unified app shell** (`static/v3/`) — nav rail, command palette (⌘K),
68
+ workspace switcher (Personal/Organization), and mode switcher
69
+ (Basic/Advanced/Admin); hash-routed views for every primary and admin area
70
+ (Home, Chat, Knowledge Graph, Hybrid Search, Files, Pipeline, Agents, Models,
71
+ My Computer, Settings, and Admin · Users/Permissions/Audit/Security/Policies/
72
+ Private VPC).
73
+ - **Native Chat view** — a first-class 3-pane chat (conversations · thread ·
74
+ retrieval context) wired to the real backend (`POST /chat` SSE + `/history/*`)
75
+ with streaming, empty/error/loading states; surfaces Knowledge Graph, Vector,
76
+ Hybrid Search, and indexed-file context per answer. The legacy `/chat` page
77
+ stays reachable but is no longer the primary chat experience.
78
+ - **Primary entry behavior** — `/app` is the product entry after login and SSO;
79
+ the PWA manifest starts at `/app`.
80
+ - **Retrieval identity** — Knowledge Graph + Vector Index + Hybrid Search are
81
+ surfaced as a first-class "retrieval lattice" on Home and a live index chip.
82
+ - **Token-native design system** — `static/v3/css/lattice.*.css` built on top of
83
+ `tokens.css` with no dependency on the legacy override layers; full light/dark
84
+ and desktop/tablet/mobile support.
85
+ - **Integration adapters** — `static/v3/js/core/api.js` calls the real v3
86
+ endpoints and degrades to clearly-badged sample data; no backend logic in the UI.
87
+
88
+ ### Validation
89
+
90
+ - Backend coverage includes v3 indexing, migration status, vector retrieval,
91
+ graph relationship traversal, hybrid result fusion, and API contract tests.
92
+ - Frontend coverage: `tests/visual/v3.spec.js` and `scripts/lint_v3.mjs` (wired
93
+ into `npm run lint`); see `docs/V3_FRONTEND.md` for IA + design decisions.
94
+ - Release preparation builds exact `3.0.0` Python, npm, and VSIX artifacts.
95
+ Package-store publication remains manual and is not triggered by pushing the
96
+ release tag.
97
+
98
+ > Frontend Product Shell Redesign — workspace navigation, auth entry, and shared
99
+ > product surfaces were realigned around the local-first AI workspace model
100
+ > without changing backend contracts.
101
+
102
+ ### Changed
103
+
104
+ - **Workspace IA** — the workspace shell now separates primary user workflows,
105
+ admin controls, and runtime tooling, with Basic, Advanced, and Admin modes.
106
+ - **Navigation** — Chat and Workspace navigation now use consistent labels for
107
+ Home, Chat, Knowledge Graph, Files, Pipeline, My Computer, Search, and
108
+ organization administration.
109
+ - **Design tokens** — shared product surfaces moved away from the prior
110
+ lavender-heavy treatment toward neutral work surfaces with blue, teal, and
111
+ amber accents.
112
+ - **Auth surface** — account screens use the same token-native product shell as
113
+ the workspace experience and hide decorative background elements.
114
+
115
+ ### Validation
116
+
117
+ - Frontend validation includes lint, Python checks, browser-rendered workspace
118
+ smoke checks, and Playwright visual regression coverage.
119
+ - Production build output was intentionally not generated for this frontend-only
120
+ redesign pass.
121
+
3
122
  ## [2.2.7] - 2026-06-05
4
123
 
5
124
  > Visual Stabilization Release — browser-rendered screens were reviewed and
@@ -0,0 +1,138 @@
1
+ # Lattice AI v3 Backend Architecture
2
+
3
+ Lattice AI v3 keeps the product local-first and knowledge-centric by combining
4
+ three retrieval layers inside the backend:
5
+
6
+ ```text
7
+ User Data
8
+ -> Chunking
9
+ -> Local Embeddings
10
+ -> SQLite Vector Index
11
+
12
+ User Data
13
+ -> Entity Extraction
14
+ -> Relationship Extraction
15
+ -> SQLite Knowledge Graph
16
+
17
+ Search
18
+ -> Hybrid Retrieval
19
+ -> Keyword
20
+ -> Vector
21
+ -> Graph
22
+ -> Unified Results
23
+ ```
24
+
25
+ ## Storage Model
26
+
27
+ The authoritative knowledge store remains `knowledge_graph.py` on SQLite.
28
+ Existing legacy graph rows are preserved, with the normalized v2 projection kept
29
+ as a derived read surface.
30
+
31
+ - `nodes`: entities, documents, folders, conversations, tasks, decisions, and
32
+ chunk nodes.
33
+ - `edges`: directed relationships with type, weight, metadata, and timestamps.
34
+ - `chunks`: extracted text chunks linked back to the source node.
35
+ - `knowledge_sources` and `local_file_index`: approved local folder indexing
36
+ state, source metadata, and incremental scan bookkeeping.
37
+ - `vector_embeddings`: derived local vector index rows for non-chunk nodes and
38
+ full chunk text.
39
+ - `vector_index_operations`: rebuild/incremental indexing history and status.
40
+
41
+ Vector rows are derived data. A full rebuild may delete and recreate vector
42
+ rows, but it does not mutate source documents, nodes, relationships, chunks, or
43
+ local file records.
44
+
45
+ ## Embeddings
46
+
47
+ The default embedding model is `lattice-local-hash-v1`, a deterministic local
48
+ feature-hashing embedder in `latticeai/core/local_embeddings.py`.
49
+
50
+ It provides:
51
+
52
+ - no cloud dependency,
53
+ - no model download requirement,
54
+ - deterministic output for tests and migrations,
55
+ - normalized vectors for cosine similarity by dot product,
56
+ - a stable interface for replacing the implementation with a local model
57
+ runtime later.
58
+
59
+ It is a fallback vector signal, not a production semantic embedding model.
60
+ Future provider support may include Ollama, MLX, OpenAI-compatible providers,
61
+ and other local embedding providers behind the same vector-index interface.
62
+
63
+ ## Search Model
64
+
65
+ `latticeai/services/search_service.py` composes the retrieval layers.
66
+
67
+ - Keyword search uses the existing graph text search over title, summary, and
68
+ metadata.
69
+ - Vector search embeds the query locally and ranks SQLite vector rows by
70
+ similarity.
71
+ - Graph search performs direct graph matching, relationship search, and bounded
72
+ neighbor expansion.
73
+ - Hybrid search fuses the three result streams with configurable weights and
74
+ returns one UI-ready result shape with per-source scores.
75
+
76
+ Default hybrid weights:
77
+
78
+ ```json
79
+ {
80
+ "keyword": 0.35,
81
+ "vector": 0.40,
82
+ "graph": 0.25
83
+ }
84
+ ```
85
+
86
+ ## API Contracts
87
+
88
+ The v3 backend exposes frontend-ready routes under `/api` while preserving all
89
+ existing `/knowledge-graph/...` compatibility routes.
90
+
91
+ ```text
92
+ POST /api/search/hybrid
93
+ GET /api/search/hybrid?q=...
94
+ POST /api/search/keyword
95
+ GET /api/search/keyword?q=...
96
+ POST /api/search/vector
97
+ GET /api/search/vector?q=...
98
+ GET /api/graph
99
+ GET /api/graph/node?node_id=...
100
+ POST /api/graph/node
101
+ GET /api/graph/relationship
102
+ POST /api/graph/relationship
103
+ GET /api/index/status
104
+ POST /api/index/rebuild
105
+ ```
106
+
107
+ Results include stable fields for UI consumption:
108
+
109
+ - `id`
110
+ - `node_id`
111
+ - `item_type`
112
+ - `type`
113
+ - `title`
114
+ - `summary`
115
+ - `score`
116
+ - `rank`
117
+ - `sources`
118
+ - `source_scores`
119
+ - `metadata`
120
+ - `updated_at`
121
+ - optional `graph_context`
122
+
123
+ ## Migration Impact
124
+
125
+ The migration is additive and non-destructive:
126
+
127
+ - new SQLite tables are created with `CREATE TABLE IF NOT EXISTS`,
128
+ - existing graph and local file data is preserved,
129
+ - normalized v2 graph projection remains a derived compatibility layer,
130
+ - vector rows can be rebuilt from existing graph/chunk rows,
131
+ - `GET /api/index/status` reports missing or stale vector items,
132
+ - `POST /api/index/rebuild` repairs the derived index.
133
+
134
+ ## Backend Ownership
135
+
136
+ This architecture deliberately avoids frontend shell redesign. The backend owns
137
+ storage, indexing, retrieval, ranking, and API contracts; the UI can consume the
138
+ new `/api` routes without requiring visual system changes.
@@ -0,0 +1,139 @@
1
+ # Lattice AI v3 — Frontend Product Shell
2
+
3
+ > A token-native single-page workspace shell for Lattice AI v3. It ships as the
4
+ > primary product experience and calls the real v3 retrieval/chat APIs while
5
+ > rendering clear unavailable states for local services that are not running.
6
+
7
+ Entry point: **`/app`** (served by `latticeai/api/static_routes.py` →
8
+ `static/v3/index.html`). Login, auto-login after registration, SSO callback, and
9
+ the PWA manifest land on `/app`. The legacy multi-page screens (`/workspace`,
10
+ `/chat`, `/graph`, `/admin`, …) remain reachable only as compatibility/debug
11
+ routes; normal user workflows stay in `/app`.
12
+
13
+ ---
14
+
15
+ ## Product model
16
+
17
+ | Concept | Surface |
18
+ | --- | --- |
19
+ | **Personal / Organization workspace** | Scope switcher in the rail (`X-Workspace-Id` header is sent on every adapter call). |
20
+ | **Basic / Advanced / Admin mode** | Mode switcher in the topbar. Mode gates which rail items appear and how dense each view is. |
21
+ | **Retrieval lattice** | The signature identity: **Knowledge Graph + Vector Index + Hybrid Search**, surfaced on Home and as a live 3-dot index chip in the topbar. |
22
+
23
+ Mode gating (`MODE_RANK` in `core/routes.js`): Basic ⊂ Advanced ⊂ Admin.
24
+ Deep-linking into an `admin/*` route auto-promotes the shell to Admin mode.
25
+
26
+ ---
27
+
28
+ ## Information architecture
29
+
30
+ One declarative table (`static/v3/js/core/routes.js`) drives the nav rail, the
31
+ command palette, the router, breadcrumbs, and lazy view loading.
32
+
33
+ ```
34
+ Workspace Home · Chat
35
+ Retrieval Knowledge Graph · Hybrid Search
36
+ Data Files · Pipeline*
37
+ Compute Agents* · Models · My Computer*
38
+ System Settings
39
+ Administration Users · Permissions · Audit Logs · Security · Policies · Private VPC (admin mode)
40
+ ```
41
+
42
+ `*` = revealed in Advanced mode and above. Routes are hash-based
43
+ (`#/knowledge-graph`, `#/admin/users`) so the SPA needs no server rewrites.
44
+
45
+ ---
46
+
47
+ ## Design system
48
+
49
+ Token-native, layered on the existing **single color source**
50
+ (`static/css/tokens.css`, `data-lt-theme` light/dark). No legacy override layers
51
+ (`responsive.css` / `workspace.css` / `platform.css`) are loaded by v3.
52
+ Runtime assets are loaded through `static/v3/asset-manifest.json`; the build
53
+ step writes hashed CSS/JS siblings and `/app` reads the manifest instead of
54
+ using manual `?v=` query strings.
55
+
56
+ | File | Responsibility |
57
+ | --- | --- |
58
+ | `css/lattice.tokens.css` | Structural tokens — type scale, spacing (4pt), radii, elevation, motion, z-index, layout rails, pillar accents, lattice mesh. |
59
+ | `css/lattice.base.css` | Reset, element defaults, the signature lattice backdrop, a11y utilities. |
60
+ | `css/lattice.components.css` | Primitive vocabulary — cards, panels, buttons, inputs, pills, stats, tables, tabs, switches, meters, empty/loading/error states, toasts. |
61
+ | `css/lattice.shell.css` | App chrome — rail, topbar, command palette, mobile drawer, retrieval pillars. |
62
+ | `css/lattice.views.css` | Bespoke view layouts — hero, graph canvas, search results, chat, files, pipeline, admin. |
63
+
64
+ **Rule:** component CSS uses only `var(--token)`; no per-component hardcoded
65
+ themed colors and no `!important`. Both themes flow from the token values.
66
+
67
+ **Identity:** a crystalline *lattice* mark, a faint node-and-edge mesh backdrop,
68
+ and a three-pillar retrieval motif (graph = blue, vector = teal, hybrid =
69
+ magenta). Deliberately **not** a clone of ChatGPT / Claude / Cursor / VS Code /
70
+ Notion / Obsidian.
71
+
72
+ ---
73
+
74
+ ## Shell + view contract
75
+
76
+ `core/shell.js` builds the chrome and renders views. Each view is a lazy ES
77
+ module under `js/views/` exporting:
78
+
79
+ ```js
80
+ export async function render(ctx) { /* … */ return singleDomNode; }
81
+ // optional: export const layout = "flush"; // full-bleed (chat)
82
+ ```
83
+
84
+ `ctx = { h, icon, api, store, c, route, params, navigate, toast }`
85
+
86
+ - `h()` — dependency-free hyperscript (`core/dom.js`); child strings are
87
+ auto-escaped (no injection surface).
88
+ - `c` — component factories (`core/components.js`).
89
+ - `store` — observable app state (theme / mode / workspace), persisted to
90
+ `localStorage` (`core/store.js`).
91
+
92
+ ---
93
+
94
+ ## Integration contract
95
+
96
+ `core/api.js` is the only transport layer. Every call hits the **real** endpoint
97
+ first and returns `{ ok, status, data, source }` where `source` is `"live"` or
98
+ `"unavailable"`. Unavailable responses carry empty data so primary surfaces do
99
+ not invent counters, sample graphs, fake health, or fake run history.
100
+
101
+ Live surfaces wired in v3.1.0:
102
+
103
+ | Adapter | Endpoint | Unavailable state |
104
+ | --- | --- | --- |
105
+ | `api.indexStatus()` | `GET /api/index/status` | empty retrieval status |
106
+ | `api.graph(params)` | `GET /api/graph` → `GET /knowledge-graph/graph` | empty graph |
107
+ | `api.hybridSearch(q, opts)` | `POST /api/search/hybrid` | empty results |
108
+ | `api.streamChat(body)` | `POST /chat` SSE | unavailable chat message |
109
+
110
+ No backend retrieval logic is implemented in the frontend — only transport,
111
+ normalization, clear provenance badges, and graceful fallback. When the live
112
+ chat backend reports `no_model_loaded`, v3 Chat shows a setup message instead of
113
+ falling back to generated text.
114
+
115
+ Embedding disclosure: production profiles are exposed for local/Ollama/MLX and
116
+ OpenAI-compatible providers. `lattice-local-hash-v1` remains a deterministic
117
+ fallback and is not presented as a production semantic embedding model.
118
+
119
+ ---
120
+
121
+ ## Responsive strategy
122
+
123
+ - **Desktop (≥1101px):** full 268px rail + content.
124
+ - **Tablet (761–1100px):** rail collapses to a 76px icon rail.
125
+ - **Mobile (≤760px):** rail becomes an off-canvas drawer (hamburger in the
126
+ topbar); grids collapse to single column; the chat context rail hides.
127
+
128
+ Plus: `prefers-color-scheme` following, `prefers-reduced-motion` honored, visible
129
+ focus rings, skip link, keyboard command palette (⌘K / Ctrl-K).
130
+
131
+ ---
132
+
133
+ ## Validation
134
+
135
+ - `npm run lint` (extended to cover `static/v3/**` via `scripts/lint_v3.mjs`).
136
+ - `npm run build:assets` (writes hashed v3 assets and `asset-manifest.json`).
137
+ - `npm run test:visual` (`tests/visual/v3.spec.js` against the mock server, which
138
+ serves `/app` and mocks the future API surfaces).
139
+ - Browser-rendered smoke checks of every route in light and dark themes.