Anvesh
Platform Architecture

Architectural Blueprint: Logical & Technical Systems

The enterprise architectural specification of Anvesh, decoupled into formal Logical Domain Models and physical Kubernetes / Microservices Technical Topologies.

🧠 Part I: Logical Architecture ⚙️ Part II: Technical Architecture 📊 Benchmarks & Footprint

🧠 Part I: Logical Architecture & Hybrid Search Pipeline

The logical architecture models Anvesh's hybrid search, inverted index construction, scalar vector quantization (SQ8), and reciprocal rank fusion independent of container hosting.

ANVESH LOGICAL ARCHITECTURE: 5-STAGE HYBRID BM25 + SQ8 VECTOR SEARCH PIPELINE SUB-0.5MS SEARCH 1. EXTRACTION & CDC Multi-Source Stream • Bulk Streaming API • Multi-format Files / DBs Change Scanner (CDC) • SHA-256 Folder Diffs • Checkpoint Watermarks • Delta Insertion / Deletes Pure-CPU Visual OCR • Local Textile Classifier • Color & Motif Classifier • Zero-GPU Image Tokens 2. LEXICAL BM25 INDEX Inverted Posting List • Paged Shard Storage • Term Frequency Bitmaps • Streaming Shard Offsets BM25 Okapi Engine • Sub-0.1ms Raw Latency • k1 = 1.2, b = 0.75 Tuning • Dynamic Field Weighting Query Boost Rules • JSON Conditional Filters • Exact, In, Range Match • Multiply / Add Boosts 3. SQ8 VECTOR ENGINE Scalar Quantization • Float32 → Int8 Compression • 75% RAM Reduction • >98.5% Cosine Recall HNSW Graph Index • Multi-layer Skip Graph • Fast Nearest Neighbor • 384d, 768d, 1536d Support LRU Shard Unloading • Idle Shard Memory Flush • Instant Query Rehydration • Zero Heap Leakage 4. HYBRID FUSION (RRF) Reciprocal Rank Fusion • RRF = 1/(k + rank_bm25) • + 1/(k + rank_vec) • k = 60 Default Constant • Precision + Semantic Recall Dynamic Re-ranking • Tenant Context Filter • Faceted Aggregations • Highlight Snippet Extractor 5. TIERED PERSISTENCE Hot Tier • In-Memory Active • Write-Ahead Log (WAL) Warm Tier • Local NVMe SSD Shards • Read-mapped Shards Cold Tier • S3 / OCI Storage • Immutable Snapshots

⚙️ Part II: Technical Architecture & Distributed Microservices Topology

The technical architecture details the physical container topology, networking ports, protective throttling semaphores, and memory backpressure mechanisms operating across the fleet.

TECHNICAL ARCHITECTURE: KUBERNETES MICROSERVICES TOPOLOGY, PORTS & 3-TIER THROTTLING 1. EDGE INGRESS & TLS TERMINATION AWS ALB / Cloudflare WAF • Port 443 HTTPS • TLS 1.3 • Sub-millisecond Routing CONTROL PLANE: Hub API & RBAC (Port :3849) Hub API Service (apps/hub-api) AWS Cognito OAuth2 / PKCE • 5-Role RBAC Scope Cluster Telemetry & Config Reconciler System Indices (.anvesh_*) Replicated on Engine Nodes Pod Limits: 1.0 vCPU • 1.0 GiB RAM | Replicas: 2 (HPA) QUERY ENGINE FLEET: Anvesh Engine (Port :3848) Fastify Core Engine (apps/engine) BM25 + SQ8 Hybrid Search • Pure Node.js/C++ SIMD 3-Tier Protective Throttling 120 RPM Limiter • 32 Concurrency Semaphore • 85% Shed Pod Limits: 2.0 vCPU • 2.0 GiB RAM | Replicas: 3-10 (HPA) ASYNCHRONOUS WORKER FLEET (ISOLATED INGESTION DATA PLANE) Spider & Scheduler (:3851) • Asynchronous Web Scraper • 5-part cron & "Run Now" triggers • 1 vCPU • 1 GiB RAM Change Scanner (:3853) • Multi-source folder CDC • SHA-256 Checksum Diffing • 1 vCPU • 1 GiB RAM Bulk Indexer (:3852) • Stream Ingestion Worker • Batching & Dead-Letter Queue • 2 vCPU • 2 GiB RAM Shared POSIX Volume (PVC) Local NVMe / DFS Hot Shards Cloud Object Store AWS S3 / OCI Object Storage Prometheus Telemetry (:9090) P99 Latency & Memory Metrics

1. Fleet Resource Envelopes & Memory Governors

Service / Component Port Package CPU Limit RAM Limit Protective Mechanism
Anvesh Engine :3848 apps/engine 2.0 vCPU 2.0 GiB 3-Tier Throttling (120 RPM, 32 Semaphore, 85% Heap Circuit Breaker)
Hub API & Control Plane :3849 apps/hub-api 1.0 vCPU 1.0 GiB AWS Cognito RBAC, System Index Replication
Spider & Scheduler :3851 apps/spider 1.0 vCPU 1.0 GiB Async Crawl Semaphore, Domain Politeness Rate Limiting
Bulk Indexer :3852 apps/indexer 2.0 vCPU 2.0 GiB Streaming Chunk Batcher, Dead-Letter Queue (DLQ)
Change Scanner (CDC) :3853 apps/scanner 1.0 vCPU 1.0 GiB SHA-256 Hash Diffs, Periodic Watermark Checkpoint

2. 3-Tier Protective Throttling System

Every engine node is shielded by three independent layers of defense:

  1. Layer 1: RPM Rate Limiter — Fastify token/IP throttling (default 120 req/min).
  2. Layer 2: In-Flight Concurrency Guard — Maximum 32 concurrent searches per pod. Overflows are shed with HTTP 429 ERR_CIRCUIT_CONCURRENT.
  3. Layer 3: Memory Backpressure — Proactive GC at 75% heap; automatic load shedding at 85% heap (429 ERR_CIRCUIT_MEMORY) to prevent OOM restarts.

📊 Production Performance & Footprint

MetricValueConditions
Search Query Latency (p50)0.3 ms100K docs, BM25 + Vector Hybrid
Search Query Latency (p99)0.8 ms100K docs, BM25 + Vector Hybrid
Ingestion Throughput12,000+ docs/sBulk streaming API
Memory Footprint (Idle)~70 MBEngine Node (Node.js runtime)
Vector Memory Savings75% reductionSQ8 8-bit Quantization