Skip to content

spectrayan/spector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

265 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Spector

The Zero-Overhead, Agent-Ready AI Memory Backbone.

License Java Build MCP Docs DeepWiki


Legacy search engines bolted vectors onto text databases. Spector is designed from the ground up for modern AI — leveraging Java Project Panama to achieve C++ bare-metal SIMD speeds natively, with a built-in MCP server that turns any AI agent into a search-powered reasoning machine.


🧠 Cognitive Memory — AI Agents That Actually Remember

Spector Memory is a biologically-inspired cognitive memory engine that gives AI agents the ability to remember, forget, consolidate, and associate — with microsecond latency and zero garbage collection pressure.

Capability What it does
🧠 4-Tier Cortex Working → Episodic → Semantic → Procedural memory
0.13ms recall at 1M memories 15× faster than the 2ms target (vs. 50–200ms for Mem0/Letta/Zep)
🔗 Fused SIMD Scoring Similarity × importance × decay in a single pass — no truncation trap
🛏️ Sleep Consolidation Hippocampus-inspired pruning and partition rebuild
😱 Emotional Valence Amygdala-driven positive/negative/neutral tagging
🚫 Zero GC 100% off-heap Panama storage (≤0.01% overhead measured)

📖 Full Cognitive Memory Documentation →


✨ Features

  • 🤖 Agent-Native (MCP) — Built-in Model Context Protocol server with 13 tools (6 search + 7 cognitive memory).
     Claude Desktop · Cursor · autonomous agents · stdio transport · zero Python
  • ⚡ SIMD-Accelerated — Hardware vector math via Java Vector API (AVX2/AVX-512/NEON).
     88µs p50 search · 61K QPS · branchless kernels · masked tail handling
  • 🧊 100% Off-Heap Panama — Bypasses GC entirely. Maps raw disk bytes directly into SIMD registers.
     zero network tax · zero serialization tax · zero GC pressure
  • 🗜️ SVASQ Quantization — FWHT-rotated affine quantization. Float32 recall at INT8 memory sizes.
     SVASQ-8 (4×) · SVASQ-4 (6–8×) · IVF-PQ (32×) · 99.5%+ recall
  • 🔍 Hybrid Search — Semantic vector (HNSW) + keyword (BM25) via Reciprocal Rank Fusion.
     LLM re-ranking · auto-embed · bulk ingest · document chunking
  • 📦 Embedded or Standalone — Drop-in JAR (the "DuckDB of Vector DBs") or scale with REST/gRPC clustering.
     Spring AI integration · Java SDK · CLI · zero dependencies
  • 🖥️ GPU + Distributed — CUDA kernel loader via Panama FFM, gRPC fan-out with consistent hashing.
     CUDA · coordinator/shard · TLS · SSE streaming
  • 🧠 Neural Dashboard — Angular 21 real-time dashboard with 10+ live visualization cards.
     THREE.js · Canvas 2D · SSE · Micrometer metrics

📸 Demo

Cortex Neural Dashboard

Spector Cortex Dashboard


🚀 Quick Start

Prerequisites: JDK 25+, Maven 3.9+

git clone https://github.com/spectrayan/spector.git
cd spector
mvn clean test                                        # Build & run all 685+ tests
mvn package -pl spector-dist -am -DskipTests          # Build the distribution JAR

Start the MCP server (for AI agents):

java --add-modules jdk.incubator.vector \
  --enable-native-access=ALL-UNNAMED --enable-preview \
  -jar spector-dist/target/spector.jar \
  --config spector.yml

Claude Desktop config — add to claude_desktop_config.json:

{
  "mcpServers": {
    "spector": {
      "command": "java",
      "args": [
        "--add-modules", "jdk.incubator.vector",
        "--enable-native-access=ALL-UNNAMED",
        "--enable-preview",
        "-jar", "/path/to/spector-dist/target/spector.jar",
        "--config", "/path/to/spector.yml"
      ]
    }
  }
}

📖 Full Quick Start Guide → · Configuration Reference →


📊 Benchmarks (Highlights)

All numbers measured on Intel Core Ultra 9 285K, Java 25, AVX2 256-bit.

Benchmark Result Notes
Vector search p50 88–143µs 10K–100K docs, HNSW M=16
Cognitive recall at 1M 0.13ms p50 15× better than 2ms target
Peak QPS (16 threads) 61,011 Concurrent vectorSearch
GC overhead 0.01% 1 pause / 100K searches
vs. Python MCP servers 23–113× faster In-process SIMD, zero network

📖 Full Benchmark Report → · Performance Tuning →


📖 Docs by Goal

I want to... Start here
Use Spector Quick Start · Installation · Configuration
Connect an AI agent MCP Server Guide · Claude Desktop Config
Add cognitive memory Memory Overview · Getting Started · Use Cases
Use the Java SDK Java SDK Guide · Spring AI Integration
Understand the internals Architecture Overview · Core Concepts · Deep Dives
Contribute Contributing Guide · Module Reference
Run benchmarks Benchmark Report · Performance Tuning

📖 Full Documentation →


🤝 Contributing

We welcome contributions of all kinds — code, docs, tests, benchmarks, and ideas!

Good first areas: Documentation improvements, additional test coverage, new embedding provider implementations, CLI enhancements, and Spring AI adapter extensions.


⭐ Star History

Star History Chart


📄 License

This repository uses a split licensing model:

For branding and trademark guidelines, see the NOTICE file.

🔒 Security

See SECURITY.md for our security policy and vulnerability reporting.

🙏 Acknowledgments

See ACKNOWLEDGMENTS.md for credits to the cognitive science researchers, open-source frameworks, and AI coding tools that made Spector possible.


Built with ⚡ by Spectrayan

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors