Skip to content

feat: OSpipe - RuVector-enhanced personal AI memory for Screenpipe #162

@ruvnet

Description

@ruvnet

OSpipe: Quantum-Enhanced Personal AI Memory

OSpipe integrates Screenpipe — an open-source, local-first desktop recording and AI memory system — with the RuVector ecosystem of 70+ Rust crates and 50+ npm packages. The result is a privacy-preserving personal AI memory system with semantic vector search, knowledge graphs, temporal analysis, and cross-platform deployment.

Core Idea

Screenpipe captures everything you see, hear, and do on your desktop. OSpipe replaces its SQLite + FTS5 storage with RuVector's SIMD-accelerated HNSW vector database, adding:

  • Semantic Search — Find content by meaning, not just keywords (61us p50 latency)
  • Knowledge Graph — Relationships between apps, people, topics, meetings
  • Temporal Analysis — Delta-behavior tracking for change detection
  • PII Safety Gate — Credit card, SSN, email redaction before storage
  • Frame Deduplication — Cosine similarity sliding window eliminates duplicates
  • Cross-Platform — Native (Windows, macOS, Linux) + WASM (browser)

Features

Feature Description Status
Rust Core Library 7 modules: capture, storage, search, pipeline, safety, config, wasm Done
WASM Bindings wasm-bindgen exports for browser deployment Done
TypeScript SDK @ruvector/ospipe with SSE streaming, hybrid search Done
PII Safety Gate Credit card, SSN, email detection + redaction Done
Frame Deduplication Cosine similarity sliding window Done
Query Router Heuristic routing to Semantic/Keyword/Graph/Temporal/Hybrid Done
Hybrid Search Semantic + keyword score fusion Done
Configurable Quantization 4-tier age-based (f32 → int8 → product → binary) Done
56 Tests 24 unit + 32 integration, all passing Done
Cross-Platform Builds Linux x64, Windows GNU, WASM32 verified Done
Knowledge Graph Integration ruvector-graph for Cypher queries Planned (Phase 2)
Attention Streaming Multi-head attention for content prioritization Planned (Phase 3)
GNN Search Improvement Learned retrieval improvement over time Planned (Phase 3)
Quantum Search Grover-inspired amplitude amplification Planned (Phase 4)
On-Device LLM ruvllm GGUF inference, fully offline Planned (Phase 5)

Comparison: Screenpipe vs OSpipe

Aspect Screenpipe (FTS5) OSpipe (RuVector)
Search Type Keyword only (FTS5) Semantic + Keyword + Graph + Temporal + Hybrid
Search Latency ~1ms 61us (HNSW p50)
Content Relations None Knowledge Graph with Cypher
Temporal Analysis Basic SQL queries Delta-behavior causal tracking
PII Protection Basic Credit card, SSN, email redaction
Deduplication None Cosine similarity gate (configurable threshold)
Browser Support None WASM (11.8KB micro to 350KB full)
Quantization None 4-tier age-based (100% → 3% memory)
Privacy Local-first Local-first + automatic PII redaction
Embedding Model External (Ollama/OpenAI) On-device ONNX + GGUF (planned)

Architecture

Screenpipe Capture → Safety Gate → Dedup → Embed → HNSW VectorStore
                                                         |
                        Query Router ←-------------------+
                        ├── Semantic (HNSW cosine)
                        ├── Keyword (FTS5 compat)
                        ├── Graph (Cypher via ruvector-graph)
                        ├── Temporal (delta-core replay)
                        └── Hybrid (score fusion)

Quick Start

Rust:

use ospipe::pipeline::ingestion::IngestionPipeline;
use ospipe::config::OsPipeConfig;

let pipeline = IngestionPipeline::new(OsPipeConfig::default())?;
// Ingest captured frames, search by semantic meaning

TypeScript:

import { OsPipe } from "@ruvector/ospipe";

const client = new OsPipe();
const results = await client.queryRuVector("what did I discuss about auth?");

WASM:

const pipe = new OsPipeWasm(384);
pipe.insert("f1", pipe.embed_text("meeting notes"), '{}', Date.now());
const results = pipe.search(pipe.embed_text("notes"), 5);

RuVector Crate Integration

Crate Purpose Phase
ruvector-core HNSW vector storage + SIMD 1 (Done)
ruvector-filter Metadata filtering 1 (Done)
ruvector-cluster Frame deduplication 1 (Done)
ruvector-delta-core Change tracking 1 (Done)
ruvector-router-core Query classification 1 (Done)
cognitum-gate-kernel AI safety decisions 1 (Done)
ruvector-graph Knowledge graph 2
ruvector-attention Content prioritization 3
ruvector-gnn Learned retrieval 3
ruqu-algorithms Quantum-enhanced search 4
ruvllm On-device LLM 5

Implementation Details

  • Branch: feat/ospipe-screenpipe-integration
  • Crate: examples/OSpipe/ (14 Rust source files)
  • TypeScript SDK: npm/packages/ospipe/
  • WASM Package: npm/packages/ospipe-wasm/
  • ADR: examples/OSpipe/ADR-OSpipe-screenpipe-integration.md (1,986 lines)
  • Tests: 56 passing (24 unit + 32 integration)
  • Build Targets: Linux x64, Windows x64 GNU, wasm32-unknown-unknown
Configuration Reference

CaptureConfig

Parameter Default Description
fps 1.0 Screen capture frames per second
audio_chunk_secs 30 Duration of audio recording chunks
excluded_apps ["1Password", "Keychain Access"] Apps to skip
skip_private_windows true Skip incognito/private windows

StorageConfig

Parameter Default Description
embedding_dim 384 Vector dimensions
hnsw_m 32 Max connections per HNSW layer
hnsw_ef_construction 200 Build-time search width
hnsw_ef_search 100 Query-time search width
dedup_threshold 0.95 Cosine similarity dedup cutoff

SearchConfig

Parameter Default Description
default_k 10 Results per query
hybrid_weight 0.7 Semantic vs keyword blend
mmr_lambda 0.5 Diversity vs relevance tradeoff
rerank_enabled false Enable result reranking

SafetyConfig

Parameter Default Description
pii_detection true Enable PII detection
credit_card_redaction true Redact credit card numbers
ssn_redaction true Redact SSNs
custom_patterns [] Custom deny patterns

Quantization Tiers

Age Method Memory vs f32
0h None (f32) 100%
24h Scalar (int8) 25%
1 week Product ~6%
30 days Binary 3%
Safety Gate Details

The safety gate inspects content before storage:

PII Type Pattern Replacement
Credit Card 13-16 digit sequences [CC_REDACTED]
SSN XXX-XX-XXXX [SSN_REDACTED]
Email user@domain.tld [EMAIL_REDACTED]
Custom Configurable patterns [DENY]

Decisions: Allow → store as-is | AllowRedacted → store cleaned | Deny → reject entirely

WASM Deployment Tiers
Tier Size Capabilities
Micro 11.8KB Embedding + search only
Standard 225KB Full pipeline
Full 350KB + Dedup + safety
AI 2.5MB + On-device inference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions