ltcai 2.2.7 → 3.0.1
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.
- package/README.md +63 -32
- package/docs/CHANGELOG.md +82 -0
- package/docs/V3_BACKEND_ARCHITECTURE.md +138 -0
- package/docs/V3_FRONTEND.md +136 -0
- package/knowledge_graph.py +649 -21
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/admin.py +47 -0
- package/latticeai/api/agents.py +54 -31
- package/latticeai/api/auth.py +1 -1
- package/latticeai/api/chat.py +10 -2
- package/latticeai/api/search.py +236 -0
- package/latticeai/api/static_routes.py +11 -2
- package/latticeai/core/config.py +16 -0
- package/latticeai/core/embedding_providers.py +502 -0
- package/latticeai/core/local_embeddings.py +86 -0
- package/latticeai/core/workspace_os.py +1 -1
- package/latticeai/server_app.py +49 -1
- package/latticeai/services/agent_runtime.py +245 -0
- package/latticeai/services/search_service.py +346 -0
- package/package.json +6 -4
- package/static/account.html +9 -9
- package/static/activity.html +4 -4
- package/static/admin.html +8 -8
- package/static/agents.html +4 -4
- package/static/chat.html +10 -10
- package/static/css/reference/account.css +137 -1
- package/static/css/reference/chat.css +31 -37
- package/static/css/responsive.css +42 -0
- package/static/css/tokens.css +125 -130
- package/static/graph.html +9 -9
- package/static/manifest.json +3 -3
- package/static/plugins.html +4 -4
- package/static/scripts/account.js +4 -4
- package/static/scripts/chat.js +40 -8
- package/static/scripts/workspace.js +78 -0
- package/static/v3/css/lattice.base.css +128 -0
- package/static/v3/css/lattice.components.css +447 -0
- package/static/v3/css/lattice.shell.css +407 -0
- package/static/v3/css/lattice.tokens.css +132 -0
- package/static/v3/css/lattice.views.css +277 -0
- package/static/v3/index.html +40 -0
- package/static/v3/js/app.js +26 -0
- package/static/v3/js/core/api.js +327 -0
- package/static/v3/js/core/components.js +215 -0
- package/static/v3/js/core/dom.js +148 -0
- package/static/v3/js/core/fixtures.js +171 -0
- package/static/v3/js/core/router.js +37 -0
- package/static/v3/js/core/routes.js +73 -0
- package/static/v3/js/core/shell.js +363 -0
- package/static/v3/js/core/store.js +113 -0
- package/static/v3/js/views/admin-audit.js +185 -0
- package/static/v3/js/views/admin-permissions.js +178 -0
- package/static/v3/js/views/admin-policies.js +103 -0
- package/static/v3/js/views/admin-private-vpc.js +138 -0
- package/static/v3/js/views/admin-security.js +181 -0
- package/static/v3/js/views/admin-users.js +168 -0
- package/static/v3/js/views/agents.js +194 -0
- package/static/v3/js/views/chat.js +450 -0
- package/static/v3/js/views/files.js +180 -0
- package/static/v3/js/views/home.js +119 -0
- package/static/v3/js/views/hybrid-search.js +195 -0
- package/static/v3/js/views/knowledge-graph.js +238 -0
- package/static/v3/js/views/models.js +247 -0
- package/static/v3/js/views/my-computer.js +237 -0
- package/static/v3/js/views/pipeline.js +161 -0
- package/static/v3/js/views/settings.js +258 -0
- package/static/workflows.html +4 -4
- package/static/workspace.css +340 -2
- package/static/workspace.html +43 -24
package/README.md
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
# Lattice AI
|
|
5
5
|
|
|
6
|
-
**
|
|
6
|
+
**Lattice AI v3 — Local-First AI Workspace Platform.**
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
files, and
|
|
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
|
[](https://www.npmjs.com/package/ltcai)
|
|
16
17
|
[](https://marketplace.visualstudio.com/items?itemName=parktaesoo.ltcai)
|
|
17
18
|
[](https://open-vsx.org/extension/parktaesoo/ltcai)
|
|
18
|
-
[](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/
|
|
19
|
+
[](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v3.0.0)
|
|
19
20
|
[](LICENSE)
|
|
20
21
|
[](https://www.python.org/)
|
|
21
22
|
[](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
|
|
52
|
+
- [GitHub Release v3.0.0](https://github.com/TaeSooPark-PTS/LatticeAI/releases/tag/v3.0.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
|
|
85
|
-
files, models, graph context, and agent workflows in one
|
|
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. Legacy `/chat` remains available as a
|
|
92
|
+
rollback/debug path.
|
|
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,7 +100,9 @@ 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
108
|
- **SSO for teams**: organization workspaces can be paired with Okta or
|
|
@@ -114,28 +122,23 @@ 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
|
-
##
|
|
118
|
-
|
|
119
|
-
Lattice AI
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- Knowledge Graph
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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.0.0 Highlights
|
|
126
|
+
|
|
127
|
+
Lattice AI v3.0.0 makes `/app` the primary workspace shell and ships the v3
|
|
128
|
+
backend retrieval stack together with the native frontend.
|
|
129
|
+
|
|
130
|
+
- Native v3 Chat lives inside `/app#/chat` and streams through the real
|
|
131
|
+
`POST /chat` backend while showing friendly setup guidance when no model is
|
|
132
|
+
loaded.
|
|
133
|
+
- Knowledge Graph, Vector Index, and Hybrid Search are first-class retrieval
|
|
134
|
+
surfaces. Hybrid results show keyword, local vector, and graph scores.
|
|
135
|
+
- Personal and Organization workspaces, plus Basic / Advanced / Admin modes,
|
|
136
|
+
are built into the shell.
|
|
137
|
+
- Legacy `/chat` remains reachable for rollback and debugging.
|
|
138
|
+
- The default embedding signal is `lattice-local-hash-v1`, a deterministic
|
|
139
|
+
local fallback. It is not described as a production semantic embedding model;
|
|
140
|
+
future providers may include Ollama, MLX, OpenAI-compatible endpoints, and
|
|
141
|
+
other local embedding runtimes.
|
|
139
142
|
|
|
140
143
|
## Screenshots
|
|
141
144
|
|
|
@@ -175,6 +178,32 @@ files / documents / images / screenshots / conversations / decisions
|
|
|
175
178
|
|
|
176
179
|
The graph keeps useful workspace context available even when you change models.
|
|
177
180
|
|
|
181
|
+
## v3 Backend Retrieval
|
|
182
|
+
|
|
183
|
+
The v3 backend adds a local-first retrieval stack that combines the Knowledge
|
|
184
|
+
Graph, a SQLite vector index, and hybrid result fusion. It preserves existing
|
|
185
|
+
graph data while adding derived vector rows that can be rebuilt at any time.
|
|
186
|
+
|
|
187
|
+
Embedding status: the current default is `lattice-local-hash-v1`, a
|
|
188
|
+
deterministic local fallback embedder for indexing and tests. It provides a
|
|
189
|
+
stable vector signal without downloads or cloud calls; it is not a production
|
|
190
|
+
semantic embedding model. Future provider support may include Ollama, MLX,
|
|
191
|
+
OpenAI-compatible providers, and other local embedding runtimes.
|
|
192
|
+
|
|
193
|
+
Core API contracts:
|
|
194
|
+
|
|
195
|
+
- `POST /api/search/hybrid`
|
|
196
|
+
- `GET /api/search/keyword?q=...`
|
|
197
|
+
- `GET /api/search/vector?q=...`
|
|
198
|
+
- `GET /api/graph`
|
|
199
|
+
- `GET /api/graph/node?node_id=...`
|
|
200
|
+
- `GET /api/graph/relationship`
|
|
201
|
+
- `GET /api/index/status`
|
|
202
|
+
- `POST /api/index/rebuild`
|
|
203
|
+
|
|
204
|
+
See [docs/V3_BACKEND_ARCHITECTURE.md](docs/V3_BACKEND_ARCHITECTURE.md) for the
|
|
205
|
+
storage model, search model, migration behavior, and API response shape.
|
|
206
|
+
|
|
178
207
|
## Local Model Policy
|
|
179
208
|
|
|
180
209
|
Lattice AI recommends current-generation multimodal models for local use and
|
|
@@ -230,7 +259,9 @@ Core areas:
|
|
|
230
259
|
|
|
231
260
|
| Version | Theme |
|
|
232
261
|
| --- | --- |
|
|
233
|
-
| **
|
|
262
|
+
| **3.0.1** | Release-blocker remediation — provider-backed embeddings (Hash/MLX/Ollama/OpenAI/Custom), unified AgentRuntime boundary, every v3 surface connected or clearly unavailable |
|
|
263
|
+
| 3.0.0 | v3 local-first AI workspace platform — `/app`, Native Chat, Knowledge Graph, Vector Index, Hybrid Search, workspace modes |
|
|
264
|
+
| 2.2.7 | Visual system stabilization — cohesive dark/light screens, crisp chat composer, dark graph canvas, Workspace OS polish |
|
|
234
265
|
| 2.2.6 | Token-native CSS foundation |
|
|
235
266
|
| 2.2.5 | Release hygiene hotfix — dark overlays, modal stack, cache-busting, favicon, and Telegram log masking |
|
|
236
267
|
| 2.2.4 | Chat dark-mode completion |
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.0] - 2026-06-07
|
|
4
|
+
|
|
5
|
+
> v3 — Local-first AI Workspace Platform. The hybrid-search
|
|
6
|
+
> backend and the token-native `/app` workspace shell now ship together: the
|
|
7
|
+
> shell's adapters call the real v3 retrieval APIs, and Chat is a first-class
|
|
8
|
+
> native view (no link-out to the legacy page). Legacy `/chat` remains available
|
|
9
|
+
> as a rollback/debug path.
|
|
10
|
+
|
|
11
|
+
### Added — Backend retrieval
|
|
12
|
+
|
|
13
|
+
- **Hybrid search API** — added `/api/search/hybrid`, `/api/search/keyword`,
|
|
14
|
+
`/api/search/vector`, `/api/graph`, `/api/graph/node`,
|
|
15
|
+
`/api/graph/relationship`, `/api/index/status`, and `/api/index/rebuild`.
|
|
16
|
+
- **SQLite vector index** — added local deterministic embeddings,
|
|
17
|
+
`vector_embeddings`, and `vector_index_operations` for incremental indexing,
|
|
18
|
+
rebuilds, and status monitoring.
|
|
19
|
+
- **Embedding status** — the default `lattice-local-hash-v1` embedder is a
|
|
20
|
+
deterministic local fallback, not a production semantic embedding model.
|
|
21
|
+
Future providers may include Ollama, MLX, OpenAI-compatible providers, and
|
|
22
|
+
other local embedding runtimes.
|
|
23
|
+
- **Graph retrieval helpers** — added node lookup, relationship search, bounded
|
|
24
|
+
traversal, neighbor expansion, and service-level result fusion.
|
|
25
|
+
- **Backend architecture doc** — added `docs/V3_BACKEND_ARCHITECTURE.md` with
|
|
26
|
+
storage, search, API, and migration details.
|
|
27
|
+
|
|
28
|
+
### Added — Native app shell (`/app`)
|
|
29
|
+
|
|
30
|
+
- **Unified app shell** (`static/v3/`) — nav rail, command palette (⌘K),
|
|
31
|
+
workspace switcher (Personal/Organization), and mode switcher
|
|
32
|
+
(Basic/Advanced/Admin); hash-routed views for every primary and admin area
|
|
33
|
+
(Home, Chat, Knowledge Graph, Hybrid Search, Files, Pipeline, Agents, Models,
|
|
34
|
+
My Computer, Settings, and Admin · Users/Permissions/Audit/Security/Policies/
|
|
35
|
+
Private VPC).
|
|
36
|
+
- **Native Chat view** — a first-class 3-pane chat (conversations · thread ·
|
|
37
|
+
retrieval context) wired to the real backend (`POST /chat` SSE + `/history/*`)
|
|
38
|
+
with streaming, empty/error/loading states; surfaces Knowledge Graph, Vector,
|
|
39
|
+
Hybrid Search, and indexed-file context per answer. The legacy `/chat` page
|
|
40
|
+
stays reachable but is no longer the primary chat experience.
|
|
41
|
+
- **Primary entry behavior** — `/app` is the product entry after login and SSO;
|
|
42
|
+
the PWA manifest starts at `/app`.
|
|
43
|
+
- **Retrieval identity** — Knowledge Graph + Vector Index + Hybrid Search are
|
|
44
|
+
surfaced as a first-class "retrieval lattice" on Home and a live index chip.
|
|
45
|
+
- **Token-native design system** — `static/v3/css/lattice.*.css` built on top of
|
|
46
|
+
`tokens.css` with no dependency on the legacy override layers; full light/dark
|
|
47
|
+
and desktop/tablet/mobile support.
|
|
48
|
+
- **Integration adapters** — `static/v3/js/core/api.js` calls the real v3
|
|
49
|
+
endpoints and degrades to clearly-badged sample data; no backend logic in the UI.
|
|
50
|
+
|
|
51
|
+
### Validation
|
|
52
|
+
|
|
53
|
+
- Backend coverage includes v3 indexing, migration status, vector retrieval,
|
|
54
|
+
graph relationship traversal, hybrid result fusion, and API contract tests.
|
|
55
|
+
- Frontend coverage: `tests/visual/v3.spec.js` and `scripts/lint_v3.mjs` (wired
|
|
56
|
+
into `npm run lint`); see `docs/V3_FRONTEND.md` for IA + design decisions.
|
|
57
|
+
- Release preparation builds exact `3.0.0` Python, npm, and VSIX artifacts.
|
|
58
|
+
Package-store publication remains manual and is not triggered by pushing the
|
|
59
|
+
release tag.
|
|
60
|
+
|
|
61
|
+
> Frontend Product Shell Redesign — workspace navigation, auth entry, and shared
|
|
62
|
+
> product surfaces were realigned around the local-first AI workspace model
|
|
63
|
+
> without changing backend contracts.
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
|
|
67
|
+
- **Workspace IA** — the workspace shell now separates primary user workflows,
|
|
68
|
+
admin controls, and runtime tooling, with Basic, Advanced, and Admin modes.
|
|
69
|
+
- **Navigation** — Chat and Workspace navigation now use consistent labels for
|
|
70
|
+
Home, Chat, Knowledge Graph, Files, Pipeline, My Computer, Search, and
|
|
71
|
+
organization administration.
|
|
72
|
+
- **Design tokens** — shared product surfaces moved away from the prior
|
|
73
|
+
lavender-heavy treatment toward neutral work surfaces with blue, teal, and
|
|
74
|
+
amber accents.
|
|
75
|
+
- **Auth surface** — account screens use the same token-native product shell as
|
|
76
|
+
the workspace experience and hide decorative background elements.
|
|
77
|
+
|
|
78
|
+
### Validation
|
|
79
|
+
|
|
80
|
+
- Frontend validation includes lint, Python checks, browser-rendered workspace
|
|
81
|
+
smoke checks, and Playwright visual regression coverage.
|
|
82
|
+
- Production build output was intentionally not generated for this frontend-only
|
|
83
|
+
redesign pass.
|
|
84
|
+
|
|
3
85
|
## [2.2.7] - 2026-06-05
|
|
4
86
|
|
|
5
87
|
> 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,136 @@
|
|
|
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
|
+
> keeping graceful, clearly-badged sample states for unavailable local services.
|
|
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; `/chat` is the rollback/debug
|
|
11
|
+
path for the native v3 Chat view.
|
|
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
|
+
|
|
53
|
+
| File | Responsibility |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `css/lattice.tokens.css` | Structural tokens — type scale, spacing (4pt), radii, elevation, motion, z-index, layout rails, pillar accents, lattice mesh. |
|
|
56
|
+
| `css/lattice.base.css` | Reset, element defaults, the signature lattice backdrop, a11y utilities. |
|
|
57
|
+
| `css/lattice.components.css` | Primitive vocabulary — cards, panels, buttons, inputs, pills, stats, tables, tabs, switches, meters, empty/loading/error states, toasts. |
|
|
58
|
+
| `css/lattice.shell.css` | App chrome — rail, topbar, command palette, mobile drawer, retrieval pillars. |
|
|
59
|
+
| `css/lattice.views.css` | Bespoke view layouts — hero, graph canvas, search results, chat, files, pipeline, admin. |
|
|
60
|
+
|
|
61
|
+
**Rule:** component CSS uses only `var(--token)`; no per-component hardcoded
|
|
62
|
+
themed colors and no `!important`. Both themes flow from the token values.
|
|
63
|
+
|
|
64
|
+
**Identity:** a crystalline *lattice* mark, a faint node-and-edge mesh backdrop,
|
|
65
|
+
and a three-pillar retrieval motif (graph = blue, vector = teal, hybrid =
|
|
66
|
+
magenta). Deliberately **not** a clone of ChatGPT / Claude / Cursor / VS Code /
|
|
67
|
+
Notion / Obsidian.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Shell + view contract
|
|
72
|
+
|
|
73
|
+
`core/shell.js` builds the chrome and renders views. Each view is a lazy ES
|
|
74
|
+
module under `js/views/` exporting:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
export async function render(ctx) { /* … */ return singleDomNode; }
|
|
78
|
+
// optional: export const layout = "flush"; // full-bleed (chat)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`ctx = { h, icon, api, store, c, route, params, navigate, toast }`
|
|
82
|
+
|
|
83
|
+
- `h()` — dependency-free hyperscript (`core/dom.js`); child strings are
|
|
84
|
+
auto-escaped (no injection surface).
|
|
85
|
+
- `c` — component factories (`core/components.js`).
|
|
86
|
+
- `store` — observable app state (theme / mode / workspace), persisted to
|
|
87
|
+
`localStorage` (`core/store.js`).
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Integration contract
|
|
92
|
+
|
|
93
|
+
`core/api.js` is the only transport layer. Every call hits the **real** endpoint
|
|
94
|
+
first and degrades to a clearly-badged sample payload (`core/fixtures.js`) when
|
|
95
|
+
the endpoint is absent — returning `{ ok, status, data, source }` where `source`
|
|
96
|
+
is `"live"` or `"placeholder"`. The UI always renders a **Sample data** badge for
|
|
97
|
+
placeholder responses, so nothing fake is presented as backend output.
|
|
98
|
+
|
|
99
|
+
Live surfaces wired in v3.0.0:
|
|
100
|
+
|
|
101
|
+
| Adapter | Endpoint | Fallback |
|
|
102
|
+
| --- | --- | --- |
|
|
103
|
+
| `api.indexStatus()` | `GET /api/index/status` | sample KG/vector/hybrid pipeline state |
|
|
104
|
+
| `api.graph(params)` | `GET /api/graph` → `GET /knowledge-graph/graph` | sample mesh |
|
|
105
|
+
| `api.hybridSearch(q, opts)` | `POST /api/search/hybrid` | sample fused results |
|
|
106
|
+
| `api.streamChat(body)` | `POST /chat` SSE | sample stream only when endpoint is unavailable |
|
|
107
|
+
|
|
108
|
+
No backend retrieval logic is implemented in the frontend — only transport,
|
|
109
|
+
normalization, clear provenance badges, and graceful fallback. When the live
|
|
110
|
+
chat backend reports `no_model_loaded`, v3 Chat shows a setup message instead of
|
|
111
|
+
falling back to sample generation.
|
|
112
|
+
|
|
113
|
+
Embedding disclosure: the current default vector signal is
|
|
114
|
+
`lattice-local-hash-v1`, a deterministic local fallback. The UI avoids calling
|
|
115
|
+
it a production semantic embedding model.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Responsive strategy
|
|
120
|
+
|
|
121
|
+
- **Desktop (≥1101px):** full 268px rail + content.
|
|
122
|
+
- **Tablet (761–1100px):** rail collapses to a 76px icon rail.
|
|
123
|
+
- **Mobile (≤760px):** rail becomes an off-canvas drawer (hamburger in the
|
|
124
|
+
topbar); grids collapse to single column; the chat context rail hides.
|
|
125
|
+
|
|
126
|
+
Plus: `prefers-color-scheme` following, `prefers-reduced-motion` honored, visible
|
|
127
|
+
focus rings, skip link, keyboard command palette (⌘K / Ctrl-K).
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Validation
|
|
132
|
+
|
|
133
|
+
- `npm run lint` (extended to cover `static/v3/**` via `scripts/lint_v3.mjs`).
|
|
134
|
+
- `npm run test:visual` (`tests/visual/v3.spec.js` against the mock server, which
|
|
135
|
+
serves `/app` and mocks the future API surfaces).
|
|
136
|
+
- Browser-rendered smoke checks of every route in light and dark themes.
|