Skip to content

spectrayan/spector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

448 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Spector

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

License Java Build MCP Docs DeepWiki


Legacy AI architectures bolted memory onto stateless vector databases. Spector is designed from the ground up for modern AI as a unified cognitive memory backbone β€” leveraging Java Project Panama to achieve C++ bare-metal SIMD speeds natively across dense vector similarity, BM25 keyword matching, SPLADE learned sparse retrieval, and associative Hebbian graph memory, with a built-in MCP server that turns any AI agent into a memory-augmented reasoning machine.


System Architecture & Data Flow

Spector is structured around a modular, biologically-inspired architecture designed to bridge low-level bare-metal SIMD operations with high-level agent orchestration:

  • Nucleus (Foundation): Core configurations, off-heap storage layouts (Panama MemorySegment), and standard utilities.
  • Memory (Cognitive Engine): The flagship hybrid retrieval and cognitive memory system combining dense vector, sparse (SPLADE/Li-LSR), keyword (BM25), 4-layer cognitive graph, and sleep consolidation pipelines.
  • Synapse (Gateway & APIs): Spring Boot entry points, Armeria-based REST/gRPC gateways, and stdio/HTTP Model Context Protocol (MCP) servers.
  • Cortex (UI): Three.js and Angular-powered neural dashboard for real-time visualization of memory graphs, decay, and search metrics.

For a comprehensive analysis of the system architecture, data flows, thread scheduling model, and detailed Mermaid diagrams, see the Architecture Overview Docs.


πŸ€– MCP-Native β€” Built for AI Agents

Spector is an MCP-native cognitive memory β€” not an afterthought adapter. The MCP server runs in-process with the memory system (zero network, zero serialization), giving agents direct SIMD-accelerated access to 16 tools across memory storage, recall, and introspection.

Why MCP-Native Matters

Spector (MCP-native) Typical MCP adapter
Architecture Memory + MCP in one JVM Python wrapper β†’ HTTP β†’ DB
Memory recall 0.13ms (fused scoring) 50–200ms (Mem0/Letta/Zep)
Tools 16 (cognitive memory tools) 3–5 basic CRUD
Cognitive features Decay, Hebbian, consolidation, valence Key-value store
GC pressure Zero (Panama off-heap) Full GC overhead

🧠 Cognitive Memory β€” AI Agents That Actually Remember

Spector Memory is a biologically-inspired cognitive memory system 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 β†’


✨ Key Capabilities

Capability Technology Performance / Specifications
πŸ€– Agent-Native (MCP) Model Context Protocol Β· 16 tools Β· stdio + Streamable HTTP Claude Β· Cursor Β· autonomous agents
⚑ SIMD Scoring Java Vector API (AVX2/AVX-512/NEON) 0.13ms p50 recall
🧊 Off-Heap Storage Panama MemorySegment · zero-copy I/O 0.01% GC overhead
πŸ—œοΈ Quantization SVASQ-8/4 Β· IVF-PQ Β· FWHT rotation 4–32Γ— compression Β· 99.5% recall
πŸ” Hybrid Retrieval 4-Layer Stack: Dense HNSW + BM25 + SPLADE / Li-LSR + ColBERT v2 Multi-way RRF fusion + MaxSim SIMD reranking
πŸ“„ Off-Heap Doc Store Encrypted TextDataStore (AES-256-GCM) Zero-copy mmap'd readTextDirect Β· zero GC pressure
πŸ”— Cognitive Graphs Hebbian co-activation + LLM Entity Graphs Spreading activation, temporal chains & entity links
πŸŽ›οΈ Retrieval Modes 8 TextSearchMode paths (HYBRID, FULL_STACK, etc.) Graceful degradation & flexible query optimization
πŸ–₯️ GPU Acceleration CUDA via Panama FFM Optional Β· zero-copy transfer
πŸ“¦ Flexible Deployment Embedded JAR Β· Standalone Β· Distributed Zero to cluster in one config

πŸ“Έ Demo

Spector Cortex β€” Neural Graph Explorer
πŸŽ₯ Watch the Neural Graph in action β†’

πŸ“Š Dashboard β€” 12+ live cognitive panels

Spector Cortex Dashboard

Real-time scoring pipeline, SIMD lanes, decay curves, vector space, Hebbian graph, cognitive profiles, live metrics β€” all rendered with Three.js, Canvas 2D, and Angular Signals.
🌌 Graph Explorer β€” 3D neural galaxy

Spector Cortex Graph Explorer

Interactive 3D graph with glowing star nodes, Hebbian/temporal/entity edges, fly-to navigation, and real-time topology stats.
🧠 Memory Table β€” browse & manage memories

Spector Cortex Memory Table

Full CRUD with tier filtering, importance bars, valence indicators, synaptic tags, recall counts, and bulk actions.
πŸ”¬ Memory Detail β€” deep cognitive inspection

Spector Memory Detail

Identity, cognitive state (importance/valence/arousal), synaptic tags, and full relationship graph (Hebbian associations, temporal chains, entity links).

πŸš€ 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

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 β†’


πŸ“– Documentation

I want to... Start here
Use Spector Quick Start Β· Installation Β· Configuration
Contribute to Spector Developer Guide Β· Contributing
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
Deploy to production Docker Deployment Β· Performance Tuning
Extend with Enterprise Spector Enterprise β€” enterprise connectors, access control, management APIs

πŸ“– Full Documentation β†’


🀝 Contributing

We welcome contributions of all kinds β€” code, docs, tests, benchmarks, and ideas!


⭐ 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