This release includes breaking changes for platform teams planning a safe upgrade.
✓ No known CVEs patched in this version
Summary
AI summaryFixed Tokio runtime starvation by offloading heavy AI inference and optimized indexing with parallel parsing and batched DB writes.
Full changelog
v0.5.2 - Massive I/O & Concurrency Optimizations 🚀
This release introduces a comprehensive overhaul of the codebase's core indexer, memory handling, and database interaction layers. These changes dramatically reduce indexing time and fix hidden bottlenecks that caused Tokio thread starvation.
⚡ Concurrency & Threading
- Fixed Tokio Runtime Starvation: Moved heavy AI inference (Qwen3/BERT embeddings) out of the main async executor using
spawn_blocking, eliminating server freezing. - Removed Async Inference Locks: Extracted the embedding engine behind an
Arcclone, allowing theRwLockread guard to be dropped immediately before CPU-bound inference starts. - Parallel AST Parsing: The
indexer.rshot loop now uses a boundedJoinSet::spawn_blocking(max 4 concurrent workers). Files are parsed and hashed in parallel, while database writes remain safely sequential.
💽 Disk I/O & Memory Optimization
fsyncCoalescing in Redb: Implementedput_batch()in theEmbeddingStore. Instead of callingfsync()thousands of times per file, embedding disk caches are now flushed in large, single-transaction blocks (100x disk I/O reduction).- BM25 Memory Bloat Fixed: Added
OMIT embeddingto SurrealDB chunk fetching queries. BM25 search no longer loads thousands of unused 768-dimensional float arrays into RAM. - Zero-Copy Hot Loop: Replaced massive
content.clone()allocations with move semantics in the parallel AST parser.
🗄️ SurrealDB Query Batching
- Eliminated N+1 DB Queries (Relations):
create_symbol_relationsnow collects all links in-memory and pushes them to the DB using a single batchedFOR $r IN $relations { RELATE ... }statement. - Eliminated N+1 DB Queries (Subgraphs): Replaced sequential
db.select()insideforloops with a massiveSELECT * FROM id1, id2...query. - True Symbol Batching: "Fake" batched upserts in
create_code_symbols_batchwere rewritten into a nativeINSERT INTO code_symbols ... ON DUPLICATE KEY UPDATEsingle query. - HNSW Vector Index Acceleration: Refactored
vector::similarity::cosinevector searches to use the<|K,EF|>KNN operator, activating SurrealDB's internal ANN indexes instead of relying on brute-force O(N) table scans.
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About pomazanbohdan/memory-mcp-1file
A self-contained Memory server with single-binary architecture (embedded DB & models, no dependencies). Provides persistent semantic and graph-based memory for AI agents.
Related context
Beta — feedback welcome: [email protected]