npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moaaz-yahia-zakaria/flash-db

v1.3.2

Published

Zero-knowledge encrypted intelligence database — local-first, AI-native, server-blind document engine

Readme

⚡ FLASH DB

Zero-Knowledge Encrypted Intelligence Database — Local-First, AI-Native, Server-Blind

License TypeScript Tests Node.js Docs npm

The server never sees your keys, your queries, or your plaintext. Built for private AI, local-first apps, and encrypted intelligence.

Release Notes · Universal Foundations · Buffer Pipeline · Positioning & Identity · 5-Min Intelligence Start


What FLASH Is

FLASH is a zero-knowledge document engine — not a generic cloud database with encryption bolted on.

| Pillar | Meaning | | -------------------------- | ------------------------------------------------------------------------------------------ | | Server-blind by design | AES-256-GCM, blind indexes, and ORE range tokens are the foundation — not optional plugins | | AI-native storage | HNSW vector search, semantic cache, RAG context optimizer, and LLM tool-calling built in | | Local-first | Embedded in-process or over the FLASH wire protocol — your data stays under your key | | FLASH formats | FlashBinary, .farc WAL, .flog oplog — purpose-built, zero-copy, LSM-backed |

FLASH-Exclusive (no other DB offers this stack)

| Module | Purpose | | --------------------- | ------------------------------------------------------------------ | | FlashPrivateRAG | Encrypted ingest → chunk → embed → ask — private RAG, server-blind | | FlashAgentMemory | AI agent episodic memory — semantic recall, TTL, importance | | FlashSealedVault | Passphrase vault with auto-lock — isolated secret domain | | FlashIntegrityProof | Signed Merkle + invariant manifest for audit |

FLASH answers one question: How do you store, query, and search documents when the engine must remain cryptographically blind?


🚀 Key Highlights

  • 🛡️ 100% Zero-Knowledge Privacy: Complete client-side envelope encryption. The database server and disk storage never see plaintext keys, values, or queries.
  • ⚡ 1M+ Ops/Sec Zero-Copy Binary Format: FlashBinary layout with $O(1)$ constant-time field offset lookups without JSON parsing overhead.
  • 🧬 32x Vector Quantization (SQ8 & 1-Bit Binary): Store millions of high-dimensional vectors in minimal RAM with single-cycle bitwise Hamming distance math.
  • 🌐 Universal Polyglot Query Engine: Zero-shot natural language query compiler for ANY language or script (Arabic, English, Chinese, French, Spanish, Russian, Hindi...).
  • 🤖 Autonomous AI Agent Tools & Function Calling: Standardized Tool Calling registry with automated multi-turn execution loops over local collections and external APIs.
  • 🎯 RAG Context Optimizer & Reciprocal Rank Fusion (RRF): Merges Vector & BM25 search ranks and trims context to save 60-80% LLM token costs.
  • ⚡ Multi-Tier Semantic Cache (< 0.05ms): Dual-tier L1 In-Memory + L2 Persistent Disk Cache saving up to 90% in LLM API bills.
  • 🧠 High-Dimensional AI Vector Search (HNSW): $O(\log N)$ Approximate Nearest Neighbor (ANN) search for private RAG and LLM embeddings.
  • 🔍 Searchable Encrypted Blind Indexing: Query over encrypted data using exact trapdoors, substring N-grams, and Order-Revealing Encryption (ORE) range filters ($gt, $lt).
  • 🧮 Homomorphic Aggregation: Execute $sum and $inc calculations directly over ciphertexts on the server without decrypting.
  • 💾 Modern LSM-Tree Engine: Lock-Free SkipList MemTable + .farc durability archive + Bloom-Filtered compressed SSTable segments + Tiered Compactor.
  • 🔄 ACID Transactions & Snapshot Isolation: Multi-Version Concurrency Control (MVCC) + Distributed Two-Phase Commit (2PC) across sharded clusters.
  • 📊 Built-in Observability & ETL: Live Prometheus /metrics telemetry endpoint and streaming NDJSON / CSV export & import tools.
  • 🔴 Real-Time Infrastructure: Zero-dependency WebSocket server with rooms/channels, presence tracking, LRU cache, and enhanced pub/sub with wildcards.
  • 📘 Full TypeScript Definitions: First-class index.d.ts with IntelliSense autocompletion and generic collection typing.

📖 Documentation

Full Documentation (VitePress)


📦 Installation

npm install @moaaz-yahia-zakaria/flash-db

⚡ Quick Start

import { FlashClient } from "@moaaz-yahia-zakaria/flash-db";

// 1. Initialize Client with Master Secret Key
const client = new FlashClient({
  secretKey: "quantum_production_passphrase_2026",
  storagePath: "./flash_data",
});

interface User {
  _id?: string;
  name: string;
  email: string;
  role: string;
  balance: number;
}

const users = client.collection<User>("users");

// 2. Insert Document (Automatically encrypted on client side)
const result = await users.insertOne({
  name: "Ada Lovelace",
  email: "[email protected]",
  role: "Mathematician",
  balance: 45000,
});

console.log(
  `Inserted ID: ${result.insertedId} | State Root: ${result.merkleRoot}`,
);

// 3. Search Over Encrypted Blind Indexes (Server remains 100% blind)
const found = await users.find({ email: "[email protected]" });
console.log(found[0].name); // 'Ada Lovelace'

🧠 AI Vector Search & Private RAG (HNSW)

import { FlashHNSWIndex } from "flash-db";

const hnsw = new FlashHNSWIndex({
  M: 16,
  efConstruction: 64,
  metric: "cosine",
});

// Insert 1536-dimensional embeddings
hnsw.insert("doc_1", [0.014, -0.052, 0.841 /* ... */]);
hnsw.insert("doc_2", [0.019, -0.048, 0.82 /* ... */]);

// Query Top-K Nearest Neighbors in O(log N) time
const matches = hnsw.search([0.015, -0.05, 0.835], 5);
console.log(matches);
// [{ docId: 'doc_1', score: 0.9988 }, ...]

📊 Architecture Overview

Client Application (Plaintext)
       ↓ (FlashClient SDK: AES-256-GCM + Blind Index Trapdoors + ORE)
Network / Local Process Boundary (Zero-Knowledge Envelope)
       ↓
FlashDatabase Engine
 ├── In-Memory L0: FlashMemTable (SkipList)
 ├── Durability:   FlashArc (.farc Append-Only Vault)
 ├── Concurrency:  FlashMVCC (Snapshot Isolation)
 ├── On-Disk L1:   FlashSSTable (Bloom Filter + Compressed Blocks)
 ├── Optimization: FlashCompactor (Tiered Compaction & Tombstone Eviction)
 └── Telemetry:    FlashMetrics (Prometheus /metrics)

🧪 Running Tests & Benchmarks

# Run comprehensive test suite (136 tests)
npm test

# Run performance benchmarks (insertOne ~330/s, insertMany ~2,650/s)
npm run benchmark

# Bootstrap intelligence workspace
npx flashsh init

# Start Intelligence Console
npx flash-console
# → http://localhost:3456

📄 License

Apache-2.0 © 2026 Moaaz Yahia Zakaria