{"_id":"@aigentic/rvf","_rev":"3-b3dc73e65874701dd6ca764e34785a00","name":"@aigentic/rvf","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.1":{"name":"@aigentic/rvf","version":"0.2.1","keywords":["vector","database","binary-format","hnsw","simd","rvf"],"license":"MIT","_id":"@aigentic/rvf@0.2.1","maintainers":[{"name":"aigentic","email":"engineering@aigentic.net"}],"homepage":"https://github.com/ruvnet/ruvector#readme","bugs":{"url":"https://github.com/ruvnet/ruvector/issues"},"dist":{"shasum":"7a532ef9fa5a6de14fdacbf4e50cccf1edcb25b3","tarball":"https://registry.npmjs.org/@aigentic/rvf/-/rvf-0.2.1.tgz","fileCount":17,"integrity":"sha512-/WUsCn3xDtW3L9PKA4iRdHothB1/PPqk+anpr/dVviRN91E6rIACLueMz1pakj6Qp1qlLQZRpWMcW6KkXw02wA==","signatures":[{"sig":"MEUCIBBDBDsqYz/vPPt7jhdC6R8SR02yS5jKqH+e/xtoVw3TAiEA5m/ZlwPiA+UzJmV/uXPnHzcJ/Oy0hso7VlNonxTtKdk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":115880},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"06426cbc6e70f09762e996a98517b0b1fd1c7c4e","scripts":{"test":"jest","bench":"tsx bench/index.ts","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"aigentic","email":"engineering@aigentic.net"},"repository":{"url":"git+https://github.com/ruvnet/ruvector.git","type":"git"},"_npmVersion":"11.12.0","description":"RuVector Format — unified TypeScript SDK for vector intelligence","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@aigentic/rvf-node":"^0.1.7"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"optionalDependencies":{"@aigentic/rvf-wasm":"^0.1.5","@aigentic/rvf-solver":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/rvf_0.2.1_1779091188724_0.7191833531290364","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@aigentic/rvf","version":"0.2.2","keywords":["vector","database","binary-format","hnsw","simd","rvf"],"license":"MIT","_id":"@aigentic/rvf@0.2.2","maintainers":[{"name":"aigentic","email":"engineering@aigentic.net"}],"homepage":"https://github.com/ruvnet/ruvector#readme","bugs":{"url":"https://github.com/ruvnet/ruvector/issues"},"dist":{"shasum":"449b6b4ea7b765759e60cf09733c892e7fc5660a","tarball":"https://registry.npmjs.org/@aigentic/rvf/-/rvf-0.2.2.tgz","fileCount":17,"integrity":"sha512-VdAwskHnwbK7TZdIYsNX+7b7pXCTd+F3JrzictzeVBQuwQyJVmfSNOHdoSVsQSIT+v41QcZseF8I6cenwQMdXg==","signatures":[{"sig":"MEUCIQCO/jvuG2M3lNCqTnG4aXzkAZdCVKmozJ52x/E6IXdjUgIgOcKBmf9KZgLiYC8phkaWEUGaA7NDXeL3LSO1NUnCg38=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":115880},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"06426cbc6e70f09762e996a98517b0b1fd1c7c4e","scripts":{"test":"jest","bench":"tsx bench/index.ts","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"aigentic","email":"engineering@aigentic.net"},"repository":{"url":"git+https://github.com/ruvnet/ruvector.git","type":"git"},"_npmVersion":"11.12.0","description":"RuVector Format — unified TypeScript SDK for vector intelligence","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@aigentic/rvf-node":"^0.1.9"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"optionalDependencies":{"@aigentic/rvf-wasm":"^0.1.7","@aigentic/rvf-solver":"^0.1.9"},"_npmOperationalInternal":{"tmp":"tmp/rvf_0.2.2_1779093047834_0.05677319359856403","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-18T07:59:48.635Z","modified":"2026-09-13T15:30:36.515Z","0.2.1":"2026-05-18T07:59:48.862Z","0.2.2":"2026-05-18T08:30:48.010Z"},"bugs":{"url":"https://github.com/ruvnet/ruvector/issues"},"license":"MIT","homepage":"https://github.com/ruvnet/ruvector#readme","keywords":["vector","database","binary-format","hnsw","simd","rvf"],"repository":{"url":"git+https://github.com/ruvnet/ruvector.git","type":"git"},"description":"RuVector Format — unified TypeScript SDK for vector intelligence","maintainers":[{"email":"engineering@aigentic.net","name":"aiggy"}],"readme":"# @ruvector/rvf\n\nUnified TypeScript/JavaScript SDK for the **RuVector Format (RVF)** — a cognitive container that stores vectors, carries models, boots compute kernels, and proves everything in a single `.rvf` file.\n\n## Platform Support\n\n| Platform | Runtime | Backend | Status |\n|----------|---------|---------|--------|\n| Linux x86_64 | Node.js 18+ | Native (N-API) | Stable |\n| Linux aarch64 | Node.js 18+ | Native (N-API) | Stable |\n| macOS x86_64 | Node.js 18+ | Native (N-API) | Stable |\n| macOS arm64 (Apple Silicon) | Node.js 18+ | Native (N-API) | Stable |\n| Windows x86_64 | Node.js 18+ | Native (N-API) | Stable |\n| Any | Deno | WASM | Supported |\n| Any | Browser (Chrome, Firefox, Safari) | WASM | Supported |\n| Any | Cloudflare Workers / Edge | WASM | Supported |\n| Any | Bun | Native (N-API) | Experimental |\n\n**Deno**: The WASM build targets `wasm32-unknown-unknown`, which runs natively in Deno. Import via `npm:` specifier or load the `.wasm` bundle directly.\n\n**Browser**: The `@ruvector/rvf-wasm` package provides a ~46 KB control-plane WASM module plus a ~5.5 KB tile-compute module. Works in any browser with WebAssembly support.\n\n## Install\n\n```bash\n# Node.js (auto-detects native or WASM)\nnpm install @ruvector/rvf\n\n# WASM only (browser, Deno, edge)\nnpm install @ruvector/rvf-wasm\n```\n\n## Quick Start\n\n### Node.js\n\n```typescript\nimport { RvfDatabase } from '@ruvector/rvf';\n\n// Create a vector store\nconst db = RvfDatabase.create('vectors.rvf', { dimension: 384 });\n\n// Insert vectors\ndb.ingestBatch(new Float32Array(384), [1]);\n\n// Query nearest neighbors\nconst results = db.query(new Float32Array(384), 10);\n\n// Lineage & inspection\nconsole.log(db.fileId());       // unique file UUID\nconsole.log(db.dimension());    // 384\nconsole.log(db.segments());     // [{ type, id, size }]\n\n// Derive child (COW branching)\nconst child = db.derive('child.rvf');\n\ndb.close();\n```\n\n### Browser (WASM)\n\n```html\n<script type=\"module\">\nimport init, { RvfStore } from '@ruvector/rvf-wasm';\n\nawait init();\n\nconst store = RvfStore.create(384, 'cosine');\nstore.ingest(new Float32Array(384), 0);\nconst results = store.query(new Float32Array(384), 10);\nconsole.log('Results:', results);\n</script>\n```\n\n### Deno\n\n```typescript\n// Import via npm: specifier\nimport init, { RvfStore } from \"npm:@ruvector/rvf-wasm\";\n\nawait init();\n\nconst store = RvfStore.create(384, 'cosine');\nstore.ingest(new Float32Array(384), 0);\nconst results = store.query(new Float32Array(384), 10);\nconsole.log('Results:', results);\n```\n\n## What is RVF?\n\nRVF (RuVector Format) is a universal binary substrate that merges database, model, graph engine, kernel, and attestation into a single deployable file. A `.rvf` file is segmented — each segment carries a different payload type, and unknown segments are preserved by all tools.\n\n### Segment Types\n\n| ID | Segment | Description |\n|----|---------|-------------|\n| 0x00 | MANIFEST_SEG | Level0Root manifest with file metadata |\n| 0x01 | VEC_SEG | Raw vector data (f32, f16, bf16, int8) |\n| 0x02 | INDEX_SEG | HNSW graph for approximate nearest neighbor |\n| 0x03 | META_SEG | Vector metadata (JSON, CBOR) |\n| 0x04 | QUANT_SEG | Quantization codebooks |\n| 0x05 | OVERLAY_SEG | LoRA/adapter weight overlays |\n| 0x06 | GRAPH_SEG | Property graph adjacency data |\n| 0x07 | TENSOR_SEG | Dense tensor data |\n| 0x08 | WASM_SEG | Embedded WASM modules |\n| 0x09 | MODEL_SEG | ML model weights |\n| 0x0A | CRYPTO_SEG | Signatures and key material |\n| 0x0B | WITNESS_SEG | Append-only witness/audit chain |\n| 0x0C | CONFIG_SEG | Runtime configuration |\n| 0x0D | CUSTOM_SEG | User-defined segment |\n| 0x0E | KERNEL_SEG | Linux microkernel image |\n| 0x0F | EBPF_SEG | eBPF programs |\n| 0x20 | COW_MAP_SEG | Copy-on-write cluster map |\n| 0x21 | REFCOUNT_SEG | Cluster reference counts |\n| 0x22 | MEMBERSHIP_SEG | Branch membership filter |\n| 0x23 | DELTA_SEG | Sparse delta patches (LoRA) |\n\n## N-API Methods (Node.js)\n\n19 methods on the `RvfDatabase` class:\n\n| Method | Description |\n|--------|-------------|\n| `RvfDatabase.create(path, opts)` | Create new RVF file |\n| `RvfDatabase.open(path)` | Open existing (read-write) |\n| `RvfDatabase.openReadonly(path)` | Open existing (read-only) |\n| `db.ingestBatch(vectors, ids)` | Insert vectors by batch |\n| `db.query(vector, k)` | k-NN search |\n| `db.delete(ids)` | Delete vectors by ID |\n| `db.deleteByFilter(filter)` | Delete vectors matching filter |\n| `db.compact()` | Compact and reclaim space |\n| `db.status()` | File status (count, dimension, metric) |\n| `db.close()` | Close file handle |\n| `db.fileId()` | UUID of this file |\n| `db.parentId()` | UUID of parent (if derived) |\n| `db.lineageDepth()` | Derivation depth |\n| `db.derive(path)` | COW-branch to new file |\n| `db.embedKernel(bytes)` | Embed Linux kernel image |\n| `db.extractKernel()` | Extract kernel image |\n| `db.embedEbpf(bytes)` | Embed eBPF program |\n| `db.extractEbpf()` | Extract eBPF program |\n| `db.segments()` | List all segments |\n\n## WASM Exports\n\n29 exported functions for browser and edge runtimes:\n\n**Control plane** (10): `rvf_create`, `rvf_open`, `rvf_close`, `rvf_ingest`, `rvf_query`, `rvf_delete`, `rvf_status`, `rvf_compact`, `rvf_derive`, `rvf_segments`\n\n**Tile compute** (14): `tile_dot_f32`, `tile_cosine_f32`, `tile_l2_f32`, `tile_dot_f16`, `tile_cosine_f16`, `tile_l2_f16`, `tile_topk`, `tile_quantize_sq8`, `tile_dequantize_sq8`, `tile_scan_filtered`, `tile_merge_topk`, `tile_batch_distance`, `tile_prefetch`, `tile_accumulate`\n\n**Segment parsing** (3): `parse_segment_header`, `parse_vec_header`, `parse_manifest`\n\n**Memory** (2): `rvf_alloc`, `rvf_free`\n\n## CLI (Rust)\n\n18 subcommands available through the `rvf` binary:\n\n```bash\n# Core operations\nrvf create vectors.rvf --dimension 384 --metric cosine\nrvf ingest vectors.rvf --input data.json\nrvf query vectors.rvf --vector \"[0.1,0.2,...]\" --k 10\nrvf delete vectors.rvf --ids \"[1,2,3]\"\nrvf status vectors.rvf\nrvf inspect vectors.rvf\nrvf compact vectors.rvf\n\n# Branching & lineage\nrvf derive vectors.rvf --output child.rvf\nrvf filter vectors.rvf --include \"[1,2,3]\"\nrvf freeze vectors.rvf\nrvf rebuild-refcounts vectors.rvf\n\n# Compute containers\nrvf serve vectors.rvf --port 8080\nrvf launch vectors.rvf\nrvf embed-kernel vectors.rvf --image bzImage\nrvf embed-ebpf vectors.rvf --program filter.o\n\n# Verification\nrvf verify-witness vectors.rvf\nrvf verify-attestation vectors.rvf\n\n# Export\nrvf export vectors.rvf --output dump.json\n```\n\nBuild the CLI:\n\n```bash\ncargo install --path crates/rvf/rvf-cli\n```\n\n## Example .rvf Files\n\n45 pre-built example files are available for download (~11 MB total). These demonstrate every segment type and use case.\n\n### Download\n\n```bash\n# Download a specific example\ncurl -LO https://raw.githubusercontent.com/ruvnet/ruvector/main/examples/rvf/output/basic_store.rvf\n\n# Clone just the examples\ngit clone --depth 1 --filter=blob:none --sparse https://github.com/ruvnet/ruvector.git\ncd ruvector && git sparse-checkout set examples/rvf/output\n```\n\n### Example Catalog\n\n| File | Size | Description |\n|------|------|-------------|\n| `basic_store.rvf` | 152 KB | 1,000 vectors, dim 128, cosine metric |\n| `semantic_search.rvf` | 755 KB | Semantic search with HNSW index |\n| `rag_pipeline.rvf` | 303 KB | RAG pipeline with embeddings |\n| `embedding_cache.rvf` | 755 KB | Cached embedding store |\n| `quantization.rvf` | 1.5 MB | PQ-compressed vectors |\n| `progressive_index.rvf` | 2.5 MB | Large-scale progressive HNSW index |\n| `filtered_search.rvf` | 255 KB | Metadata-filtered vector search |\n| `recommendation.rvf` | 102 KB | Recommendation engine vectors |\n| `agent_memory.rvf` | 32 KB | AI agent episodic memory |\n| `swarm_knowledge.rvf` | 86 KB | Multi-agent shared knowledge base |\n| `experience_replay.rvf` | 27 KB | RL experience replay buffer |\n| `tool_cache.rvf` | 26 KB | MCP tool call cache |\n| `mcp_in_rvf.rvf` | 32 KB | MCP server embedded in RVF |\n| `ruvbot.rvf` | 51 KB | Chatbot knowledge store |\n| `claude_code_appliance.rvf` | 17 KB | Claude Code cognitive appliance |\n| `lineage_parent.rvf` | 52 KB | COW parent file |\n| `lineage_child.rvf` | 26 KB | COW child (derived) file |\n| `reasoning_parent.rvf` | 5.6 KB | Reasoning chain parent |\n| `reasoning_child.rvf` | 8.1 KB | Reasoning chain child |\n| `reasoning_grandchild.rvf` | 162 B | Minimal derived file |\n| `self_booting.rvf` | 31 KB | Self-booting with KERNEL_SEG |\n| `linux_microkernel.rvf` | 15 KB | Embedded Linux microkernel |\n| `ebpf_accelerator.rvf` | 153 KB | eBPF distance accelerator |\n| `browser_wasm.rvf` | 14 KB | Browser WASM module embedded |\n| `tee_attestation.rvf` | 102 KB | TEE attestation with witnesses |\n| `zero_knowledge.rvf` | 52 KB | ZK-proof witness chain |\n| `crypto_signed.rvf` | (see `sealed_engine.rvf`) | Signed + sealed |\n| `sealed_engine.rvf` | 208 KB | Sealed inference engine |\n| `access_control.rvf` | 77 KB | Permission-gated vectors |\n| `financial_signals.rvf` | 202 KB | Financial signal vectors |\n| `medical_imaging.rvf` | 302 KB | Medical imaging embeddings |\n| `legal_discovery.rvf` | 903 KB | Legal document discovery |\n| `multimodal_fusion.rvf` | 804 KB | Multi-modal embedding fusion |\n| `hyperbolic_taxonomy.rvf` | 23 KB | Hyperbolic space taxonomy |\n| `network_telemetry.rvf` | 16 KB | Network telemetry vectors |\n| `postgres_bridge.rvf` | 152 KB | PostgreSQL bridge vectors |\n| `ruvllm_inference.rvf` | 133 KB | RuvLLM inference cache |\n| `serverless.rvf` | 509 KB | Serverless deployment bundle |\n| `edge_iot.rvf` | 27 KB | Edge/IoT lightweight store |\n| `dedup_detector.rvf` | 153 KB | Deduplication detector |\n| `compacted.rvf` | 77 KB | Post-compaction example |\n| `posix_fileops.rvf` | 52 KB | POSIX file operations test |\n| `network_sync_a.rvf` | 52 KB | Network sync peer A |\n| `network_sync_b.rvf` | 52 KB | Network sync peer B |\n| `agent_handoff_a.rvf` | 31 KB | Agent handoff source |\n| `agent_handoff_b.rvf` | 11 KB | Agent handoff target |\n\n### Generate Examples Locally\n\n```bash\ncd crates/rvf\ncargo run --example generate_all\nls output/  # 45 .rvf files\n```\n\n## Integration\n\n### With `ruvector` (npx ruvector)\n\nThe `ruvector` npm package includes 8 RVF CLI commands:\n\n```bash\nnpm install ruvector @ruvector/rvf\n\n# Enable RVF backend\nexport RUVECTOR_BACKEND=rvf\n\n# Or use --backend flag\nnpx ruvector --backend rvf create mydb.rvf -d 384\n\n# RVF-specific commands\nnpx ruvector rvf create mydb.rvf -d 384\nnpx ruvector rvf ingest mydb.rvf --input data.json\nnpx ruvector rvf query mydb.rvf --vector \"[0.1,...]\" --k 10\nnpx ruvector rvf status mydb.rvf\nnpx ruvector rvf segments mydb.rvf\nnpx ruvector rvf derive mydb.rvf --output child.rvf\nnpx ruvector rvf compact mydb.rvf\nnpx ruvector rvf export mydb.rvf --output dump.json\n```\n\n### With `rvlite`\n\n```bash\nnpm install rvlite @ruvector/rvf-wasm\n```\n\nWhen `@ruvector/rvf-wasm` is installed, rvlite can use RVF as a persistent storage backend:\n\n```typescript\nimport { createRvLite } from 'rvlite';\n\n// rvlite auto-detects @ruvector/rvf-wasm for persistence\nconst db = await createRvLite({ dimensions: 384 });\nawait db.insert([0.1, 0.2, ...], { text: \"Hello world\" });\nconst results = await db.search([0.1, 0.2, ...], 5);\n```\n\n## Packages\n\n| Package | Description | Runtime |\n|---------|-------------|---------|\n| `@ruvector/rvf` | Unified SDK (this package) | Node.js |\n| `@ruvector/rvf-node` | Native N-API bindings | Node.js |\n| `@ruvector/rvf-wasm` | WASM build (~46 KB + ~5.5 KB tile) | Browser, Deno, Edge |\n| `@ruvector/rvf-mcp-server` | MCP server for AI agents | Node.js |\n\n## Crate Structure (Rust)\n\n| Crate | Description |\n|-------|-------------|\n| `rvf-types` | Wire types, segment headers, `no_std` compatible |\n| `rvf-wire` | Serialization/deserialization |\n| `rvf-manifest` | Level0Root manifest parsing |\n| `rvf-index` | HNSW index operations |\n| `rvf-quant` | Quantization codebooks |\n| `rvf-crypto` | Signing, verification, key management |\n| `rvf-runtime` | Full runtime (store, ingest, query, derive) |\n| `rvf-kernel` | Linux microkernel builder |\n| `rvf-launch` | QEMU launcher for self-booting files |\n| `rvf-ebpf` | eBPF compiler and loader |\n| `rvf-server` | HTTP API server (axum) |\n| `rvf-cli` | CLI binary |\n| `rvf-import` | Import from external formats |\n\n## Real-World Examples\n\n### Self-Booting Microservice (Rust)\n\nCreate a single `.rvf` file that contains 50 vectors AND a bootable kernel — drop it on a VM and it boots:\n\n```rust\nuse rvf_runtime::{RvfStore, RvfOptions, QueryOptions};\nuse rvf_runtime::options::DistanceMetric;\nuse rvf_types::kernel::{KernelArch, KernelType};\n\n// 1. Create store with vectors\nlet mut store = RvfStore::create(\"bootable.rvf\", RvfOptions {\n    dimension: 128, metric: DistanceMetric::L2, ..Default::default()\n})?;\nstore.ingest_batch(&vectors, &ids, None)?;\n\n// 2. Embed a kernel — file now boots as a microservice\nstore.embed_kernel(\n    KernelArch::X86_64 as u8,\n    KernelType::Hermit as u8,\n    0x0018,  // HAS_QUERY_API | HAS_NETWORKING\n    &kernel_image,\n    8080,\n    Some(\"console=ttyS0 quiet\"),\n)?;\n\n// 3. Verify everything is in one file\nlet (header, image) = store.extract_kernel()?.unwrap();\nprintln!(\"Kernel: {} bytes, vectors: {}\", image.len(), store.query(&q, 5, &QueryOptions::default())?.len());\nstore.close()?;\n// Result: 31 KB file with vectors + kernel + witness chain\n```\n\nRun: `cd examples/rvf && cargo run --example self_booting`\n\n### Linux Microkernel Distribution\n\nA single `.rvf` file as an immutable, bootable Linux distribution:\n\n```rust\nuse rvf_runtime::{RvfStore, RvfOptions, MetadataEntry, MetadataValue, FilterExpr, QueryOptions};\nuse rvf_crypto::{create_witness_chain, sign_segment, verify_segment, shake256_256, WitnessEntry};\nuse ed25519_dalek::SigningKey;\n\n// 1. Create system image with 20 packages as vector embeddings\nlet mut store = RvfStore::create(\"microkernel.rvf\", options)?;\nfor pkg in packages {\n    store.ingest_batch(&[&pkg.embedding], &[pkg.id], Some(&[MetadataEntry {\n        key: \"package\".into(),\n        value: MetadataValue::String(format!(\"{}@{}\", pkg.name, pkg.version)),\n    }]))?;\n}\n\n// 2. Embed kernel + SSH keys\nstore.embed_kernel(KernelArch::X86_64 as u8, KernelType::Linux as u8, 0x001F, &kernel, 8080, None)?;\n\n// 3. Sign with Ed25519 — prevents unauthorized modifications\nlet signature = sign_segment(&segment_bytes, &signing_key);\nverify_segment(&segment_bytes, &signature, &verifying_key)?;\n\n// 4. Witness chain — every package install is audited\nlet chain = create_witness_chain(&witness_entries);\n// Result: 14 KB file = bootable OS + packages + SSH + crypto + witness\n```\n\nRun: `cd examples/rvf && cargo run --example linux_microkernel`\n\n### Claude Code Appliance\n\nBuild an AI development environment as a single sealed file:\n\n```rust\n// Creates a .rvf file containing:\n// - 20 development packages (rust, node, python, etc.)\n// - Real Linux kernel with SSH on port 2222\n// - eBPF XDP program for fast-path vector lookups\n// - Vector store with development context embeddings\n// - 6-entry witness chain for audit\n// - Ed25519 + ML-DSA-65 signatures\nlet store = RvfStore::create(\"claude_code_appliance.rvf\", options)?;\n// ... embed packages, kernel, eBPF, witness chain, signatures ...\n// Result: 5.1 MB sealed cognitive container\n```\n\nRun: `cd examples/rvf && cargo run --example claude_code_appliance`\n\nFinal file: **5.1 MB single `.rvf`** — boots Linux, serves queries, runs Claude Code.\n\n### CLI Proof-of-Operations\n\n```bash\n# Full lifecycle in one session:\n\n# Create a vector store\nrvf create demo.rvf --dimension 128\n\n# Ingest 100 vectors from JSON\nrvf ingest demo.rvf --input data.json --format json\n\n# Query nearest neighbors\nrvf query demo.rvf --vector \"0.1,0.2,0.3,...\" --k 5\n\n# Derive a COW child (only stores differences)\nrvf derive demo.rvf child.rvf --type filter\n\n# Inspect all segments\nrvf inspect demo.rvf\n# Output: MANIFEST_SEG (4 KB), VEC_SEG (51 KB), INDEX_SEG (12 KB)\n\n# Verify witness chain integrity\nrvf verify-witness demo.rvf\n\n# Embed a kernel — file becomes self-booting\nrvf embed-kernel demo.rvf --image bzImage --arch x86_64\n\n# Launch in QEMU microVM\nrvf launch demo.rvf --port 8080\n\n# Compact and reclaim space\nrvf compact demo.rvf\n```\n\n### Witness Chain Verification\n\n```rust\nuse rvf_crypto::{create_witness_chain, verify_witness_chain, shake256_256, WitnessEntry};\n\n// Every operation is recorded in a tamper-evident hash chain\nlet entries = vec![\n    WitnessEntry {\n        prev_hash: [0; 32],\n        action_hash: shake256_256(b\"ingest: 1000 vectors, dim 384\"),\n        timestamp_ns: 1_700_000_000_000_000_000,\n        witness_type: 0x01, // PROVENANCE\n    },\n    WitnessEntry {\n        prev_hash: [0; 32], // linked by create_witness_chain\n        action_hash: shake256_256(b\"query: top-10, cosine\"),\n        timestamp_ns: 1_700_000_001_000_000_000,\n        witness_type: 0x03, // SEARCH\n    },\n    WitnessEntry {\n        prev_hash: [0; 32],\n        action_hash: shake256_256(b\"embed: kernel x86_64, 8080\"),\n        timestamp_ns: 1_700_000_002_000_000_000,\n        witness_type: 0x02, // COMPUTATION\n    },\n];\n\nlet chain_bytes = create_witness_chain(&entries);\nlet verified = verify_witness_chain(&chain_bytes)?;\nassert_eq!(verified.len(), 3);\n// Changing any byte in any entry breaks the entire chain\n```\n\n### COW Branching (Git-like for Vectors)\n\n```rust\nuse rvf_runtime::{RvfStore, RvfOptions};\nuse rvf_types::DerivationType;\n\n// Parent: 1M vectors (~512 MB)\nlet parent = RvfStore::create(\"parent.rvf\", options)?;\nparent.ingest_batch(&million_vectors, &ids, None)?;\n\n// Child: shares all parent data, only stores changes\nlet child = parent.derive(\"child.rvf\", DerivationType::Filter, None)?;\nassert_eq!(child.lineage_depth(), 1);\n\n// Modify 100 vectors → only 10 clusters copied (~2.5 MB, not 512 MB)\nchild.ingest_batch(&updated_vectors, &updated_ids, None)?;\n\n// Query child — transparent parent resolution\nlet results = child.query(&query, 10, &QueryOptions::default())?;\n// Results come from both local (modified) and inherited (parent) clusters\n```\n\n### Generate All 45 Example Files\n\n```bash\ncd examples/rvf\ncargo run --example generate_all\nls output/\n# 45 .rvf files ready to inspect:\n#   basic_store.rvf (152 KB)        — 1,000 vectors\n#   self_booting.rvf (31 KB)        — vectors + kernel\n#   linux_microkernel.rvf (15 KB)   — bootable OS image\n#   claude_code_appliance.rvf (17 KB) — AI dev environment\n#   sealed_engine.rvf (208 KB)      — signed inference engine\n#   agent_memory.rvf (32 KB)        — AI agent memory\n#   ... and 39 more\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}