Repository navigation
Add comprehensive business logic architecture documentation - #97
Merged
Merged
Conversation
- overview.md: Complete architecture with package structure and design decisions - database-schema.md: Hybrid schema design with SQLx integration patterns - node-behavior-system.md: Trait-based system for extensible node types - mcp-integration.md: AI agent access via MCP stdio protocol Addresses business logic layer design for NodeSpace core implementation
malibio
added a commit
that referenced
this pull request
Feb 4, 2026
- overview.md: Complete architecture with package structure and design decisions - database-schema.md: Hybrid schema design with SQLx integration patterns - node-behavior-system.md: Trait-based system for extensible node types - mcp-integration.md: AI agent access via MCP stdio protocol Addresses business logic layer design for NodeSpace core implementation Co-authored-by: Container Dev <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 5, 2026
- overview.md: Complete architecture with package structure and design decisions - database-schema.md: Hybrid schema design with SQLx integration patterns - node-behavior-system.md: Trait-based system for extensible node types - mcp-integration.md: AI agent access via MCP stdio protocol Addresses business logic layer design for NodeSpace core implementation Co-authored-by: Container Dev <[email protected]>
mstomar125
added a commit
that referenced
this pull request
Jun 15, 2026
The Pro daemon's upcoming pgvector push needs to read locally-stored vectors, but core only exposed embedding *search* (KNN) and *write* (upsert) — no plain read. Add two read methods, both decoding the little-endian f32 blob written by `upsert_embeddings` back into the `Embedding` model via a new `row_to_embedding` helper: - `SqliteStore::get_embeddings(node_id)` — a node's embeddings, by chunk. - `SqliteStore::embeddings_modified_since(since)` — embeddings modified at or after a cursor, across all nodes, ordered by `modified_at`; this is what the daemon will sweep to push newly (re)computed vectors. Both are surfaced as `NodeService` wrappers (the daemon holds an `Arc<NodeService>`). They are deliberately NOT behind the `nlp` feature: they read the persisted `embedding` table, which exists whether or not embedding *generation* (llama-cpp) is compiled in — so a daemon built without NLP can still sync vectors. The recurring sweep gets a covering index: `idx_emb_modified ON embedding (modified_at, node_id, chunk_index)`. The existing idx_emb_stale_mod leads with `stale`, so it can't serve the stale-agnostic modified_at range scan — without the new index every sweep full-scans + filesorts. Also pinned the lexicographic-cursor invariant (UTC rfc3339 modified_at) in a doc comment. Test: upsert two synthetic 768-dim chunk vectors, assert both round-trip out of the blob in chunk order, the modified-since cursor includes them at epoch and excludes them in the future, the sweep's query plan uses idx_emb_modified with no filesort, and a node with no embeddings reads back empty. Co-authored-by: Mayank Tomar <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
mstomar125
added a commit
that referenced
this pull request
Jun 15, 2026
#1417) The Pro daemon's upcoming embedding PULL needs to apply vectors synced from another device into the local store, but `upsert_embeddings` / `delete_embeddings` were store-only (the read API from #1416 added reads; this adds the symmetric writes). Surface both as `NodeService` wrappers: - `NodeService::upsert_embeddings(node_id, Vec<NewEmbedding>)` — replace a node's vectors wholesale (mirrors the local generation path). - `NodeService::delete_embeddings(node_id)` — clear a node's vectors. Like the read wrappers, both are deliberately NOT behind the `nlp` feature: applying a received vector doesn't need the generation engine, so a daemon built without llama-cpp can still receive embeddings. Test: upsert a synthetic 768-dim vector via the wrapper, read it back via get_embeddings (round-trip), then delete and assert empty. Co-authored-by: Mayank Tomar <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
malibio
pushed a commit
that referenced
this pull request
Jun 22, 2026
The Pro daemon's upcoming pgvector push needs to read locally-stored vectors, but core only exposed embedding *search* (KNN) and *write* (upsert) — no plain read. Add two read methods, both decoding the little-endian f32 blob written by `upsert_embeddings` back into the `Embedding` model via a new `row_to_embedding` helper: - `SqliteStore::get_embeddings(node_id)` — a node's embeddings, by chunk. - `SqliteStore::embeddings_modified_since(since)` — embeddings modified at or after a cursor, across all nodes, ordered by `modified_at`; this is what the daemon will sweep to push newly (re)computed vectors. Both are surfaced as `NodeService` wrappers (the daemon holds an `Arc<NodeService>`). They are deliberately NOT behind the `nlp` feature: they read the persisted `embedding` table, which exists whether or not embedding *generation* (llama-cpp) is compiled in — so a daemon built without NLP can still sync vectors. The recurring sweep gets a covering index: `idx_emb_modified ON embedding (modified_at, node_id, chunk_index)`. The existing idx_emb_stale_mod leads with `stale`, so it can't serve the stale-agnostic modified_at range scan — without the new index every sweep full-scans + filesorts. Also pinned the lexicographic-cursor invariant (UTC rfc3339 modified_at) in a doc comment. Test: upsert two synthetic 768-dim chunk vectors, assert both round-trip out of the blob in chunk order, the modified-since cursor includes them at epoch and excludes them in the future, the sweep's query plan uses idx_emb_modified with no filesort, and a node with no embeddings reads back empty. Co-authored-by: Mayank Tomar <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
malibio
pushed a commit
that referenced
this pull request
Jun 22, 2026
#1417) The Pro daemon's upcoming embedding PULL needs to apply vectors synced from another device into the local store, but `upsert_embeddings` / `delete_embeddings` were store-only (the read API from #1416 added reads; this adds the symmetric writes). Surface both as `NodeService` wrappers: - `NodeService::upsert_embeddings(node_id, Vec<NewEmbedding>)` — replace a node's vectors wholesale (mirrors the local generation path). - `NodeService::delete_embeddings(node_id)` — clear a node's vectors. Like the read wrappers, both are deliberately NOT behind the `nlp` feature: applying a received vector doesn't need the generation engine, so a daemon built without llama-cpp can still receive embeddings. Test: upsert a synthetic 768-dim vector via the wrapper, read it back via get_embeddings (round-trip), then delete and assert empty. Co-authored-by: Mayank Tomar <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds detailed architecture documentation for the NodeSpace business logic layer, including:
These documents establish the foundation for implementing the Rust backend business logic layer with clear patterns for:
Ready for review and merge to enable implementation phase.