Summary
June 5, 2026 · View on GitHub
STAR (Semantic Temporal Associative Retrieval) is a local-first, graph-based information retrieval system designed to enable resource-constrained devices to navigate large-scale personal knowledge corpora. Unlike traditional dense vector retrieval systems that require loading complete indices into RAM, STAR implements a sparse bipartite graph approach that retrieves only relevant "atoms" of information required for a given query.
The system uses a physics-inspired scoring model combining three factors multiplicatively: semantic co-occurrence (shared tags), temporal decay (recent memories weighted higher), and structural similarity (SimHash fingerprint proximity). This multiplicative approach ensures any zero factor eliminates irrelevant results, providing precise, explainable retrieval.
STAR has been production-validated on a 28-million-token corpus of chat history and personal documents, achieving sub-200ms query latency on 4GB RAM consumer hardware without GPU acceleration. The browser paradigm architecture—treating AI memory like web browsers treat the internet—enables universal deployment from $200 laptops to supercomputers.
Statement of Need
Current Retrieval-Augmented Generation (RAG) systems for AI memory require high-specification servers with GPUs and substantial RAM, creating a barrier for individual researchers and resource-constrained environments. Personal AI memory is often locked behind cloud subscriptions or enterprise infrastructure.
STAR addresses this gap with a sparse graph retrieval system that runs on consumer hardware (4GB RAM, CPU-only), operates locally without cloud dependencies, provides explainable results via tag paths, and scales linearly with O(k·d̄) complexity versus O(n) for dense vector approaches. The system enables researchers, developers, and privacy-conscious users to navigate large-scale personal knowledge corpora on standard laptops.
State of the Field
Dense Vector and Graph-Based Retrieval
Systems like HNSW [@malkov2018efficient] and FAISS [@johnson2019billion] represent state-of-the-art approximate nearest neighbor search but require loading complete vector indices into RAM (4-8GB for modest corpora), restricting deployment to high-specification servers and providing limited explainability. Recent graph-based memory systems like TOBUGraph [@tobugraph2024] and Mem0 [@mem02025] explore alternative structures, often relying on LLM-based extractions or dense embeddings. In contrast, STAR introduces a deterministic, physics-inspired multiplicative scoring model (the Unified Field Equation) that prioritizes resource-constrained, local-first environments (operating on CPU-only, 4GB RAM footprints) and provides native explainability through explicit tag paths.
STAR contributes a complete, deployed system with validated performance on 25M tokens of real-world data. The bipartite graph approach (Atoms × Tags) enforces strict separation between content and metadata, enabling O(1) per-atom deduplication lookups via SimHash [@charikar2002similar] and disposable index architectures.
| Method | Time Complexity | Space Complexity | Explainability | Hardware |
|---|---|---|---|---|
| Dense Vector ANN (HNSW) | query; build | Opaque | GPU preferred | |
| STAR (Sparse Graph) | **$O( | E | )$** |
Where = total atoms, = query tags (typically 5–20), = average tag degree (typically 10–100), = vector dimension (typically 768–1536), and = sparse edges (typically $10 \cdot nk \cdot \bar{d} \ll n$, making STAR asymptotically faster than dense retrieval.
Personal AI Memory and Novel Contribution
Second Me [@wei2025second] proposes LLM-based memory parameterization requiring significant computational resources. STAR achieves similar associative retrieval through deterministic physics-based scoring, enabling deployment on minimal hardware. Existing sparse retrieval libraries (Lucene, Terrier) focus on traditional keyword search without temporal decay modeling, graph-based associative traversal, SimHash deduplication, or byte-offset lazy loading. STAR's unified field equation combining semantic, temporal, and structural factors in a multiplicative scoring model represents a novel contribution not present in existing packages.
Software Design
Architecture and Data Model
STAR implements the "Browser Paradigm" for AI memory: just as browsers render websites by loading only necessary shards, STAR retrieves only relevant atoms required for the current query. The architecture uses Node.js as the interface layer, TypeScript for all processing including SimHash fingerprinting, PGlite (WASM-based PostgreSQL) for sparse graph storage, and filesystem pointers for content (disposable, rebuildable indices).
The data model follows a three-tier hierarchy: Compounds (document references), Molecules (semantic chunks with byte offsets), Atoms (content units with tags), and Tags (conceptual labels). Content resides in the filesystem; the database stores only pointers, enabling O(1) per-atom deduplication lookups via 64-bit SimHash fingerprints, ephemeral indices, and lazy loading.
v4.3.0 Migration Note: Prior to February 2026, STAR used C++ N-API modules for performance-critical operations. The migration to pure TypeScript + PGlite WASM eliminated all native compilation requirements, enabling seamless deployment on ARM64 Windows and other platforms without platform-specific builds.
Unified Field Equation
The gravity score for query and candidate atom is:
where counts shared tags, applies damping per hop distance (), models temporal decay ( h⁻¹, ~7.9 year half-life suited to personal knowledge bases where old memories retain value), and $1 - H(h_q, h_a)/64$ measures SimHash similarity. Multiplicative scoring ensures any zero factor eliminates noise.
Retrieval Protocol
STAR executes a three-phase retrieval protocol: (1) Anchor Discovery via full-text search and radial inflation, yielding 20–200 anchor atoms; (2) Radial Inflation via recursive tag-walker graph traversal, expanding to 40–500 associated atoms ranked by gravity score; (3) Elastic Context Assembly merging atoms within proximity and snapping to sentence boundaries to produce 8–12 coherent paragraphs.
SQL-Native Implementation
The equation executes as a single recursive SQL CTE in PGlite, enabling precise hop-distance tracking for damping application. The O(k·d̄·r) complexity remains tractable for personal-scale corpora.
Quality Assurance
A comprehensive test suite includes unit tests for core components (atomizer, fingerprinting, graph traversal) and integration tests for end-to-end search behavior. A benchmarking framework provides reproducible performance measurements; all benchmarks reported here can be reproduced using the provided scripts.
Research Impact Statement
Production Validation
STAR has been production-validated on a corpus of 28 million tokens (~100MB) comprising 151,876 atoms, 280,000 molecules, and 436 files. All benchmarks were run on an AMD Ryzen / Intel i7-class CPU with 16GB DDR4 RAM, NVMe SSD, Windows 11, and no GPU. Ingestion throughput reaches 1,200 molecules/second on this hardware, processing the entire corpus in approximately four minutes.
Search Latency Note: Search latency scales linearly with dataset size. The ~150ms claim was measured on a 1,500 atom dataset. Current production deployment (151,000 atoms) shows ~7.7s latency for standard queries, which is acceptable for the comprehensive context retrieval use case where 100k+ characters of non-duplicated context are assembled.
| Metric | Value | Dataset Size |
|---|---|---|
| Ingestion throughput | 1,200 mol/s | 151k atoms |
| Standard search latency (p95) | 150 ms | 1.5k atoms |
| Standard search latency (p95) | 7.7 s | 151k atoms |
| Max‑recall search latency (p95) | 690 ms | 1.5k atoms |
| Peak memory (ingestion) | 1,657 MB | 151k atoms |
| Idle memory (post‑cleanup) | 510 MB | 151k atoms |
External Use and Reproducibility
The system provides stateless context retrieval via HTTP API for integration with agent frameworks (OpenCLAW, custom agents) and CLI automation. All benchmarks are reproducible using the included benchmarks/ directory (ingestion‑benchmark.ts, search‑benchmark.ts, comparison‑framework.ts). Containerization via Docker and docker‑compose enables deployment with identical environments (Node.js 20 LTS, 2 CPU, 2 GB RAM limits).
Community Readiness
STAR is released under AGPL‑3.0 with comprehensive documentation (80+ architecture standards), Docker support, and a stable production release (v4.3.0). The repository is publicly available at https://github.com/RSBalchII/anchor‑engine‑node.
Platform Support: v4.3.0+ runs on ARM64 Windows, x64 Windows, Linux (x64/ARM64), and macOS (Intel/Apple Silicon) without platform-specific compilation.
AI Usage Disclosure
Generative AI tools (GitHub Copilot, Gemini, Qwen Coder, Kimi AI, Deepseek Coder) assisted with code scaffolding, SQL query patterns, documentation drafts, and grammar checking. The human author reviewed all AI-generated code, made all architectural decisions, verified mathematical correctness, conducted all benchmarks, and edited all documentation. Core algorithm design, mathematical derivations, research direction, benchmark methodology, and production validation were exclusively human contributions. The author bears complete responsibility for accuracy, originality, licensing compliance, and reproducibility.
Competing interests
The author declares no competing interests.
Acknowledgments
This research was conducted as independent work without external funding.
The STAR algorithm builds upon foundational work in similarity estimation (Charikar's SimHash), graph-based search (PageRank), and information retrieval (sparse vector models). The implementation uses PGlite by ElectricSQL and open-source tools from the Node.js ecosystem.