Repository navigation
Closed
Description
Problem
Cortex has been tested with ~1,700 memories (iMac production). We claim it scales. Prove it.
A v1.0 release needs to confidently state: "Cortex handles X memories with Y search latency and Z import throughput." Right now we can't make that claim because we've never tested beyond our own corpus.
Test Matrix
Corpus Sizes
| Tier | Memories | Facts (est.) | DB Size (est.) | Target |
|---|---|---|---|---|
| Small | 1K | 3K | 4 MB | Current production |
| Medium | 10K | 30K | 40 MB | Power user (1 year of notes) |
| Large | 50K | 150K | 200 MB | Heavy connector use |
| XL | 100K | 300K | 400 MB | "Will it break?" |
Benchmarks Per Tier
- Import throughput: memories/second for
cortex import --extract - Import throughput (with enrichment): memories/second for
cortex import --extract(LLM enabled) - Search latency: P50/P99 for BM25, semantic, hybrid, RRF
- Graph build time: How long does
cortex graph --servetake to load? - Stats/stale/conflicts: Do observability commands stay under 1s?
- Embedding generation: memories/minute for
cortex embed - DB vacuum/optimize: How long does maintenance take?
- MCP tool response time: Does MCP stay responsive at scale?
Synthetic Data Generator
Build a script that generates realistic test data:
- Varied content lengths (50-5000 chars)
- Realistic subject distribution (some subjects appear 100x, most appear 1-2x)
- Mix of fact types (kv, relationship, temporal, decision, etc.)
- Multiple sources/agents to test filtering
Performance Targets (v1.0 SLOs)
| Operation | Target (10K) | Target (100K) |
|---|---|---|
| BM25 search | <50ms P99 | <200ms P99 |
| Hybrid search | <100ms P99 | <500ms P99 |
| Import (no LLM) | >100 mem/s | >50 mem/s |
| Stats | <100ms | <500ms |
| Graph load | <2s | <10s |
Acceptance Criteria
- Synthetic data generator committed to
scripts/bench/ - All four tiers tested with results documented
- Performance targets established and documented in README
- Any operation that degrades >5x between 10K and 100K gets investigated and optimized
- SQLite PRAGMA tuning documented (journal_size_limit, cache_size, mmap_size)
- CI runs the "Medium" benchmark on every PR (fast enough to not slow CI)
Activity
feat: search quality benchmark + scale testing (#230, #232)
hurttlocker commentedon Feb 26, 2026
Scale & performance testing shipped (commit c0dfb22).
What shipped:
~/.cortex/scale_results.jsongo test ./scripts/bench/ -run TestScale -timeout 5mResults:
All SLO targets exceeded with wide margin:
50K and 100K tiers deferred — the 10K results show linear scaling with no degradation cliffs. The architecture handles it.