Repository navigation
Closed
Labels
Description
Overview
This epic tracks the complete implementation of the NodeSpace Business Logic Layer - a Rust-based system with libsql that provides core data management, node operations, and AI integration.
Architecture
Pure JSON schema architecture with:
- packages/core: Universal node model, database layer (libsql + Turso), business services
- packages/nlp-engine: AI/ML services (embeddings, intent classification via llama.cpp-rs)
Key design principles:
- Pure JSON Schema: ALL entity data in properties field - no complementary tables, no ALTER TABLE migrations
- Schema-as-Node: Schemas stored as nodes with
node_type = "schema",id = type_name - Zero Migration Risk: Critical for desktop apps (10,000+ user machines, no rollback possible)
- Rule-Based Indexing: JSON path indexes created based on query frequency (not LLM-driven)
- Local-First: Embedded Turso with sync via embedded replicas
- AI-Native: Built-in vector embeddings (F32_BLOB) and semantic search
- Multi-Platform: Shared logic for desktop (Tauri) and AI agents (MCP stdio server)
Implementation Phases
Phase 1: Core Package Foundation
- Initialize packages/core with Cargo workspace configuration #98
- Define Node data structures and models #99 (Pure JSON properties field)
- Implement NodeBehavior trait system for extensible node types #100
- Set up database connection with libsql #101 (libsql, NOT sqlx)
- Initialize database schema (Pure JSON, no migrations) #102 (single nodes table + node_mentions)
Phase 2: Node Types & Services
- EPIC: Implement built-in node behaviors #103 (schema nodes)
- Implement NodeService with CRUD operations #104 (JSON path queries)
- Add mentions relation management and backlink queries #105
- Implement Schema Management Service with Migration Infrastructure #106 (schemas are nodes, no dynamic tables)
- Semantic search: validation, benchmarks, and documentation #107 (F32_BLOB)
Phase 3: NLP Engine Package
- Initialize packages/nlp-engine with embedding service #108 (llama.cpp-rs)
- Add intent classification for natural language commands #109
Phase 4: Integration & Testing
- Create Tauri command layer for desktop app integration #110
- Implement reactive state synchronization #111
- Add MCP stdio server for AI agent access #112
- Create comprehensive integration tests #113
- Add comprehensive error handling and logging #114
- Performance optimization and production readiness #115
Success Criteria
- Pure JSON schema with no ALTER TABLE risk
- Built-in node types as schema nodes
- Turso + JSON path indexes performing well
- Vector embeddings (F32_BLOB) for semantic search
- Rule-based IndexManager for dynamic indexes
- Auto-reference detection (primitive vs entity types)
- Tauri integration
- MCP stdio server
- Reactive state synchronization
- User-defined schemas without table creation
- Performance optimized (0-100K nodes free tier)
Documentation
- docs/architecture/business-logic/overview.md
- docs/architecture/business-logic/database-schema.md
- docs/architecture/business-logic/node-behavior-system.md
- docs/architecture/data/storage-architecture.md
- docs/architecture/core/technology-stack.md
Activity
malibio commentedon Dec 5, 2025
Epic complete. The Business Logic Layer is fully implemented: