Summary
HTTP server serializes ALL requests via Mutex<Uteke> (main.rs:571-578). Read-only requests (recall, search, list, stats) blocked while writes process.
With 17K+ memories, a single /recall can take 50-100ms. During this time no other requests can be processed.
Proposed Fix
Replace Mutex<Uteke> with RwLock<Uteke>:
- Read endpoints (recall, search, list, stats, health, namespaces, graph, room/, doc/, context) =
read()
- Write endpoints (remember, forget, room/create, room/delete, doc/create, doc/move, doc/delete) =
write()
Acceptance Criteria
Functional
Verification (CMO can run without reading code)
Tests
Priority
Medium — performance bottleneck under load.
Summary
HTTP server serializes ALL requests via
Mutex<Uteke>(main.rs:571-578). Read-only requests (recall, search, list, stats) blocked while writes process.With 17K+ memories, a single /recall can take 50-100ms. During this time no other requests can be processed.
Proposed Fix
Replace
Mutex<Uteke>withRwLock<Uteke>:read()write()Acceptance Criteria
Functional
Mutex<Uteke>withRwLock<Uteke>read()— concurrent accesswrite()— exclusive accessVerification (CMO can run without reading code)
curl GET /healthreturns 200 (basic sanity)curl POST /recallrequests → all return 200 within 500ms each (no serialization)POST /recall, anotherPOST /recallcompletes without waiting (concurrent reads)POST /remember(write), aPOST /recall(read) can still complete (read doesn't block on write)POST /remember, a secondPOST /rememberwaits until first completes (writes are exclusive)cargo testpasses (no data race warnings from#[warn(dead_code)])Tests
Priority
Medium — performance bottleneck under load.