### Quick Start Benchmark Setup (Bash) Source: https://github.com/cyberlife-coder/velesdb/blob/main/benchmarks/README.md A quick setup guide to run the Docker-based benchmark. It includes starting the services, installing Python dependencies, and initiating the benchmark script. This is the recommended starting point for users wanting to quickly test the comparison. ```bash # 1. Start both servers (Docker required) docker-compose up -d --build # 2. Install dependencies pip install -r requirements.txt # 3. Run fair Docker benchmark python benchmark_docker.py --vectors 5000 --clusters 25 ``` -------------------------------- ### Quick Start: Project Setup and Development Source: https://github.com/cyberlife-coder/velesdb/blob/main/demos/tauri-rag-app/README.md Clones the example project, installs frontend dependencies using npm, and starts the development server with `cargo tauri dev`. This allows for rapid iteration during development. ```bash # Clone this example cd demos/tauri-rag-app # Install frontend dependencies npm install # Run in development cargo tauri dev ``` -------------------------------- ### Install VelesDB using Cargo Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md These commands show how to install the VelesDB server using Cargo, either from crates.io or by building from source. It includes installing from crates.io and building from a git repository. ```bash # Install from crates.io cargo install velesdb-server # Or build from source git clone https://github.com/cyberlife-coder/VelesDB.git cd velesdb cargo build --release ./target/release/velesdb-server ``` -------------------------------- ### Configure VelesDB Server with Command Line Options Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Shows the available command-line options for starting the VelesDB server, including data directory, host, and port configuration. Also lists corresponding environment variables. ```bash velesdb-server [OPTIONS] Options: -d, --data-dir Data directory [default: ./data] -h, --host Host address [default: 0.0.0.0] -p, --port Port number [default: 8080] Environment variables: - VELESDB_DATA_DIR - Data directory path - VELESDB_HOST - Bind address - VELESDB_PORT - Port number - RUST_LOG - Logging level (debug, info, warn, error) ``` -------------------------------- ### Quick Start: Index Documents with VelesDB Source: https://github.com/cyberlife-coder/velesdb/blob/main/integrations/llamaindex/README.md Demonstrates how to initialize VelesDB, load documents from a directory, and create a LlamaIndex VectorStoreIndex. This example shows the basic setup for indexing and querying. ```python from llama_index.core import VectorStoreIndex, SimpleDirectoryReader from llamaindex_velesdb import VelesDBVectorStore # Create vector store vector_store = VelesDBVectorStore( path="./velesdb_data", collection_name="my_docs", metric="cosine", ) # Load and index documents documents = SimpleDirectoryReader("./data").load_data() index = VectorStoreIndex.from_documents( documents, vector_store=vector_store, ) # Query query_engine = index.as_query_engine() response = query_engine.query("What is VelesDB?") print(response) ``` -------------------------------- ### Kotlin Quick Start for VelesDB on Android Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-mobile/README.md Provides a quick start guide for using VelesDB on Android with Kotlin. This example shows database opening, collection creation, vector insertion, and similarity search operations. Asynchronous operations like search should be handled using coroutines (e.g., Dispatchers.IO). ```kotlin import com.velesdb.mobile.* // Open database val db = VelesDatabase.open("${context.filesDir}/velesdb") // Create collection db.createCollection("documents", 384u, DistanceMetric.COSINE) // Get collection val collection = db.getCollection("documents") ?: throw Exception("Collection not found") // Insert vectors val point = VelesPoint( id = 1uL, vector = embedding, // List from your embedding model payload = """{"title": "Hello World"}""" ) collection.upsert(point) // Search (use Dispatchers.IO for async) val results = withContext(Dispatchers.IO) { collection.search(queryEmbedding, 10u) } results.forEach { result -> println("ID: ${result.id}, Score: ${result.score}") } ``` -------------------------------- ### Use VelesDB in Swift (iOS) Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Example of how to use the VelesDB Swift bindings to open a database, create a collection, and perform vector searches. Assumes VelesDB Swift bindings are generated and imported. ```swift import VelesDB let db = try VelesDatabase.open(path: documentsPath + "/velesdb") try db.createCollection(name: "docs", dimension: 384, metric: .cosine) let collection = try db.getCollection(name: "docs")! let results = try collection.search(vector: embedding, limit: 10) ``` -------------------------------- ### Install VelesDB using One-liner Script (Linux/macOS) Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Installs VelesDB on Linux or macOS by downloading and executing an installation script from a GitHub raw URL. This is a convenient way to get VelesDB up and running quickly. ```bash curl -fsSL https://raw.githubusercontent.com/cyberlife-coder/VelesDB/main/scripts/install.sh | bash ``` -------------------------------- ### Install VelesDB using Docker Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md This command runs VelesDB as a Docker container. It maps port 8080 and mounts a volume for data persistence. This is the recommended installation method for ease of use. ```bash docker run -d \ --name velesdb \ -p 8080:8080 \ -v velesdb_data:/data \ langju/velesdb:latest ``` -------------------------------- ### Install VelesDB using One-liner Script (Windows PowerShell) Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Installs VelesDB on Windows using PowerShell by downloading and executing an installation script. This method provides a quick setup for Windows users. ```powershell irm https://raw.githubusercontent.com/cyberlife-coder/VelesDB/main/scripts/install.ps1 | iex ``` -------------------------------- ### Use VelesDB in Kotlin (Android) Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Example of how to use the VelesDB Kotlin bindings to open a database, create a collection, and perform vector searches. Assumes VelesDB Kotlin bindings are generated and available. ```kotlin val db = VelesDatabase.open("${context.filesDir}/velesdb") db.createCollection("docs", 384u, DistanceMetric.COSINE) val collection = db.getCollection("docs")!! val results = collection.search(embedding, 10u) ``` -------------------------------- ### Start Local Server with Node.js Source: https://github.com/cyberlife-coder/velesdb/blob/main/examples/wasm-browser-demo/README.md Starts a local HTTP server using the 'serve' package, commonly used with Node.js. This command serves the current directory, making the VelesDB WASM demo accessible locally. It requires Node.js and the 'serve' package to be installed. ```bash npx serve . ``` -------------------------------- ### Install VelesDB on Linux using One-liner Script Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB on Linux using a convenient one-liner script. This script downloads and executes the installation process. ```bash curl -fsSL https://raw.githubusercontent.com/cyberlife-coder/VelesDB/main/scripts/install.sh | bash ``` -------------------------------- ### Start API Server (Bash) Source: https://github.com/cyberlife-coder/velesdb/blob/main/demos/rag-pdf-demo/README.md Starts the FastAPI application server for the demo. It reloads automatically on code changes and runs on port 8000. This command is typically run after installing dependencies. ```bash uvicorn src.main:app --reload --port 8000 ``` -------------------------------- ### Install VelesDB SDKs for Browser Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs the necessary packages for using VelesDB in a browser environment. This includes the WASM module, the full TypeScript SDK, and Tauri plugin bindings. ```bash # WASM module for browser npm install @wiscale/velesdb-wasm # Full TypeScript SDK npm install @wiscale/velesdb-sdk # Tauri plugin bindings npm install @wiscale/tauri-plugin-velesdb ``` -------------------------------- ### Start VelesDB Server (Bash) Source: https://github.com/cyberlife-coder/velesdb/blob/main/demos/rag-pdf-demo/README.md Command to start the VelesDB server. It requires a data directory for storage. Ensure VelesDB is installed and accessible in your PATH. ```bash velesdb-server --data-dir ./rag-data ``` -------------------------------- ### Install and Use VelesDB Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-migrate/README.md Provides commands to install VelesDB using Cargo, migrate data from a source like Qdrant, query data using VelesQL, and start the VelesDB REST API server. ```bash cargo install velesdb velesdb-migrate detect --source qdrant --url http://localhost:6333 --collection my_data velesdb-migrate run --config migration.yaml velesdb query "SELECT id, title FROM my_data ORDER BY vector <-> [0.1, 0.2, ...] LIMIT 10" velesdb serve --port 8080 ``` -------------------------------- ### Start Docker Compose and Run Benchmark (Bash) Source: https://github.com/cyberlife-coder/velesdb/blob/main/benchmarks/README.md This command sequence starts the VelesDB and pgvector services using Docker Compose and then executes a benchmark script. It's useful for setting up a fair client-server comparison environment. Ensure Docker and Docker Compose are installed and the necessary images are built. ```bash docker-compose up -d --build python benchmark_docker.py --vectors 5000 --clusters 25 ``` -------------------------------- ### Set up Rust Targets for Mobile Development Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Configures the Rust toolchain with necessary targets for building VelesDB mobile applications for both iOS and Android platforms. Includes device, simulator, and various Android architectures. ```bash # iOS targets rustup target add aarch64-apple-ios # Device rustup target add aarch64-apple-ios-sim # Simulator (ARM) rustup target add x86_64-apple-ios # Simulator (Intel) # Android targets rustup target add aarch64-linux-android # ARM64 rustup target add armv7-linux-androideabi # ARMv7 rustup target add x86_64-linux-android # x86_64 # Android NDK tool cargo install cargo-ndk ``` -------------------------------- ### Quick Start with VelesDB and Langchain Source: https://github.com/cyberlife-coder/velesdb/blob/main/integrations/langchain/README.md Initialize a VelesDB vector store, add text documents, and perform a similarity search. This example demonstrates the basic workflow for using VelesDB with Langchain for semantic search. ```python from langchain_velesdb import VelesDBVectorStore from langchain_openai import OpenAIEmbeddings # Initialize vector store vectorstore = VelesDBVectorStore( path="./my_vectors", collection_name="documents", embedding=OpenAIEmbeddings() ) # Add documents vectorstore.add_texts([ "VelesDB is a high-performance vector database", "Built entirely in Rust for speed and safety", "Perfect for RAG applications and semantic search" ]) # Search results = vectorstore.similarity_search("fast database", k=2) for doc in results: print(doc.page_content) ``` -------------------------------- ### VelesDB Migration CLI: Command Examples Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-migrate/README.md This provides practical examples of using the VelesDB migration CLI. It demonstrates how to generate configuration files for various source types (Supabase, Qdrant, ChromaDB, etc.), check source schemas, perform dry runs before actual migration, execute full migrations with verbose logging, and override the batch size. ```bash # Generate config for each source type velesdb-migrate init --source supabase --output supabase.yaml velesdb-migrate init --source pgvector --output pgvector.yaml velesdb-migrate init --source qdrant --output qdrant.yaml velesdb-migrate init --source pinecone --output pinecone.yaml velesdb-migrate init --source weaviate --output weaviate.yaml velesdb-migrate init --source milvus --output milvus.yaml velesdb-migrate init --source chromadb --output chromadb.yaml # Check source schema before migration velesdb-migrate schema --config migration.yaml # Dry run (recommended before actual migration) velesdb-migrate run --config migration.yaml --dry-run # Full migration with verbose output velesdb-migrate run --config migration.yaml --verbose # Override batch size for testing velesdb-migrate run --config migration.yaml --batch-size 100 ``` -------------------------------- ### Run Mini Recommender System (Rust) Source: https://github.com/cyberlife-coder/velesdb/blob/main/examples/README.md A complete product recommendation system implemented in Rust. This example covers collection creation, product ingestion, similarity search, filtered recommendations, VelesQL query parsing, and catalog analytics. ```bash cd examples/mini_recommender cargo run ``` -------------------------------- ### Install VelesDB Python Package Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-python/README.md Installs the velesdb Python package using pip. This is the primary method for getting started with the VelesDB Python bindings. ```bash pip install velesdb ``` -------------------------------- ### Start VelesDB Server with Custom Options Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-server/README.md Demonstrates how to start the VelesDB server with a custom port and data directory, and how to enable logging. These options allow for flexible configuration of the server's runtime environment. ```bash # Start server on default port 8080 velesdb-server # Custom port and data directory velesdb-server --port 9000 --data ./my_vectors # With logging RUST_LOG=info velesdb-server ``` -------------------------------- ### Run Multi-model Search Example in Rust Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Navigates to the Rust examples directory and runs the multi-model search example. This demonstrates VelesDB's capabilities within a Rust environment. ```bash cd examples/rust && cargo run ``` -------------------------------- ### Verify VelesDB Installation Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md This command uses curl to check if the VelesDB server is running by sending a request to the /health endpoint. A successful response indicates the server is operational. ```bash curl http://localhost:8080/health ``` -------------------------------- ### VelesDB Development Setup and Testing in Bash Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Provides bash commands for setting up the VelesDB development environment. This includes cloning the repository, running tests, and performing code formatting and linting checks to ensure code quality before committing. ```bash # Clone the repo git clone https://github.com/cyberlife-coder/VelesDB.git cd VelesDB # Run tests cargo test --all-features # Run with checks (before committing) cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings ``` -------------------------------- ### Start VelesDB Server and CLI Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Provides commands to start the VelesDB REST API server and interact with the VelesQL REPL. It also shows how to verify the server's health status. ```bash # Start the REST API server (data persisted in ./data) velesdb-server --data-dir ./my_data # Or use the interactive CLI with VelesQL REPL velesdb repl # Verify server is running curl http://localhost:8080/health # {"status":"healthy","version":"1.1.0"} ``` -------------------------------- ### GitHub Actions configuration for nightly fuzzing Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/FUZZING.md An example GitHub Actions workflow that runs VelesDB fuzzers nightly. It installs cargo-fuzz, runs the VelesQL parser fuzzer for 5 minutes, and uploads any found crashes. ```yaml fuzz: name: Fuzzing (Nightly) runs-on: ubuntu-latest if: github.event_name == 'schedule' steps: - uses: actions/checkout@v4 - name: Install cargo-fuzz run: cargo install cargo-fuzz - name: Run VelesQL parser fuzzer run: | cd fuzz cargo +nightly fuzz run fuzz_velesql_parser -- -max_total_time=300 - name: Upload crashes if: failure() uses: actions/upload-artifact@v4 with: name: fuzz-crashes path: fuzz/artifacts/ ``` -------------------------------- ### Install Frontend Dependencies and Tailwind CSS Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/tutorials/tauri-rag-app/README.md Sets up the React frontend by installing core dependencies, icon library (lucide-react), and configuring Tailwind CSS for styling. This involves installing packages and initializing Tailwind. ```bash npm install npm install lucide-react npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p ``` -------------------------------- ### Resolve 'Port already in use' Error for VelesDB Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Offers solutions for the 'Port already in use' error when starting VelesDB. Includes options to use a different port or find and kill the process occupying the port. ```bash # Use different port velesdb-server --port 8081 # Or find and kill existing process lsof -i :8080 kill ``` -------------------------------- ### Installing VelesDB CLI (Rust) Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md This command shows how to install the VelesDB command-line interface (CLI) tool. The CLI provides an interactive REPL for executing VelesQL queries, allowing for direct interaction with the database. ```bash cargo install velesdb-cli ``` -------------------------------- ### Run E-commerce Recommendation Demo (Rust) Source: https://github.com/cyberlife-coder/velesdb/blob/main/examples/README.md This example demonstrates VelesDB's combined Vector, Graph, and MultiColumn capabilities with a large e-commerce dataset. It involves setting up a demo with 5,000 products, graph edges, simulated users, and showcases four query types: Vector, Filtered, Graph, and Combined. ```bash cd examples/ecommerce_recommendation cargo run --release ``` -------------------------------- ### Initialize Tauri Application with Plugins and Commands Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/tutorials/tauri-rag-app/README.md Sets up the main Rust entry point for the Tauri application. It initializes the shell and VelesDB plugins and registers command handlers for ingestion, search, stats, and index clearing. ```rust #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] mod commands; fn main() { tauri::Builder::default() .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_velesdb::init()) .invoke_handler(tauri::generate_handler![ commands::ingest_text, commands::search, commands::get_stats, commands::clear_index, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } ``` -------------------------------- ### Install VelesDB on Windows using MSI (Silent) Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB on Windows silently using the MSI installer. Supports options for PATH modification and custom installation directories. Requires administrator privileges. ```powershell msiexec /i velesdb-0.6.0-x86_64.msi /quiet ADDTOPATH=1 msiexec /i velesdb-0.6.0-x86_64.msi /quiet ADDTOPATH=0 msiexec /i velesdb-0.6.0-x86_64.msi /quiet APPLICATIONFOLDER="D:\VelesDB" ``` -------------------------------- ### Install VelesDB Rust Crates Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB components in a Rust project. Includes instructions for adding the core library as a dependency and installing CLI tools via Cargo. ```toml # Cargo.toml [dependencies] velesdb-core = "0.3" ``` ```bash # Install CLI (includes REPL) cargo install velesdb-cli # Install Server cargo install velesdb-server ``` -------------------------------- ### Install VelesDB Python Package Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs the VelesDB Python package using pip. This allows for programmatic interaction with VelesDB within Python applications. ```bash pip install velesdb ``` ```python import velesdb # Open or create database db = velesdb.Database("./my_vectors") # Create collection collection = db.create_collection("documents", dimension=768, metric="cosine") # Insert vectors collection.upsert([ {"id": 1, "vector": [...], "payload": {"title": "Hello World"}} ]) # Search results = collection.search(query_vector, top_k=10) ``` -------------------------------- ### Install VelesDB on Linux using DEB Package Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB on Debian-based Linux distributions using a DEB package. This method installs the CLI and server binaries to standard system locations. ```bash # Download wget https://github.com/cyberlife-coder/VelesDB/releases/download/v0.6.0/velesdb-0.6.0-amd64.deb # Install sudo dpkg -i velesdb-0.6.0-amd64.deb # Verify velesdb --version velesdb-server --version ``` -------------------------------- ### Installing VelesDB Migration Tool (Rust) Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md This command installs the VelesDB migration tool, which assists in migrating data from other vector databases like Qdrant, Pinecone, and Supabase to VelesDB. This simplifies the transition process for users. ```bash cargo install velesdb-migrate ``` -------------------------------- ### Run Python REST API Client Example Source: https://github.com/cyberlife-coder/velesdb/blob/main/examples/README.md A simple HTTP client example for interacting with the VelesDB server via its REST API. Requires a VelesDB server to be running beforehand. ```bash # Start VelesDB server first velesdb-server -d ./data # Run example python examples/python_example.py ``` -------------------------------- ### VelesQL Query Examples Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-cli/README.md Demonstrates various ways to perform combined vector, metadata, and text searches using VelesQL. ```APIDOC ## VelesQL Query Examples ### Description This section provides examples of how to perform combined searches using VelesQL, including vector search with metadata filters, hybrid search (vector + full-text), and complex conditional queries. ### Examples **Vector Search + Metadata Filter** ```sql -- Vector search + metadata filter SELECT * FROM documents WHERE VECTOR NEAR [0.15, 0.25, ...] AND category = 'tech' AND views > 100 LIMIT 5; ``` **Hybrid Search (Vector + Full-Text)** ```sql -- Hybrid search (vector + full-text) SELECT * FROM documents WHERE VECTOR NEAR $query AND content MATCH 'rust' LIMIT 5; ``` **Complex Conditions** ```sql -- Complex conditions SELECT * FROM products WHERE VECTOR NEAR COSINE [0.1, 0.2, ...] AND (category = 'electronics' OR category = 'gadgets') AND price BETWEEN 100 AND 500 AND in_stock = true LIMIT 10; ``` **Semantic Search Examples** ```sql -- Search with metadata filter SELECT id, score, payload->title FROM articles WHERE VECTOR NEAR $query_embedding AND category = 'technology' LIMIT 5; -- Search with multiple conditions SELECT * FROM documents WHERE VECTOR NEAR [0.1, 0.2, 0.3, ...] AND status = 'published' AND views > 1000 LIMIT 10; ``` **Binary Vector Search** ```sql -- Find similar binary vectors (fingerprints, hashes) SELECT * FROM images WHERE VECTOR NEAR [1.0, 0.0, 1.0, 1.0, 0.0, ...] LIMIT 10; ``` ``` -------------------------------- ### Install VelesDB on Linux using Portable Tarball Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB on Linux using a portable tarball. This method extracts VelesDB to a specified directory and requires manual PATH configuration. ```bash # Download and extract wget https://github.com/cyberlife-coder/VelesDB/releases/download/v0.6.0/velesdb-linux-x86_64.tar.gz tar -xzf velesdb-linux-x86_64.tar.gz -C /opt/velesdb # Add to PATH echo 'export PATH=$PATH:/opt/velesdb' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Rust Project Setup for VelesDB Recommender Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/TUTORIALS/MINI_RECOMMENDER.md This snippet demonstrates how to set up a new Rust project and add necessary dependencies for VelesDB integration. It includes creating a new cargo project and modifying the Cargo.toml file to include 'velesdb-core' and 'serde_json'. ```bash cargo new mini_recommender cd mini_recommender ``` ```toml [package] name = "mini_recommender" version = "0.1.0" edition = "2021" [dependencies] velesdb-core = "1.3" serde_json = "1.0" ``` -------------------------------- ### Install VelesDB on Windows using Portable ZIP Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Installs VelesDB on Windows using a portable ZIP archive. This method does not require administrator privileges and allows for manual PATH configuration. ```powershell # Download and extract Invoke-WebRequest -Uri "https://github.com/cyberlife-coder/VelesDB/releases/download/v0.6.0/velesdb-windows-x86_64.zip" -OutFile velesdb.zip Expand-Archive velesdb.zip -DestinationPath C:\VelesDB # Add to PATH (optional, current session only) $env:PATH += ";C:\VelesDB" # Or add permanently via System Properties > Environment Variables ``` -------------------------------- ### Run Multi-Model Search Example (Rust) Source: https://github.com/cyberlife-coder/velesdb/blob/main/examples/README.md Demonstrates advanced multi-model search queries in Rust, combining vector similarity search, graph traversal, custom ORDER BY expressions, and hybrid search (vector + BM25 text). ```bash cd examples/rust cargo run --bin multimodel_search ``` -------------------------------- ### Install Rust, Node.js, and Tauri CLI Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/tutorials/tauri-rag-app/README.md Installs the necessary tools for building the Tauri application. Requires Rust (1.70+), Node.js (18+), and the Tauri CLI. System dependencies vary by OS. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Node.js (18+) # Download from https://nodejs.org/ cargo install tauri-cli ``` -------------------------------- ### Install cargo-fuzz and Rust Nightly Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/FUZZING.md Installs the necessary Rust toolchain and the cargo-fuzz utility, which is required for running fuzz tests with libFuzzer. ```bash # Install Rust nightly (required for cargo-fuzz) rustup install nightly # Install cargo-fuzz cargo install cargo-fuzz ``` -------------------------------- ### Uninstall VelesDB on Linux using DEB Package Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Uninstalls VelesDB from Debian-based Linux distributions when installed via a DEB package. ```bash sudo dpkg -r velesdb ``` -------------------------------- ### Install VelesDB CLI from Source Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-cli/README.md Installs the VelesDB CLI by cloning the repository and building from source. This method is useful for development or when you need the latest unreleased features. ```bash git clone https://github.com/cyberlife-coder/VelesDB cd VelesDB cargo install --path crates/velesdb-cli ``` -------------------------------- ### Uninstall VelesDB on Windows using MSI Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/guides/INSTALLATION.md Uninstalls VelesDB on Windows silently using the MSI installer. This command can be run from the command line or a script. ```powershell msiexec /x velesdb-0.6.0-x86_64.msi /quiet ``` -------------------------------- ### Collection Management Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md Endpoints for creating and managing collections in VelesDB. ```APIDOC ## POST /collections ### Description Creates a new collection in VelesDB. Collections are containers for vectors with the same dimension. ### Method POST ### Endpoint /collections ### Parameters #### Request Body - **name** (string) - Required - The name of the collection. - **dimension** (integer) - Required - The dimension of the vectors in this collection. - **metric** (string) - Required - The distance metric to use for similarity searches (e.g., "cosine", "euclidean"). ### Request Example ```json { "name": "my_documents", "dimension": 384, "metric": "cosine" } ``` ### Response #### Success Response (200) (Details not provided in source text, typically returns confirmation of creation or collection details.) #### Response Example (Not provided in source text) ``` -------------------------------- ### Health Check Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md Check the health status of the VelesDB server. ```APIDOC ## GET /health ### Description Checks if the VelesDB server is running and healthy. ### Method GET ### Endpoint /health ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - The health status of the server (e.g., "healthy"). - **version** (string) - The current version of VelesDB. #### Response Example ```json { "status": "healthy", "version": "1.3.1" } ``` ``` -------------------------------- ### VelesQL Query Example Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Shows how to execute a VelesQL query to search for vectors within a collection, using a `NEAR` clause and parameters. This allows for more complex filtering and retrieval logic. The response includes search results and query performance metrics. ```bash curl -X POST http://localhost:8080/query \ -H "Content-Type: application/json" \ -d '{ "query": "SELECT * FROM my_vectors WHERE vector NEAR $v LIMIT 10", "params": {"v": [0.1, 0.2, 0.3, ...]} }' ``` -------------------------------- ### Vector Operations Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md Endpoints for inserting and searching vectors within a collection. ```APIDOC ## POST /collections/{collection_name}/points ### Description Inserts one or more vectors (points) into a specified collection. Each point can include an ID, the vector data, and associated metadata (payload). ### Method POST ### Endpoint /collections/{collection_name}/points ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to insert points into. #### Request Body - **points** (array) - Required - An array of point objects to insert. - **id** (integer or string) - Required - A unique identifier for the point. - **vector** (array of floats) - Required - The vector data. - **payload** (object) - Optional - Metadata associated with the vector. ### Request Example ```json { "points": [ { "id": 1, "vector": [0.1, 0.2, 0.3, ...], "payload": {"title": "Introduction to AI", "category": "tech"} }, { "id": 2, "vector": [0.4, 0.5, 0.6, ...], "payload": {"title": "Machine Learning Guide", "category": "tech"} } ] } ``` ### Response #### Success Response (200) (Details not provided in source text, typically returns confirmation of insertion.) #### Response Example (Not provided in source text) ``` ```APIDOC ## POST /collections/{collection_name}/search ### Description Searches a collection for vectors similar to a given query vector. Returns the top K most similar results based on the collection's defined metric. ### Method POST ### Endpoint /collections/{collection_name}/search ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to search within. #### Request Body - **vector** (array of floats) - Required - The query vector to find similar vectors to. - **top_k** (integer) - Required - The number of most similar results to return. ### Request Example ```json { "vector": [0.15, 0.25, 0.35, ...], "top_k": 5 } ``` ### Response #### Success Response (200) - **results** (array) - An array of search results. - **id** (integer or string) - The ID of the matching point. - **score** (float) - The similarity score between the query vector and the found vector. - **payload** (object) - The payload associated with the found vector. #### Response Example ```json { "results": [ {"id": 1, "score": 0.98, "payload": {"title": "Introduction to AI"}}, {"id": 2, "score": 0.85, "payload": {"title": "Machine Learning Guide"}} ] } ``` ``` -------------------------------- ### VelesDB Python Client Usage Source: https://github.com/cyberlife-coder/velesdb/blob/main/README.md Demonstrates basic usage of the VelesDB Python client. It shows how to initialize a database, create a collection with specified dimensions and metric, upsert data with vectors and payloads, and perform a vector search. ```python import velesdb db = velesdb.Database("./my_vectors") collection = db.create_collection("docs", dimension=768, metric="cosine") collection.upsert([{"id": 1, "vector": [...], "payload": {"title": "Hello"}}]) results = collection.search([...], top_k=10) ``` -------------------------------- ### Install VelesDB CLI from Crates.io Source: https://github.com/cyberlife-coder/velesdb/blob/main/crates/velesdb-cli/README.md Installs the VelesDB CLI using Cargo, the Rust package manager. This is the simplest way to get the CLI if you have Rust and Cargo set up. ```bash cargo install velesdb-cli ``` -------------------------------- ### Sequential vs. Parallel Benchmark Execution Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/contributing/BENCHMARKING_GUIDE.md Illustrates the correct method for running multiple benchmarks sequentially to avoid resource contention and ensure accurate measurements. Running benchmarks in parallel using '&' is shown as an anti-pattern that can lead to inaccurate results due to interference between benchmark processes. ```bash # ✅ Good: Sequential cargo bench --bench simd_benchmark cargo bench --bench filter_benchmark # ❌ Bad: Parallel (causes resource contention) cargo bench --bench simd_benchmark & cargo bench --bench filter_benchmark & ``` -------------------------------- ### Text and Hybrid Search Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md Endpoints for performing text-based and combined vector/text searches. ```APIDOC ## POST /collections/{collection_name}/search/text ### Description Performs a full-text search (using BM25) on a collection to find documents relevant to a given text query. ### Method POST ### Endpoint /collections/{collection_name}/search/text ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to search within. #### Request Body - **query** (string) - Required - The text query to search for. - **top_k** (integer) - Required - The number of top results to return. ### Request Example ```json { "query": "machine learning", "top_k": 5 } ``` ### Response #### Success Response (200) (Details not provided in source text, expected to return search results similar to vector search.) #### Response Example (Not provided in source text) ``` ```APIDOC ## POST /collections/{collection_name}/search/hybrid ### Description Performs a hybrid search, combining vector similarity search with text relevance (BM25) to find the most relevant results. ### Method POST ### Endpoint /collections/{collection_name}/search/hybrid ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to search within. #### Request Body - **vector** (array of floats) - Required - The query vector for similarity search. - **query** (string) - Required - The text query for full-text search. - **top_k** (integer) - Required - The number of top results to return. - **vector_weight** (float) - Optional - The weight to give to the vector similarity score in the combined ranking (default might be 0.5). ### Request Example ```json { "vector": [0.15, 0.25, 0.35, ...], "query": "machine learning", "top_k": 5, "vector_weight": 0.7 } ``` ### Response #### Success Response (200) (Details not provided in source text, expected to return search results combining both search types.) #### Response Example (Not provided in source text) ``` -------------------------------- ### Knowledge Graph Operations Source: https://github.com/cyberlife-coder/velesdb/blob/main/docs/getting-started.md Endpoints for managing and traversing graph data within VelesDB. ```APIDOC ## POST /collections/{collection_name}/graph/edges ### Description Adds an edge to the knowledge graph within a specified collection. Edges represent relationships between vectors (nodes). ### Method POST ### Endpoint /collections/{collection_name}/graph/edges ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection containing the graph data. #### Request Body - **id** (integer or string) - Required - The ID of the edge. - **source** (integer or string) - Required - The ID of the source node (vector). - **target** (integer or string) - Required - The ID of the target node (vector). - **label** (string) - Required - The type or label of the relationship (e.g., "RELATES_TO"). - **properties** (object) - Optional - Additional properties for the edge (e.g., weight). ### Request Example ```json { "id": 1, "source": 100, "target": 200, "label": "RELATES_TO", "properties": {"weight": 0.8} } ``` ### Response #### Success Response (200) (Details not provided in source text, typically returns confirmation of edge creation.) #### Response Example (Not provided in source text) ``` ```APIDOC ## POST /collections/{collection_name}/graph/traverse ### Description Traverses the knowledge graph starting from a given source node, following defined relationships up to a specified depth. ### Method POST ### Endpoint /collections/{collection_name}/graph/traverse ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection containing the graph data. #### Request Body - **source** (integer or string) - Required - The ID of the node to start the traversal from. - **strategy** (string) - Required - The traversal strategy (e.g., "bfs" for Breadth-First Search). - **max_depth** (integer) - Required - The maximum depth to traverse. - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ```json { "source": 100, "strategy": "bfs", "max_depth": 3, "limit": 50 } ``` ### Response #### Success Response (200) - **results** (array) - An array of traversal results. - **target_id** (integer or string) - The ID of the node reached. - **depth** (integer) - The depth at which the node was reached. - **path** (array) - The sequence of node IDs forming the path from the source. - **stats** (object) - Statistics about the traversal. - **visited** (integer) - The number of nodes visited. - **depth_reached** (integer) - The maximum depth reached during traversal. #### Response Example ```json { "results": [ {"target_id": 200, "depth": 1, "path": [100, 200]}, {"target_id": 300, "depth": 2, "path": [100, 200, 300]} ], "stats": {"visited": 2, "depth_reached": 2} } ``` ```