Repository navigation
Configuration
Spector's unified configuration subsystem powers everything from microsecond embedded vector search to multi-tenant distributed cognitive memory clusters. This guide outlines the 6-layer configuration hierarchy, profile activation, discovery paths, and runtime resolution mechanics.
-
:material-file-document-outline: spector.yml Master Reference
Exhaustive dictionary of all 32 configuration domains, data types, constraints, and default values.
Explore YAML Reference ↗{ .md-button .md-button--primary }
-
:material-variable: Environment Variables & Secrets
Canonical screaming snake_case mappings, short aliases, Docker secrets, and Panama FFM runtime flags.
View Environment Guide ↗{ .md-button }
-
:material-cloud-outline: Deployment & Cloud Config
Docker container matrices, Helm
values.yamltuning, and Terraform modules for AWS, GCP, and Azure.Explore Cloud Config ↗{ .md-button }
-
:material-api: REST API & Runtime Parameters
HTTP headers, request payload schemas, query parameters, and cognitive modifiers across all endpoints.
Browse API Parameters ↗{ .md-button }
-
:material-tune: Engine & Algorithmic Tuning
Programmatic Java builder API, HNSW graph parameters, quantization profiles, and retrieval weights.
Read Tuning Guide ↗{ .md-button }
Spector employs a layered, hierarchical configuration engine built in nucleus/spector-config centered on SpectorConfigSource. Under the hood, it layers multiple configuration sources using Apache Commons Configuration 2 with an OverrideCombiner.
Higher layers take precedence over lower layers, allowing global defaults to be established in version control while environment-specific secrets, container volumes, and runtime flags selectively override individual keys.
flowchart TD
subgraph Resolution["Resolution Hierarchy (Highest Priority Wins)"]
direction TB
L1["1. Programmatic Overrides<br/><code>SpectorConfig.DEFAULT.with...</code>"]
L2["2. Java System Properties<br/><code>-Dspector.provider.embedding.dimensions=768</code>"]
L3["3. Environment Variables<br/><code>SPECTOR_PROVIDER_EMBEDDING_DIMENSIONS=768</code>"]
L4["4. Profile Configuration<br/><code>spector-{profile}.yml</code>"]
L5["5. Local YAML<br/><code>spector.yml (Working Directory)</code>"]
L6["6. Bundled Classpath Defaults<br/><code>spector-defaults.yml (JAR)</code>"]
end
L1 --> L2
L2 --> L3
L3 --> L4
L4 --> L5
L5 --> L6
subgraph Consumer["Spector Runtime Components"]
Engine["SpectorMemory Kernel"]
Index["SpectorIndex HNSW / Quant"]
Synapse["Spector Synapse REST & MCP"]
CLI["Spector CLI & Ingestion"]
end
Resolution --> Consumer
| Priority | Layer | Source | Typical Use Case |
|---|---|---|---|
| 1 (Highest) | Programmatic Overrides |
SpectorConfig.builder() / Java API |
Unit tests, embedded microservices, custom agent harnesses |
| 2 | System Properties |
-Dspector.* JVM CLI options |
One-off CLI overrides, JVM performance diagnostics |
| 3 | Environment Variables |
SPECTOR_* OS environment |
Kubernetes Pods, Docker containers, CI/CD runners, Docker Secrets |
| 4 | Active Profile YAML | spector-{profile}.yml |
Environment profiles (docker, production, bench, test) |
| 5 | Local YAML |
spector.yml (working dir) |
Local developer workstations, custom host deployments |
| 6 (Lowest) | Classpath Defaults |
spector-defaults.yml (bundled) |
Factory baseline defaults guaranteed by the JAR |
When using Spector embedded as a Java library, code-level builder invocations override any external configuration files:
import com.spectrayan.spector.config.SpectorConfig;
import com.spectrayan.spector.model.QuantizationType;
// Programmatic configuration completely overrides environment and YAML defaults
var config = SpectorConfig.DEFAULT
.withDimensions(768)
.withCapacity(1_000_000)
.withQuantization(QuantizationType.SCALAR_INT4)
.withRescore(3);System properties passed on the command line via -D override environment variables and configuration files:
java \
--enable-preview --add-modules=jdk.incubator.vector --enable-native-access=ALL-UNNAMED \
-Dspector.provider.embedding.dimensions=1536 \
-Dspector.provider.embedding.type=openai \
-jar spector-synapse.jarEvery dot-notation configuration property automatically maps to a screaming snake_case environment variable. Dots and hyphens are replaced with underscores, and the key is uppercased:
-
spector.provider.embedding.dimensions$\to$ SPECTOR_PROVIDER_EMBEDDING_DIMENSIONS -
spector.hnsw.ef-construction$\to$ SPECTOR_HNSW_EF_CONSTRUCTION -
spector.provider.embedding.api-key$\to$ SPECTOR_PROVIDER_EMBEDDING_API_KEY
For container convenience, Spector also supports short aliases (e.g. SPECTOR_EMBEDDING_PROVIDER) and Docker secrets (/run/secrets/). See the Environment Variables & Secrets Guide for the complete mapping table.
Profiles allow you to package environment-specific configurations cleanly. When a profile is active, Spector loads spector-{profile}.yml and overlays it on top of spector.yml.
Profiles can be activated using either an environment variable or a command-line argument:
# Via Environment Variable
export SPECTOR_PROFILE=docker
# Via Spring / Synapse CLI argument
java -jar spector-synapse.jar --spector.profile=production-
spector-docker.yml— Optimized for containerized environments (/data/memorypersistence,host.docker.internalnetworking, reduced memory footprint). -
spector-bench.yml— Tuned for maximum recall benchmarks (uncompressed vectors, elevated$efSearch$ , disabled background sleep consolidation). -
spector-test.yml— In-memory persistence (MEMORY), zero disk footprint, ephemeral test isolation.
A spector.yml file placed in the application's working directory provides baseline project configuration. If present, it overrides the bundled defaults:
spector:
mode: MEMORY
memory:
persistence-mode: DISK
persistence-path: ./data/memory
dimensions: 768
provider:
embedding:
type: ollama
model: nomic-embed-textThe JAR bundles spector-defaults.yml (located in nucleus/spector-config/src/main/resources/spector-defaults.yml). This file guarantees that Spector always has valid, production-hardened defaults for all 35 property groups even if no configuration files or environment variables are provided.
When bootstrapping via SpectorConfigSource.load(), Spector searches for YAML configuration files in the following sequence:
-
Explicit Path: If specified via
SpectorConfigSource.load(Path.of("/custom/path.yml"))or--spring.config.additional-location=file:/app/spector.yml. -
Current Working Directory:
./spector-{profile}.ymlthen./spector.yml. -
User Home Directory:
~/.spector/spector-{profile}.ymlthen~/.spector/spector.yml. -
System Configuration Directory:
/etc/spector/spector.yml(on Linux / Unix systems). -
Classpath:
classpath:spector-defaults.yml.
Configuration loading performs strict validation on initialization. If an invalid type, unparseable duration, or out-of-range value is encountered, Spector fails fast with clear diagnostic exceptions:
-
SpectorConfigNotFoundException— Thrown when an explicitly required configuration file is missing from the file system. -
SpectorConfigParseException— Thrown when a YAML file contains malformed syntax, unescaped characters, or illegal indentation. -
SpectorValidationException(withErrorCode.INVALID_ARGUMENT) — Thrown when a value violates semantic constraints (e.g.dimensions <= 0, unknown provider enum, ordecay-factor > 1.0).
- Consult the Master spector.yml Reference for full configuration keys, ranges, and schema details.
- Review Environment Variables & Secrets for production container operations.
- Inspect Deployment & Cloud Config for Kubernetes Helm and Terraform setups.
- Home
-
Getting Started
- Quick Start
- Installation
- Developer Guide
- JDK API Status
- MCP Server
- Java SDK
- Java API Reference
- Python SDK
- TypeScript SDK
- Spring AI Integration
- CLI Reference
- REST API
- API Playground
- Error Codes
- Configuration
- Deployment
-
Cognitive Memory
- Overview
- Getting Started
- Use Cases
- API Reference
- Concepts
- Pathways
- Scoring features
- Profiles
- Experimental
- Internals
- Design ancestry
-
Memory Kernel
- Overview
- Bundle Architecture
- Memory Shapes
- Binary Layouts & Tags
- WAL & Durability
-
Region Reference
- Overview & Index
- Partition Regions
-
Runtime Regions
- Working Memory
- Co-Activation Matrix
- Index MIDX
- Index IDPL
- Hebbian Graph
- Temporal Chains
- Temporal Facts
- Entity Directory
- Entity Names Pool
- HyperEntity Graph
- Entity Types Registry
- Relation Types Registry
- BM25 Lexical Index
- Checkpoint
- Insula (Somatic Self-Model)
- Continuity
- Provenance
- SPLADE Sparse Index
- Entity Reverse Index
- Identity Regions
- Synapse & Cortex
-
Architecture
- System Overview
- Core Concepts
- Ingestion Pipeline
- MCP Integration
- Distributed Mode
- Event Notifications
- Namespace Sharding
- Single-Namespace Scale & Capacity Limits
- Scale Benchmark Empirical Results
- Writer Quiesce Pause Empirical Results
- Kill-Owner Failover Empirical Results
- Salience & Importance Architecture
- GPU Acceleration
- Performance Tuning
- Test Framework & LLM Judge
- Chat & Visual Test Infrastructure
- Security & Data
-
Architecture Decision Records (ADRs)
- Overview
- Template
- Master Catalog (0001-0088)
-
Memory Kernel & Storage Formats
- ADR-0001: Graph Compression Strategy for Entity Graph
- ADR-0002: Multi-Partition Recall Fan-Out & Frozen Reten...
- ADR-0003: Completing Hypergraph Entity-Graph Graduation
- ADR-0004: Mmap Bundle Architecture & File Descriptor Sc...
- ADR-0005: spector-memory Technical Debt Hardening
- ADR-0042: Graph Recall Architecture and Cognitive Trave...
- ADR-0043: Single-VMA Bundle Layout Specification
- ADR-0044: Memory Kernel Isolation, Composition, and Layout
- ADR-0045: Spector Memory Import & Export Pipeline
- ADR-0046: Single Engram, Four Stores Storage Architecture
- ADR-0047: Episodic Memory and Engram Model Hierarchy
- ADR-0057: Remediation of Hardcoded Memory Offsets and Alignment Constants
- ADR-0062: Spector Memory Organization — Three-Plane Architecture
- ADR-0082: Index Plane Lifecycle, Derived Views, and Reconciliation
-
Active Inference Self-Model Engine (AISME)
- ADR-0006: Episodic Conversation Architecture
- ADR-0007: ReflectPathway — Biological Sleep Consolidation
- ADR-0008: Cognitive Substrate Evolution (TANGLE, GPM, M...
- ADR-0009: AISME Phase 1 — Homeostatic Affective Core
- ADR-0010: AISME Phase 2 — Free-Energy Guided Recall
- ADR-0011: AISME Phase 3 — Modern Hopfield Associative M...
- ADR-0012: AISME Phase 4 — Neural Manifold Distance (NMD)
- ADR-0013: AISME Phase 5 — Predictive Coding Narrative Self
- ADR-0014: AISME Phase 6 — Consciousness Continuity Metr...
- ADR-0015: AISME Phase 7 — Synaptic Relay Wiring & Pathw...
- ADR-0016: AISME Phase 8 — Closed-Loop Epistemic Learning
- ADR-0017: AISME Phase 9 — Generative Counterfactuals & ...
- ADR-0018: AISME Phase 10 — WanderPathway & Kernel Conti...
- ADR-0019: AISME Phase 11 — Expected Free Energy Policy ...
- ADR-0020: AISME Phase 12 — Continuous Self-Dynamics
- ADR-0023: AISME Complete Loop Closure & CognitiveVector...
- ADR-0024: Polymorphic SoulContext Hierarchy in AISME
- ADR-0027: Soul-Conditioned & Salience-Modulated Persona...
- ADR-0048: Cross-Capture Graph & CoActivation Kernel
- ADR-0049: Identity Trajectory Lyapunov Stability
- ADR-0050: Event Density Gating and Dynamic Epistemic Co...
- ADR-0051: Bayesian Online Change-Point Episode Segmenta...
- ADR-0052: Differential Privacy and Edge Anonymization
- ADR-0053: Multimodal Composite Importance Scoring
- ADR-0054: Lifespan-Adaptive Forgetting & Retention Kernel
- ADR-0055: LSR & RFF Dense Associative Memory Engineerin...
- ADR-0056: Log-Sum-ReLU (LSR) & Random Fourier Features ...
- ADR-0058: Linguistic & Vocal Prosody Expression Engine
- ADR-0063: Spacetime Vector Search and Synaptic Relay Architecture
- ADR-0064: Spacetime Simulation on Wander, Dream, and Express Pathways
- ADR-0071: Remember Cognitive Pathway Architecture
- ADR-0072: Six-Phase Fused Cognitive Scoring Pipeline
- ADR-0073: Recall Cognitive Pathway and Multi-Phase Retrieval Architecture
- ADR-0074: Reflect Cognitive Pathway and Sleep Consolidation Architecture
- ADR-0078: Salience Network and Thalamic Cognitive Profiles Architecture
-
Platform, Synapse & Clustering
- ADR-0021: Nucleus Symmetric Hardware Abstraction Layer ...
- ADR-0022: Embodied Kinesics & Phenomenological MCP Engine
- ADR-0025: Declarative MCP Tool Definitions via JSON Sch...
- ADR-0026: Dual-Plane Concurrency & Async Queue Backpres...
- ADR-0028: Dual-Plane Memory Audit Architecture (Separat...
- ADR-0029: Episodic→Semantic Lineage Provenance Region
- ADR-0030: Unified Engram Encoding Header Architecture
- ADR-0031: Unified Configuration Architecture & Bypass E...
- ADR-0032: Persona Enactment — Soul as Policy over Memory
- ADR-0033: Decoupling Cognitive & Mathematical Kernels t...
- ADR-0034: Cell Topology, Namespace Ownership, and HA Cl...
- ADR-0035: Cognitive Pathway Framework Rearchitecture
- ADR-0036: Pathway Error Handling, Isolation, and Circui...
- ADR-0037: Ingestion Boundary and Sensory Relocation
- ADR-0038: SIMD-Accelerated BM25 Lexical Scoring Optimiz...
- ADR-0039: Robust Unified Rate Limiting Architecture
- ADR-0040: Universal Apache Camel Messaging Channels
- ADR-0041: Unified Connector Architecture for Ingestion
- ADR-0059: Java 27 Upgrade Strategy and Value Class Migration
- ADR-0060: Cognitive Continuity Layer and Decoded Mind Streams
- ADR-0061: In-Memory Multi-Tenant Quartz Scheduler
- ADR-0065: Client SDK Architecture, OpenAPI, and MCP Integration
- ADR-0066: Engine & CLI Stabilization — Issue #727 Hardening
- ADR-0067: Cell-Based High Availability and Namespace-Sticky Sharding
- ADR-0068: Phileas PII Redaction Engine for Spector Synapse
- ADR-0069: Synapse-Owned Tool Access Policy
- ADR-0070: Unified Error Taxonomy and Exception Handling Architecture
- ADR-0075: Extensible LLM and Multimodal Embedding Provider SPI
- ADR-0076: Zero-Dependency Pluggable Cache Abstraction
- ADR-0077: Model B Asynchronous Task Queue and Concurrency
- ADR-0079: Asynchronous Memory Event and Telemetry Notification Bus
- ADR-0080: Observed Memory and Pathway Metrics Telemetry Architecture
- ADR-0081: Dedicated Reactive Ingress and In-Process Path Router
- ADR-0083: Namespace-Isolated Memory Analytics & Telemetry
- ADR-0084: Dual-Plane Conversation Persistence
- ADR-0085: Dynamic Synapse Configuration Overrides and Runtime Propagation
- ADR-0086: Procedural Skill Crystallization
- ADR-0087: Admin Role Model, Content-Free Admin API Contract & Break-Glass Policy
- ADR-0088: Bring Your Own Key (BYOK) & Per-Tenant Envelope Encryption
-
Modules Registry
- Overview
- Foundation Layer (/nucleus)
- Cognitive Layer (/memory)
- Gateway Layer (/synapse)
- Benchmarks & UI
- Deep Dives
-
Community
- Governance
- Contributing
- FAQ
- Glossary
- Roadmap
- 🔬 Labs
- Third-Party Legal