-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Klein Panic edited this page Apr 4, 2026
·
1 revision
Memory-Spark uses a 19-block JSON configuration schema.
{
"spark": { ... },
"embed": { ... },
"rerank": { ... },
"fts": { ... },
"chunk": { ... },
"search": { ... },
"hyde": { ... },
"mmr": { ... },
"temporal": { ... },
"pools": { ... },
"gate": { ... },
"cache": { ... },
"ner": { ... },
"zeroShot": { ... },
"summarizer": { ... },
"stt": { ... },
"ocr": { ... },
"glmOcr": { ... },
"reference": { ... }
}{
"spark": {
"host": "10.99.1.1",
"embed": { "port": 18091, "timeoutMs": 30000 },
"rerank": { "port": 18096, "timeoutMs": 60000 },
"llm": { "port": 18080, "timeoutMs": 120000 },
"ner": { "port": 18112, "timeoutMs": 30000 },
"zeroShot": { "port": 18113, "timeoutMs": 30000 },
"summarizer": { "port": 18110, "timeoutMs": 30000 },
"stt": { "port": 18094, "timeoutMs": 60000 },
"ocr": { "port": 18097, "timeoutMs": 60000 },
"glmOcr": { "port": 18080, "timeoutMs": 60000 }
}
}{
"embed": {
"provider": "spark",
"model": "llama-embed-nemotron-8b",
"dimensions": 4096,
"batchSize": 32,
"instructionAware": true,
"defaultInstruction": "Represent the semantic meaning of this text for retrieval"
}
}| Provider | Description | Auth Required |
|---|---|---|
spark |
Local DGX Spark | No |
openai |
OpenAI text-embedding-3 | API key |
voyage |
Voyage AI | API key |
cohere |
Cohere embed | API key |
The Nemotron-8B embedder is instruction-tuned. Queries should be prefixed:
Instruct: {task}\nQuery: {actual_query}
Documents are embedded without prefix.
{
"rerank": {
"provider": "spark",
"model": "llama-nemotron-rerank-1b-v2",
"topN": 40,
"batchSize": 8,
"queryNormalization": true,
"logitRecovery": true
}
}The reranker is trained on Q&A pairs. Declarative claims are converted:
-
"The system uses RRF for fusion"→"Does the system use RRF for fusion?"
Applies inverse sigmoid to restore score spread:
logit(p) = ln(p / (1 - p))
{
"gate": {
"mode": "hard",
"confidentThreshold": 0.08,
"tiedThreshold": 0.02
}
}| Mode | Description | Use Case |
|---|---|---|
off |
Always run reranker | Maximum accuracy |
hard |
Binary skip/run | Production default |
soft |
Blend based on σ | Experimental |
- Confident (σ > 0.08): Top results already well-separated
- Tied (σ < 0.02): All results have similar scores; reranker adds noise
- Ambiguous (0.02–0.08): Reranker provides discriminative signal
{
"fts": {
"enabled": true,
"tokenizer": "stemmed",
"bm25": {
"k1": 1.2,
"b": 0.75
},
"sigmoidMidpoint": 10.0,
"sigmoidSteepness": 0.5
}
}BM25 scores (5–20+) are normalized via sigmoid:
normalized = 1 / (1 + e^(-steepness × (score - midpoint)))
Midpoint 10.0 calibrated to SciFact distribution.
{
"hybrid": {
"method": "rrf",
"rrfK": 60,
"vectorWeight": 1.0,
"ftsWeight": 1.0,
"adaptiveWeights": true
}
}RRF_score(d) = Σ (weight_i / (k + rank_i(d)))
Scale-invariant fusion that doesn't require score normalization.
{
"hyde": {
"enabled": false,
"timeoutMs": 4000,
"maxTokens": 256,
"replacement": true,
"qualityGate": {
"minLength": 50,
"rejectPatterns": ["I cannot", "I'm unable", "As an AI"]
}
}
}- Replacement: Use HyDE embedding directly
- Averaging: Blend query + HyDE embeddings
Replacement performs better for factual retrieval.
{
"mmr": {
"enabled": true,
"lambda": 0.9,
"metric": "cosine",
"fallbackMetric": "jaccard"
}
}- λ → 1.0: Maximize relevance
- λ → 0.0: Maximize diversity
- Default 0.9: Favor relevance with mild diversity
{
"temporal": {
"enabled": true,
"alpha": 0.005,
"referenceField": "timestamp"
}
}decayed_score = score × e^(-α × days_elapsed)
α = 0.005 gives half-life of ~138 days.
{
"chunk": {
"strategy": "hierarchical",
"childSize": 512,
"childOverlap": 64,
"parentSize": 2048,
"parentOverlap": 256
}
}- Child chunks: Retrieved by search (precise)
- Parent chunks: Injected into context (broad)
Best of both: retrieval precision + context breadth.
{
"search": {
"topK": 20,
"minScore": 0.3,
"indexType": "ivf_pq",
"ivfPq": {
"numPartitions": 10,
"numSubVectors": 64,
"bitsPerSubVector": 8
}
}
}- Partitions: Cluster count (higher = finer granularity)
- Sub-vectors: Compression ratio (higher = smaller index)
- Bits: Quantization precision (8 = 256 centroids)
{
"pools": {
"agent_memory": { "weight": 1.0, "temporalDecay": true },
"agent_mistakes": { "weight": 1.6, "temporalDecay": true },
"shared_rules": { "weight": 1.2, "temporalDecay": false },
"shared_knowledge": { "weight": 1.0, "temporalDecay": false },
"sessions": { "weight": 0.8, "temporalDecay": true }
}
}{
"cache": {
"embedding": {
"enabled": true,
"maxSize": 10000,
"ttlMs": 86400000
},
"query": {
"enabled": true,
"maxSize": 1000,
"ttlMs": 3600000
}
}
}