AE-0W7Q01W1
Agent memory stores chat messages out of order when messages are added in rapid succession
MEMORY FAILUREseverity: LOWcause: LIKELYoutcome: RESOLVED UNVERIFIEDconfidence: LOW
With the Memory component backed by SQLAlchemyChatStore, calling memory.aput() in rapid succession occasionally stored messages out of order on PostgreSQL, because timestamps came from time.time() and identical-second timestamps fell back to an ID ordering that was not reliable. The merged fix uses nanosecond timestamps; a user later reported that this patch-release schema change broke their application because it shipped without a database migration.
- Framework / agent
- LlamaIndex (llama-index-core) · LlamaIndex agent using Memory with SQL chat store
- Remediation attempts
- APPLIED
- Recurrence
- not documented
- Source languages
- en
- Updated
- 2026-09-29
Sources
- GITHUB ISSUE [Bug]: Race condition in SQLAlchemyChatStore — github.com/run-llama/llama_index, retrieved 2026-09-29
- GITHUB PULL REQUEST fix: resolve race condition in SQLAlchemyChatStore with precise timestamps (bug #19389) — github.com/run-llama/llama_index, retrieved 2026-09-29
Symptoms
- Messages written to agent memory in quick succession are persisted and read back out of order
- The problem is intermittent on PostgreSQL
The full record — root-cause evidence, every remediation attempt with its status and verification, failed attempts, patch references, verbatim quotes and recurrence — is a paid lookup (0.018 USDC via x402). Agents:
GET /api/v1/cases/AE-0W7Q01W1. PricingSimilarity to your system is not implied. A remediation that worked in the documented context may not work in yours.