Nano Banana Pro
Agent skill for nano-banana-pro
This file provides guidance for working with the Rust implementation of LocalMind.
Sign in to like and favorite skills
This file provides guidance for working with the Rust implementation of LocalMind.
The Rust implementation (
localmind-rs/) is the current active development version of LocalMind. It's a desktop application built with Tauri that provides a native GUI for LocalMind's RAG-based knowledge management system. This version aims to be a standalone, performant replacement for the Node.js implementation.
rusqlite (bundled, no external dependencies)src-ui/)reqwest for Ollama integrationlocalmind-rs/ ├── Cargo.toml # Rust dependencies and metadata ├── build.rs # Tauri build script ├── tauri.conf.json # Tauri configuration ├── icons/ # Application icons ├── src/ # Rust source code │ ├── main.rs # Application entry point │ ├── lib.rs # Library exports │ ├── db.rs # Database operations │ ├── document.rs # Document model and operations │ ├── ollama.rs # Ollama API integration │ ├── rag.rs # RAG implementation │ └── vector.rs # Vector operations and similarity ├── src-ui/ # Frontend UI (served by Tauri) │ ├── index.html # Main UI layout │ ├── app.js # Frontend JavaScript │ └── style.css # UI styling └── target/ # Build artifacts (gitignored)
# Install Rust dependencies cargo check # Update dependencies cargo update
For easy installation, use the automated startup script that ensures all required models are installed:
# Linux/macOS/Git Bash on Windows ./start_lmstudio.sh # Windows Command Prompt start_lmstudio.bat
This script will:
See MODEL_SETUP.md for detailed model setup instructions.
# Run in development mode with GUI cargo tauri dev # Build for development (CLI mode if needed) cargo build # Run tests cargo test # Format code cargo fmt # Check for issues cargo clippy
# Build optimized binary cargo build --release # Build Tauri app bundle cargo tauri build
The Rust implementation uses a simplified SQLite schema optimized for performance:
The Rust backend exposes commands to the frontend via Tauri's IPC system:
# Start development server with hot reload cargo tauri dev # Frontend changes are automatically reloaded # Backend changes require restart
# Unit tests for core modules cargo test # Integration tests for database operations cargo test --test integration # Vector similarity tests cargo test vector:: --lib
# Format all code cargo fmt # Check for common issues cargo clippy # Full check including unused dependencies cargo +nightly udeps
The Rust implementation is designed as a desktop-first application but maintains conceptual compatibility with the TypeScript version:
Migration utilities are planned for:
~/.localmind/localmind.db (Windows: %APPDATA%/localmind/localmind.db)http://localhost:11434qwen3-embedding:0.6bRUST_LOG: Logging level (debug, info, warn, error)LOCALMIND_DB_PATH: Custom database pathOLLAMA_HOST: Custom Ollama server URLTauri build fails:
# Ensure system dependencies are installed # On Windows: Visual Studio Build Tools # On macOS: Xcode Command Line Tools # On Linux: build-essential, webkit2gtk-4.0-dev
Database connection errors:
# Check database file permissions # Ensure SQLite bundled feature is enabled
Ollama integration issues:
# Verify Ollama is running on localhost:11434 # Check model availability with `ollama list`
# Enable debug logging RUST_LOG=debug cargo tauri dev # Database debugging RUST_LOG=rusqlite=debug cargo run # Network debugging (Ollama requests) RUST_LOG=reqwest=debug cargo run
cargo build: Fast compilation for testingcargo tauri dev: GUI development with hot reloadcargo build --release: Optimized binarycargo tauri build: Packaged application for distribution# Build for different targets (requires setup) cargo build --target x86_64-pc-windows-gnu cargo build --target x86_64-apple-darwin cargo build --target x86_64-unknown-linux-gnu
cargo fmt for formattingThis Rust implementation is the current active development version of LocalMind, focusing on performance, security, and ease of deployment as a standalone desktop application.