hindsight icon indicating copy to clipboard operation
hindsight copied to clipboard

Mental model refresh OOM-kills the container at scale: a SINGLE refresh = 17.7GB RSS on a 40K-node / 815K-link bank

Open paulsto opened this issue 3 months ago • 13 comments

Mental model refresh OOM-kills the container at scale: a SINGLE refresh = 17.7GB RSS on a 40K-node / 815K-link bank

Summary

On a single large bank (~40K memory nodes, ~815K links, 15.6K observations), one refresh_mental_model operation deterministically OOM-kills the hindsight-api process. The kernel reports Out of memory: Killed process (hindsight-api) anon-rss: ~17.5GB within ~60-90s of the refresh starting. This happens with tick-triggered refreshes and with a single manually-triggered refresh in isolation. Container memory is unbounded (no --memory cap), swap fills (3.8/3.8Gi), and the container crash-loops because the worker re-claims the pending refresh op on every restart.

This is the memory-side of the problem in #3290 and the mechanism described in #3122, but I could not find the OOM-at-scale report filed anywhere, so here is the reproduction data.

Environment

  • Hindsight v0.9.0 (image ghcr.io/vectorize-io/hindsight:latest, built 2026-08-07)
  • Docker, no --memory limit, --shm-size=2g
  • LLM: DeepSeek v4-flash via API (HINDSIGHT_API_LLM_PROVIDER=deepseek), HINDSIGHT_API_LLM_MAX_CONCURRENT=64
  • Host: 8-core / 19GiB Linux VM
  • Bank: hermes-main, 40,619 nodes (23,471 world / 1,500 experience / 15,648 observation), 815,676 links, 1,009 documents
  • 13 mental models / knowledge pages (12 knowledge pages + 1 mental model), all with refresh_cron: "0 6 * * *", delta mode, refresh_after_consolidation: false

Controlled test matrix (all single-refresh, nothing else queued)

Each test: container recreated clean (tick disabled, HINDSIGHT_API_MENTAL_MODEL_REFRESH_TICK_SECONDS=0), all prior refresh ops marked failed in pg0, exactly ONE refresh submitted via POST /v1/default/banks/{bank}/mental-models/{id}/refresh, memory sampled every 30s.

Test Config t+30s RSS Peak RSS Result
1 baseline (chunks on, default recall) 12.2 GiB 17.7 GiB anon kernel OOM kill
2 HINDSIGHT_API_RECALL_INCLUDE_CHUNKS=false 12.3 GiB 17.5 GiB anon kernel OOM kill
3 chunks off + HINDSIGHT_API_RECALL_MAX_TOKENS=512 (default 2048) 1.3 GiB 17.4 GiB anon kernel OOM kill

Kernel log (same signature all three runs):

Out of memory: Killed process (hindsight-api) total-vm:33.7GB, anon-rss:17.5GB

Test 3 is the informative one: capping the recall text budget delayed the initial climb (1.3GiB vs 12GiB at t+30s) but the process still blew past 17GiB before the refresh could complete. That matches #3122's mechanism — the serialized tool-result envelope (id, chunk_id, document_id, context, entities, metadata, scores, tags, type per observation) is not bounded by the recall token budget, so on a bank with 815K links the graph-expanded recall + envelope serialization in the reflect agent loop accumulates until the kernel kills the process.

Also found: the refresh concurrency knob appears to be dead code in v0.9.0

HINDSIGHT_API_MENTAL_MODEL_REFRESH_CONCURRENCY (default 8, documented as "Max concurrent mental model refreshes") is read into config (config.py L533/L1126/L3480) but never referenced by any engine file — worker.py, maintenance.py, memory_engine.py don't use it. Setting it to 1 changed nothing: all 13 due refreshes still ran concurrently. If the intent is a working cap, it needs wiring; if it's meant to be removed, the docs should say so.

Impact

  • Any bank that grows past the point where a single refresh's serialized recall envelope fits in container memory will crash-loop whenever refreshes are due (all models sharing refresh_cron become due simultaneously, so the whole sweep fires at once).
  • This is not just an agent-memory edge case: the same operation that powers knowledge pages (same engine, same refresh behaviour per the FAQ) makes the daily refresh cycle fatal at scale.
  • Community reports predate this (e.g. #996, April 2026: unbounded hindsight-api growth; the accepted workaround there was a hard --memory cap so the OOM killer restarts the container — which loses the refresh and crash-loops if the op re-claims).

Suggested fixes (in priority order)

  1. Ship the #3290 two-tier refresh (deterministic fast path, agentic loop as escape hatch) — the fast path should be bounded-memory by construction.
  2. Budget the tool-result envelope against max_tokens (per #3122), not just the observation text — so a single refresh cannot accumulate gigabytes.
  3. If #3290 is weeks out: a working refresh-concurrency cap plus an in-flight guard so a stale sweep can't re-queue a full wave after a crash.
  4. If neither lands soon: at minimum, document the failure mode + --memory cap band-aid on the perf page.

Happy to provide more data — bank dumps, pg0 queries, full docker logs, or run a targeted repro against a build that includes a fix.

paulsto avatar Aug 10 '26 15:08 paulsto

Thanks for the incredibly detailed writeup — the controlled matrix, the kernel signatures, and the pointer to the REFRESH_CONCURRENCY dead code are all really useful, and you're right that it's dead: mental_model_refresh_concurrency is read into config but never referenced by any engine file. We'll fix that separately.

Before we chase the memory number down, we'd like to pin the attribution a bit tighter, because a couple of details in the setup mean the reported figure might not be "one refresh in isolation":

  1. No pre-refresh baseline. The table starts at t+30s — is there an idle RSS reading right after startup, before the refresh is submitted? That baseline isn't zero: the defaults are HINDSIGHT_API_EMBEDDINGS_PROVIDER=local and HINDSIGHT_API_RERANKER_PROVIDER=local, so a freshly-started container already has the embedder and the cross-encoder reranker resident in-process. We'd like to subtract that.

  2. Other background loops were still running. Setting HINDSIGHT_API_MENTAL_MODEL_REFRESH_TICK_SECONDS=0 only silences the refresh tick. The consolidation reconcile loop (HINDSIGHT_API_CONSOLIDATION_RECONCILE_INTERVAL_SECONDS) and the retain batch poller (HINDSIGHT_API_RETAIN_BATCH_POLL_INTERVAL_SECONDS), plus graph maintenance, are still ticking. On a bank this size (40K nodes / 815K links / 15.6K observations), consolidation firing concurrently could account for a meaningful share of that RSS, and 30s sampling can't separate it from the refresh. Could you re-run with those intervals also set to 0 (or attach the docker logs for the window, so we can see whether consolidation/GM ran alongside)?

  3. Embeddings/reranker provider — local vs TEI? Local adds in-process model RSS that a TEI deployment wouldn't have; knowing which you're on helps us reason about the baseline.

One more data point that's already interesting: you mention the reported synthesis was ~730 input tokens with 503 citations. If the 17GB were the serialized recall envelope reaching the LLM (the #3122 mechanism), we'd expect token usage to be enormous, not 730 — so the memory is very likely in Python-side intermediate objects during retrieval/fusion, upstream of the token budget. That's also consistent with your Test 3: capping RECALL_MAX_TOKENS=512 knocked the t+30s spike down 12GiB→1.3GiB but the run still climbed to 17GiB, which the token budget shouldn't have let happen if the envelope were the whole story.

If, after disabling the other loops and recording an idle baseline, a genuinely isolated single refresh still climbs from ~1.5GB to ~17GB, that would be a clean repro and we'll add streaming, OOM-survivable instrumentation (per-arm row counts + RSS logged to stdout at each stage boundary) so we can localize exactly which retrieval arm/iteration crosses the GB thresholds — the current traces are persisted only at the end of a refresh, so an OOM-killed run writes nothing, which is why there's no visibility today.

Thanks again — happy to keep digging once we have the isolated numbers.

nicoloboschi avatar Aug 11 '26 16:08 nicoloboschi

Thanks for the engagement on all three points — we've run the isolated test you asked for. Answers in order:

1. Idle baseline (pre-refresh, right after startup)

Fresh container, all three background loops silenced (HINDSIGHT_API_MENTAL_MODEL_REFRESH_TICK_SECONDS=0, HINDSIGHT_API_CONSOLIDATION_RECONCILE_INTERVAL_SECONDS=0, HINDSIGHT_API_RETAIN_BATCH_POLL_INTERVAL_SECONDS=0). Sampled at 10s intervals after API came up:

976.7MiB -> 1.132GiB -> 1.064GiB -> 1.07GiB -> 1.079GiB -> 1.084GiB   (stable ~1.08GiB)

So yes, you're right that the baseline isn't zero — local embedder + cross-encoder reranker resident in-process lands at ~1.08GiB idle. That makes the isolated refresh increment: 15.0GiB anon − 1.1GiB baseline ≈ ~13.9GiB attributable to the refresh alone.

2. Other loops

Confirmed silenced for this run: reconcile interval 0, retain batch poll interval 0, refresh tick 0 (was already 0 from our earlier stabilization). Graph maintenance: no interval knob exists in v0.9.0 — graph_maintenance only appears as a worker-slot reservation type (default 0), which is how we left it. Docker logs for the window captured (791 lines).

3. Providers

Local both: HINDSIGHT_API_EMBEDDINGS_PROVIDER=local (BAAI/bge-small-en-v1.5) and HINDSIGHT_API_RERANKER_PROVIDER=flashrank. No TEI.

The isolated single-refresh result

One refresh (Pauls Working Preferences mental model) against the 40K-node / 815K-link bank, nothing else running:

05:52:03  4.17GiB   RC=3    (refresh running, climbing)
05:52:10  dead              (kernel OOM, restart)
05:52:16  480MiB            (boot)
05:52:22  1.41GiB
05:52:28  3.00GiB           (climbing again — op re-claimed on boot)
05:52:36  dead
... repeats ...
05:53:26  2.83GiB
05:53:35  dead              <- kernel log: anon-rss 15.0GiB, total-vm 29.6GiB

Kernel signature (journalctl -k, 05:53:35 UTC):

Out of memory: Killed process 2628996 (hindsight-api) total-vm:29670112kB, anon-rss:15041528kB, ...
oom-kill: constraint=CONSTRAINT_NONE, global_oom, task=hindsight-api

Key observations:

  • The climb is explosive, not gradual. 5s-cadence sampling shows 2.8GiB at 05:53:26 -> dead at 05:53:35. ~13GiB in under ~10s. This matches your "Python-side intermediate objects during retrieval/fusion" hypothesis far better than a token-envelope story — a 730-token/503-citation synthesis can't serialize 13GiB of envelopes in 9 seconds, but materializing per-arm retrieval rows in memory absolutely can.
  • Isolated single refresh still kills the box: baseline ~1.08GiB, no consolidation, no retain polling, no graph maintenance, no refresh tick. The refresh alone goes 1.1 -> 15.0GiB anon.
  • Op re-claims on every boot (single-flight dedup within a boot, but not across restarts): the same refresh op was re-claimed after each kill, RC climbed 3->7 before we marked it failed via SQL. That's the crash-loop mechanism — worth noting for the OOM-survivable instrumentation you mentioned, since the re-claim is what makes the loop self-sustaining.
  • HINDSIGHT_API_MENTAL_MODEL_REFRESH_CONCURRENCY=1 was set during this run (our env) — confirmed irrelevant, as you noted.

This is the clean repro: idle ~1.1GiB, one refresh, nothing else, global OOM at 15.0GiB anon in <40s. We'd be happy to re-run against a build with the streaming per-arm instrumentation when it's ready — happy to provide full logs or a bank dump if useful.

paulsto avatar Aug 12 '26 05:08 paulsto

That's a clean repro — thank you for running it properly. Idle baseline recorded, all three loops silenced, providers pinned: the attribution is settled and we're treating this as ours. ~1.1GiB → 15.0GiB anon for a single refresh with nothing else running is not something we can explain away.

Two things in your numbers that we agree change the diagnosis:

  • The burst shape kills the envelope story. 2.83GiB at 05:53:26 → dead at 05:53:35 is ~13GiB in under 10 seconds. A 730-input-token synthesis cannot serialize that. Combined with Test 3 (capping RECALL_MAX_TOKENS delayed the climb but didn't stop it), the allocation is upstream of anything the token budget governs. So #3122 is not the fix for this, and we've stopped treating it as such.
  • The cross-restart re-claim is a separate bug. Single-flight within a boot but not across restarts is what turns one OOM into a crash-loop that needs manual SQL to break. We're splitting that into its own issue — it's cheaper to fix than the memory itself and it's the part that makes this catastrophic rather than merely annoying.

We've since audited every tool the reflect agent can call, and one of them is unbounded in a way that fits your data. expand(depth="document") takes an uncapped memory_ids array and returns documents.original_text — full document bodies — for every distinct document behind those ids. Nothing caps the id count, nothing token-budgets the payload, and RECALL_MAX_TOKENS doesn't touch that path. Each such result is then serialized into the message history, retained again in the tool trace and the context history, and the whole accumulated history is re-tokenized on every subsequent iteration. That's a plausible route from a normal-looking refresh to double-digit GB, and it would explain why your Test 3 cap helped early and not late.

Yes, please send the 791 lines — that's useful regardless, and it independently confirms the isolation rather than us taking it on trust.

But we should be straight with you about what those logs can and can't show, because we'd rather not burn another round-trip: on the happy path the reflect loop logs nothing per iteration, and every reflect-internal recall runs with logging suppressed. Worse, we compute the exact number we want — the serialized size of each tool result — for every single call, and then only print it in the completion line, which an OOM-killed run never reaches. So the logs will likely tell us whether the context guard fired and roughly how far it got, and not much more. We're fixing that (emit the size when it's computed, plus an RSS stamp at each stage boundary), and we'll ping you when there's a build.

In the meantime, two cheap tests that would cut much harder than the logs:

1. HINDSIGHT_API_REFLECT_MAX_ITERATIONS=2, same isolated single refresh.

That allows exactly one tool turn before forcing final synthesis. If it survives, the blowup is accumulation across iterations. If it still OOMs, a single turn does it alone. Either answer eliminates half the search space.

Please use 2, not 1 — at 1 the agent goes straight to synthesis over an empty history and retrieves nothing, so it would survive without telling us anything.

2. A dry run against a mental model that currently completes.

POST /v1/default/banks/{bank_id}/mental-models/{mental_model_id}/dry-run-refresh

The dry-run response deliberately carries the full output of every tool call (the persisted trace strips them; the dry-run response doesn't), along with per-call iteration, result_count and duration_ms. That's exactly the per-tool payload data the logs withhold. Pick whichever of your other 12 models has a source query closest to the failing one so it's hitting the same bank in a similar way. What we're looking for: whether expand shows up at all, at what depth, and how many memory_ids it's being handed.

If that response is large, feel free to strip the tool output bodies and keep just tool / iteration / result_count / duration_ms per call plus the input arguments — that alone would tell us most of what we need, and avoids you posting bank contents in public.

On the dead MENTAL_MODEL_REFRESH_CONCURRENCY knob: confirmed, tracked, fixing separately as you flagged.

Thanks again for the rigour on this one — the controlled matrix and the 5s-cadence sampling are what made the diagnosis move.

nicoloboschi avatar Aug 12 '26 08:08 nicoloboschi

Requested logs + both additional tests — results in

1. The 791-line docker log capture (the isolation proof you asked for). Internal IDs redacted (mm-<redacted> — our house practice; nothing else altered, line count unchanged). Too large for one comment, so it follows in the next two comments (part 1/2 and part 2/2): the full boot → refresh → OOM → restart cycle with worker stats throughout — nothing but the single refresh running.

2. Test 2 — dry-run on a second mental model (closest source query to the failing one: "Hermes Memory Architecture"):

  • Result: same explosion, different query. RSS 1.7 → 14.0GiB anon in ~18s, kernel OOM, container restarted (anon-rss 14,626,660 kB / total-vm 33,082,960 kB).
  • The dry-run response never returned (the connection died with the container), so no per-tool payload this run — crash-window logs are in a comment below.
  • Caveat: this ran on our production env with a consolidation op in flight — not an isolated window. The magnitude matches the isolated repro regardless.
  • Takeaway: the bomb is not specific to the failing model's query — an unrelated mental model blows up identically.

3. Test 1 — HINDSIGHT_API_REFLECT_MAX_ITERATIONS=2, isolated single refresh (exactly your spec: all three loops silenced, providers pinned, fresh container, one refresh):

  • Op timeline (UTC): queued 09:41:53.8, claimed 09:41:53.9, terminal 09:41:58.1 (~4s)
  • result_metadata: content_len 528, populated_content true, based_on_counts all zero (world / opinion / directives / experience / observation / mental-models), delta_ops 0/0
  • The generated content is a stub, verbatim: "I don't have information to produce this document. The retrieval returned no data for this query..."
  • RSS timeline (5s sampling, UTC):
09:41:54   953MiB   idle baseline
09:42:17  8.40GiB
09:42:23  1.56GiB
09:42:29  2.56GiB
09:42:35  2.40GiB
09:42:42  5.69GiB
09:42:48  9.75GiB
09:42:54  8.43GiB
09:43:01  2.87GiB
09:43:07  7.02GiB
09:43:13  9.46GiB
09:43:19  6.09GiB
09:43:26  3.75GiB
09:43:33  13.94GiB
09:43:34  kernel OOM kill (anon-rss 14,404,500 kB / total-vm 20,965,644 kB)
09:43:38  container restart
  • Verdict: it still OOMs at max_iterations=2 — so a single tool turn's worth of work is sufficient, per your discriminator.
  • The striking part: the op record went terminal ~90s before the kill, and the final synthesis consumed zero retrieved memories ("no data" stub) — yet the process still allocated ~13GiB. The wave pattern (repeated climb/GC cycles over 80s) combined with "nothing consumed yet still huge" points at the allocation living in the retrieval/fusion/tool-result plumbing upstream of synthesis — consistent with uncapped expand() (payload fetched and held even when synthesis uses nothing), though we can't exclude other plumbing from this window.
  • Transparency: our in-loop container logs for this window were lost on our side (log-capture timestamp bug + container restore) — we're providing the kernel signature, the op record, and the RSS timeline instead. The two complete captures we have are the 791-liner and the dry-run crash window.

Bottom line: both probes say the same thing — not query-specific, not iteration-accumulation-dependent, not downstream of what synthesis consumes. We'll re-run against the build with streaming per-arm instrumentation when it's ready.

paulsto avatar Aug 12 '26 09:08 paulsto

✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:48:59,996 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:48:59,996 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:48:59,996 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:48:59,996 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:48:59,996 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:49:00,006 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:49:00,013 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:49:00,018 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:49:00,023 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:49:00,109 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:49:00,261 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:49:00,261 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:49:00,318 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:49:00,318 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:49:00,318 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:49:00,319 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:49:00,324 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:49:00,325 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:49:00,359 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:49:00,359 - INFO - flashrank.Ranker - Downloading ms-marco-MiniLM-L-12-v2...
2026-08-12 05:49:02,353 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:49:02,355 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:49:02,403 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:49:02,607 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:49:02,752 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:49:03,115 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:49:03,986 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:49:03,987 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:49:03,987 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:49:04,638 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:49:04,638 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:49:04,639 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:49:04,639 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:49:04,652 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:49:04,652 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:49:04,777 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:49:04,795 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:49:04,810 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:49:04,974 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:49:04,974 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:49:04,993 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:49:05,894 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:49:05,894 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:49:05,894 - INFO - root - Memory system initialized
2026-08-12 05:49:05,894 - INFO - root - DB pool metrics configured
2026-08-12 05:49:05,896 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:49:05,896 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:49:05,898 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:49:05,898 - INFO - root - Tenant extension started
2026-08-12 05:49:05,909 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:49:05,943 - INFO - hindsight_api.engine.maintenance - Retention sweep public.llm_requests: DELETE 21
2026-08-12 05:49:05,943 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.045s
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.7ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:49:06,414 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=0/10 | reserved: [consolidation=0/2(avail=2)] | shared=0/8(avail=8) | global: pending=0 (queried=0/1 schemas: ) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=917 | my_active: none
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:49:36,572 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=0/10 | reserved: [consolidation=0/2(avail=2)] | shared=0/8(avail=8) | global: pending=0 (queried=0/1 schemas: ) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=972 | my_active: none
2026-08-12 05:50:06,717 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=0/10 | reserved: [consolidation=0/2(avail=2)] | shared=0/8(avail=8) | global: pending=0 (queried=0/1 schemas: ) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=972 | my_active: none
2026-08-12 05:50:27,324 - INFO - hindsight_api.engine.memory_engine - refresh_mental_model task queued for bank_id=hermes-main, operation_id=ffd2e838-8f01-43b1-ba4c-a5e98f2974c9
2026-08-12 05:50:27,804 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:50:27,806 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:50:27,829 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-27829] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
2026-08-12 05:50:31,030 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:50:31,622 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.449s
2026-08-12 05:50:31,622 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.227s
2026-08-12 05:50:31,623 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.152s
2026-08-12 05:50:31,624 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.309s
2026-08-12 05:50:31,624 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.061s
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:50:52,906 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:50:52,906 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:50:52,906 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:50:52,906 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:50:52,906 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:50:52,912 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:50:52,917 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:50:52,922 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:50:52,927 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:50:52,987 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:50:53,101 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:50:53,101 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:50:53,145 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:50:53,145 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:50:53,146 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:50:53,147 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:50:53,149 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:50:53,152 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:50:53,194 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:50:53,482 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:50:53,484 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:50:53,500 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:50:54,209 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:50:54,603 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:50:55,184 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:50:55,611 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:50:55,611 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:50:55,611 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:50:56,008 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:50:56,009 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:50:56,009 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:50:56,009 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:50:56,021 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:50:56,021 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:50:56,059 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:50:56,074 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:50:56,085 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:50:56,180 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:50:56,180 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:50:56,197 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:50:56,625 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:50:56,625 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:50:56,625 - INFO - root - Memory system initialized
2026-08-12 05:50:56,625 - INFO - root - DB pool metrics configured
2026-08-12 05:50:56,626 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:50:56,626 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:50:56,628 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:50:56,628 - INFO - root - Tenant extension started
2026-08-12 05:50:56,638 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.010s
2026-08-12 05:50:56,643 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:50:56,643 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:50:56,658 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:50:56,663 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:50:56,695 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-56695] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

2026-08-12 05:50:57,162 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=907 | my_active: refresh_mental_model:hermes-main(1)
2026-08-12 05:50:57,162 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=ffd2e838-8f01-43b1-ba4c-a5e98f2974c9 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.7ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:51:00,365 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:51:01,015 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.232s
2026-08-12 05:51:01,016 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.135s
2026-08-12 05:51:01,016 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.398s
2026-08-12 05:51:01,016 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.497s
2026-08-12 05:51:01,017 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.347s
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:51:22,903 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:51:22,903 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:51:22,903 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:51:22,903 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:51:22,903 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:51:22,909 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:22,914 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:22,919 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:22,924 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:22,983 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:51:23,094 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:51:23,094 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:51:23,128 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:51:23,128 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:51:23,128 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:51:23,130 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:51:23,134 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:51:23,135 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:51:23,172 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:51:23,393 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:51:23,395 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:51:23,427 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:51:23,950 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:51:24,324 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:51:24,891 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:51:25,341 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:51:25,341 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:51:25,341 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:51:25,695 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:51:25,695 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:51:25,695 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:51:25,695 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:51:25,705 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:51:25,706 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:51:25,745 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:51:25,760 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:51:25,770 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:51:25,868 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:51:25,868 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:51:25,887 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:51:26,234 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:51:26,234 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:51:26,234 - INFO - root - Memory system initialized
2026-08-12 05:51:26,234 - INFO - root - DB pool metrics configured
2026-08-12 05:51:26,235 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:51:26,235 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:51:26,236 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:51:26,236 - INFO - root - Tenant extension started
2026-08-12 05:51:26,253 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.017s
2026-08-12 05:51:26,258 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:51:26,258 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:51:26,280 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:51:26,284 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:51:26,317 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-86317] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
2026-08-12 05:51:26,783 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=902 | my_active: refresh_mental_model:hermes-main(1)
2026-08-12 05:51:26,783 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=ffd2e838-8f01-43b1-ba4c-a5e98f2974c9 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.7ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:51:29,685 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:51:30,321 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.492s
2026-08-12 05:51:30,321 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.350s
2026-08-12 05:51:30,321 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.247s
2026-08-12 05:51:30,322 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.123s
2026-08-12 05:51:30,322 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.438s
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:51:55,155 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:51:55,155 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:51:55,155 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:51:55,155 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:51:55,155 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:51:55,160 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:55,166 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:55,171 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:55,176 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:51:55,237 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:51:55,347 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:51:55,347 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:51:55,520 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:51:55,520 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:51:55,520 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:51:55,521 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:51:55,524 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:51:55,526 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:51:55,567 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:51:55,788 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:51:55,789 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:51:55,810 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:51:56,376 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:51:56,867 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:51:57,683 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:51:57,919 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:51:57,920 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:51:57,920 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:51:58,045 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:51:58,045 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:51:58,046 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:51:58,046 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:51:58,054 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:51:58,054 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:51:58,097 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:51:58,114 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:51:58,128 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:51:58,216 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:51:58,216 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:51:58,231 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:51:58,838 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:51:58,838 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:51:58,838 - INFO - root - Memory system initialized
2026-08-12 05:51:58,838 - INFO - root - DB pool metrics configured
2026-08-12 05:51:58,839 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:51:58,839 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:51:58,841 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:51:58,841 - INFO - root - Tenant extension started
2026-08-12 05:51:58,859 - INFO - hindsight_api.engine.maintenance - Retention sweep public.llm_requests: DELETE 1
2026-08-12 05:51:58,860 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.019s
2026-08-12 05:51:58,861 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:51:58,861 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:51:58,879 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:51:58,883 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:51:58,914 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-18914] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
2026-08-12 05:51:59,383 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=903 | my_active: refresh_mental_model:hermes-main(1)
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999

▲ Next.js 16.3.0







(part 1/2 of the 791-line capture — internal IDs redacted)

paulsto avatar Aug 12 '26 09:08 paulsto

2026-08-12 05:51:59,383 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=ffd2e838-8f01-43b1-ba4c-a5e98f2974c9 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
   API:           http://localhost:8888
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.8ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:52:02,183 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:52:02,673 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.402s
2026-08-12 05:52:02,673 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.097s
2026-08-12 05:52:02,674 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.199s
2026-08-12 05:52:02,674 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.263s
2026-08-12 05:52:02,674 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.345s
2026-08-12 05:52:06,892 - INFO - hindsight_api.engine.memory_engine - refresh_mental_model task queued for bank_id=hermes-main, operation_id=3ecbe3fb-667c-4afe-981b-812357e1ffc1
2026-08-12 05:52:07,103 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:52:07,121 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:52:07,178 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-27178] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
✅ Existing pg0 data directory detected at /home/hindsight/.pg0
  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 
  Hindsight: Agent Memory That Works Like Human Memory
2026-08-12 05:52:21,371 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:52:21,371 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:52:21,371 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:52:21,371 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:52:21,371 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:52:21,376 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:21,381 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:21,386 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:21,391 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:21,450 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:52:21,562 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:52:21,562 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp
2026-08-12 05:52:21,596 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:52:21,596 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:52:21,596 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:52:21,597 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:52:21,599 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:52:21,600 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:52:21,627 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:52:21,903 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:52:21,905 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:52:21,930 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:52:22,180 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:52:22,555 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:52:23,239 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:52:24,192 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:52:24,192 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:52:24,192 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:52:24,558 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:52:24,558 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:52:24,558 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:52:24,558 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:52:24,567 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:52:24,567 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:52:24,616 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:52:24,630 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:52:24,643 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:52:24,706 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:52:24,706 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:52:24,723 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:52:25,116 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:52:25,116 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:52:25,117 - INFO - root - Memory system initialized
2026-08-12 05:52:25,117 - INFO - root - DB pool metrics configured
2026-08-12 05:52:25,117 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:52:25,118 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:52:25,119 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:52:25,119 - INFO - root - Tenant extension started
2026-08-12 05:52:25,135 - INFO - hindsight_api.engine.maintenance - Retention sweep public.llm_requests: DELETE 1
2026-08-12 05:52:25,136 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.017s
2026-08-12 05:52:25,138 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:52:25,138 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:52:25,152 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:52:25,156 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:52:25,195 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-45195] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
2026-08-12 05:52:25,659 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=904 | my_active: refresh_mental_model:hermes-main(1)
2026-08-12 05:52:25,659 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=3ecbe3fb-667c-4afe-981b-812357e1ffc1 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
🎛️  Starting Control Plane...
✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.7ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:52:28,287 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:52:28,849 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.195s
2026-08-12 05:52:28,851 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.119s
2026-08-12 05:52:28,851 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.353s
2026-08-12 05:52:28,851 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.445s
2026-08-12 05:52:28,852 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.272s
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:52:50,219 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:52:50,219 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:52:50,219 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:52:50,219 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:52:50,219 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:52:50,225 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:50,230 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:50,234 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:50,239 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:52:50,309 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:52:50,424 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:52:50,424 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:52:50,457 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:52:50,458 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:52:50,458 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:52:50,459 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:52:50,461 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:52:50,463 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:52:50,492 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:52:50,762 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:52:50,763 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:52:50,785 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:52:51,297 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:52:51,655 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:52:52,217 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:52:52,967 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:52:52,968 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:52:52,968 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:52:53,331 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:52:53,331 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:52:53,331 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:52:53,331 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:52:53,343 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:52:53,343 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:52:53,394 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:52:53,407 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:52:53,423 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:52:53,507 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:52:53,507 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:52:53,524 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:52:53,882 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:52:53,882 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:52:53,882 - INFO - root - Memory system initialized
2026-08-12 05:52:53,882 - INFO - root - DB pool metrics configured
2026-08-12 05:52:53,884 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:52:53,884 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:52:53,885 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:52:53,886 - INFO - root - Tenant extension started
2026-08-12 05:52:53,896 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.010s
2026-08-12 05:52:53,898 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:52:53,898 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:52:53,916 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:52:53,921 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:52:53,955 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-73955] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.8ms
2026-08-12 05:52:54,425 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=907 | my_active: refresh_mental_model:hermes-main(1)
2026-08-12 05:52:54,425 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=3ecbe3fb-667c-4afe-981b-812357e1ffc1 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:52:57,939 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:52:58,590 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.523s
2026-08-12 05:52:58,591 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.181s
2026-08-12 05:52:58,591 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.082s
2026-08-12 05:52:58,591 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.296s
2026-08-12 05:52:58,591 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.406s
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:53:19,387 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:53:19,387 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:53:19,387 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:53:19,387 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:53:19,387 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:53:19,393 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:19,397 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:19,402 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:19,407 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:19,464 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:53:19,575 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:53:19,576 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:53:19,609 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:53:19,609 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:53:19,609 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:53:19,610 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:53:19,612 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:53:19,613 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:53:19,640 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:53:19,960 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:53:19,962 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:53:19,987 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:53:20,453 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:53:20,803 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:53:21,593 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:53:22,178 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:53:22,178 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:53:22,178 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:53:22,316 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:53:22,317 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:53:22,317 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:53:22,317 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:53:22,327 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:53:22,327 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:53:22,618 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:53:22,634 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:53:22,649 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:53:22,725 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:53:22,726 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:53:22,744 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:53:23,105 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:53:23,105 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:53:23,105 - INFO - root - Memory system initialized
2026-08-12 05:53:23,105 - INFO - root - DB pool metrics configured
2026-08-12 05:53:23,106 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:53:23,106 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:53:23,108 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:53:23,108 - INFO - root - Tenant extension started
2026-08-12 05:53:23,119 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.011s
2026-08-12 05:53:23,121 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 1 stale tasks from previous run
2026-08-12 05:53:23,121 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 05:53:23,140 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): refresh_mental_model:1 (schemas: default)
2026-08-12 05:53:23,145 - INFO - hindsight_api.engine.memory_engine - [REFRESH_MENTAL_MODEL_TASK] Starting for bank_id=hermes-main, mental_model_id=mm-<redacted>
2026-08-12 05:53:23,189 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-3189] Starting agentic reflect for query: How does Paul prefer to work? Summarise his workin...
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

2026-08-12 05:53:23,644 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=0/2(avail=2)] | shared=1/8(avail=7) | global: pending=0 (queried=1/1 schemas: default) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=904 | my_active: refresh_mental_model:hermes-main(1)
2026-08-12 05:53:23,644 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=3ecbe3fb-667c-4afe-981b-812357e1ffc1 type=refresh_mental_model op_type=refresh_mental_model bank=hermes-main age=1s stage=llm.deepseek.tools.attempt=1/4 stage_age=0s
▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 1.3ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:53:26,214 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
2026-08-12 05:53:26,760 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.412s
2026-08-12 05:53:26,761 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.161s
2026-08-12 05:53:26,761 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.225s
2026-08-12 05:53:26,761 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.069s
2026-08-12 05:53:26,762 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.335s
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 05:53:47,049 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 05:53:47,049 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 05:53:47,049 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 05:53:47,049 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 05:53:47,049 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 05:53:47,054 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:47,059 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:47,064 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:47,069 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 05:53:47,127 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 05:53:47,239 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 05:53:47,239 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 05:53:47,273 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:53:47,273 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 05:53:47,273 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 05:53:47,274 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 05:53:47,276 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 05:53:47,278 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 05:53:47,313 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 05:53:47,544 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 05:53:47,546 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 05:53:47,569 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 05:53:48,292 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 05:53:48,698 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 05:53:49,192 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 05:53:50,233 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 05:53:50,234 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 05:53:50,234 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 05:53:50,344 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 05:53:50,345 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 05:53:50,345 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:53:50,345 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 05:53:50,355 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 05:53:50,355 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 05:53:50,400 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 05:53:50,411 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 05:53:50,426 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 05:53:50,510 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 05:53:50,511 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 05:53:50,528 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 05:53:51,117 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 05:53:51,117 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 05:53:51,117 - INFO - root - Memory system initialized
2026-08-12 05:53:51,117 - INFO - root - DB pool metrics configured
2026-08-12 05:53:51,120 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 05:53:51,121 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 05:53:51,122 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 05:53:51,122 - INFO - root - Tenant extension started
2026-08-12 05:53:51,132 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.010s
2026-08-12 05:53:51,134 - WARNING - hindsight_api.worker.poller - Worker hindsight-hermes moved 1 tasks to 'failed' (exceeded 3 recovery attempts in schema None)
2026-08-12 05:53:51,135 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.8ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 05:53:51,642 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=0/10 | reserved: [consolidation=0/2(avail=2)] | shared=0/8(avail=8) | global: pending=0 (queried=0/1 schemas: ) | others: none | pool: size=5 limits=5-100 idle=5 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=904 | my_active: none


(part 2/2 — end of the 791-line capture)

paulsto avatar Aug 12 '26 09:08 paulsto

2026-08-12 09:39:44,344 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=1/10 | reserved: [consolidation=1/2(avail=1)] | shared=0/8(avail=8) | global: pending=1 (queried=1/1 schemas: default) | others: none | pool: size=33 limits=5-100 idle=33 in_use=0 free_holders=100 pending_acquires=0 | proc: rss_mb=10506 | my_active: consolidation:hermes-main(1)
2026-08-12 09:39:44,344 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] consolidation: total=1 claimable=1 payload_null=0 retry_blocked=0 assigned=0
2026-08-12 09:39:44,344 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=b60df688-cd59-4821-8df3-9b723bee1511 type=consolidation op_type=consolidation bank=hermes-main age=265s stage=llm.deepseek.consolidation.attempt=1/4 stage_age=74s
2026-08-12 09:39:46,834 - INFO - hindsight_api.engine.memory_engine - [REFLECT hermes-m-86834] Starting agentic reflect for query: What is the Hermes memory architecture and how do ...
2026-08-12 09:39:48,833 - INFO - hindsight_api.engine.providers.openai_compatible_llm - slow llm call: scope=consolidation, model=deepseek/deepseek-v4-flash, input_tokens=13812, output_tokens=1412, total_tokens=15224, cached_tokens=3072, time=78.116s, ratio out/in=0.10
2026-08-12 09:39:49,669 - INFO - hindsight_api.engine.consolidation.consolidator - [CONSOLIDATION] bank=hermes-main llm_batch #3 (9 memories, 1 llm calls) | processed=59/53 | recall=3.200s, llm=78.117s, embedding=0.413s, db_write=0.063s | created=6 updated=3 skipped=0 | input_tokens=~10914 | avg=9.128s/memory
2026-08-12 09:39:50,457 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.058s
2026-08-12 09:39:50,459 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.117s
2026-08-12 09:39:50,797 - INFO - hindsight_api.engine.memory_engine - Created parent operation 962b5517-87d3-4eba-8984-d00eb8f8d91c with 1 child sub-batch(es)
2026-08-12 09:39:50,968 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 1 tasks (0 consolidation): batch_retain:1 (schemas: default)
2026-08-12 09:39:50,974 - INFO - hindsight_api.engine.memory_engine - [BATCH_RETAIN_TASK] Starting background batch retain for bank_id=hermes-main, 1 items, operation_id=a9fc67a0-f12f-4a5d-9450-14ead5b8aaae
✅ Existing pg0 data directory detected at /home/hindsight/.pg0

  ▄▄       ▄▄
 ▄ ▀▄ ▄▄▄ ▄▀ ▄
▀▀▄▄▄▄▀▀▀▄▄▄▄▀▀
   ▄▄▄ ▄ ▄▄▄
 ▄▀ ▀▀▄▄▄▀  ▀▄ 

  Hindsight: Agent Memory That Works Like Human Memory

2026-08-12 09:40:20,709 - INFO - hindsight_api.config - Database: pg0 (schema: public)
2026-08-12 09:40:20,709 - INFO - hindsight_api.config - LLM: provider=deepseek, model=deepseek-v4-flash
2026-08-12 09:40:20,709 - INFO - hindsight_api.config - Embeddings: provider=local
2026-08-12 09:40:20,709 - INFO - hindsight_api.config - Reranker: provider=flashrank
2026-08-12 09:40:20,709 - INFO - hindsight_api.config - Graph retriever: link_expansion
2026-08-12 09:40:20,715 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 09:40:20,720 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 09:40:20,725 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 09:40:20,730 - INFO - hindsight_api.engine.providers.openai_compatible_llm - OpenAI-compatible client initialized: provider=deepseek, model=deepseek-v4-flash, base_url=https://api.deepseek.com
2026-08-12 09:40:20,787 - INFO - hindsight_api.api.mcp - MCP servers created (stateless_http=False)
2026-08-12 09:40:20,897 - INFO - hindsight_api.api - HTTP REST API enabled
2026-08-12 09:40:20,898 - INFO - hindsight_api.api - MCP server enabled at /mcp/
uvloop available, will use for event loop
Starting Hindsight API...
  Version: v0.9.0
  URL: http://0.0.0.0:8888
  Database: pg0
  LLM: deepseek / deepseek-v4-flash
  Embeddings: local
  Reranker: flashrank
  Extensions: pgvector (vector) / native (text)
  MCP: enabled at /mcp

2026-08-12 09:40:20,935 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 09:40:20,935 - INFO - mcp.server.streamable_http_manager - StreamableHTTP session manager started
2026-08-12 09:40:20,936 - INFO - hindsight_api.api - MCP lifespans started (multi-bank and single-bank)
2026-08-12 09:40:20,937 - INFO - root - Metrics initialized - available at /metrics endpoint
2026-08-12 09:40:20,939 - INFO - hindsight_api.engine.embeddings - Embeddings: initializing local provider with model BAAI/bge-small-en-v1.5
2026-08-12 09:40:20,940 - INFO - sentence_transformers.SentenceTransformer - Load pretrained SentenceTransformer: BAAI/bge-small-en-v1.5
2026-08-12 09:40:20,988 - INFO - hindsight_api.engine.cross_encoder - Reranker: initializing FlashRank provider with model ms-marco-MiniLM-L-12-v2 (cpu_mem_arena=False)
2026-08-12 09:40:21,253 - INFO - hindsight_api.engine.cross_encoder - Reranker: replaced FlashRank ONNX session with cpu_mem_arena=False
2026-08-12 09:40:21,255 - INFO - hindsight_api.engine.cross_encoder - Reranker: FlashRank provider initialized (max_concurrent=4)
2026-08-12 09:40:21,276 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Verifying connection: deepseek/deepseek-v4-flash
2026-08-12 09:40:21,579 - INFO - hindsight_api.pg0 - Starting embedded PostgreSQL (name=hindsight, port=auto)...
2026-08-12 09:40:22,082 - INFO - hindsight_api.pg0 - PostgreSQL started: postgresql://hindsight:[email protected]:5432/hindsight
2026-08-12 09:40:22,960 - INFO - hindsight_api.engine.providers.openai_compatible_llm - Connection verified: deepseek/deepseek-v4-flash
2026-08-12 09:40:23,258 - INFO - hindsight_api.engine.embeddings - Embeddings: local provider initialized (dim: 384, device: cpu)
2026-08-12 09:40:23,259 - INFO - hindsight_api.engine.memory_engine - Running database migrations...
2026-08-12 09:40:23,259 - INFO - hindsight_api.engine.memory_engine - Running migrations on 1 schema(s)...
2026-08-12 09:40:23,388 - INFO - hindsight_api.migrations - pgvector extension found in public schema - ready to use
2026-08-12 09:40:23,389 - INFO - hindsight_api.migrations - Running database migrations to head for schema 'public'...
2026-08-12 09:40:23,389 - INFO - hindsight_api.migrations - Database URL: postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 09:40:23,389 - INFO - hindsight_api.migrations - Script location: /app/api/hindsight_api/alembic
2026-08-12 09:40:23,398 - INFO - alembic.runtime.migration - Context impl PostgresqlImpl.
2026-08-12 09:40:23,399 - INFO - alembic.runtime.migration - Will assume transactional DDL.
2026-08-12 09:40:23,670 - INFO - hindsight_api.migrations - Database migrations completed successfully for schema 'public'
2026-08-12 09:40:23,682 - INFO - hindsight_api.migrations - Using vector extension: pgvector
2026-08-12 09:40:23,700 - INFO - hindsight_api.migrations - Target vector extension: pgvector
2026-08-12 09:40:23,824 - INFO - hindsight_api.engine.memory_engine - Schema migrations completed
2026-08-12 09:40:23,824 - INFO - hindsight_api.engine.memory_engine - Connecting to database at postgresql://***:***@127.0.0.1:5432/hindsight
2026-08-12 09:40:23,840 - INFO - hindsight_api.engine.db.postgresql - PostgreSQL pool created (min=5, max=100, cmd_timeout=60s, acquire_timeout=30s)
2026-08-12 09:40:24,299 - INFO - hindsight_api.engine.task_backend - BrokerTaskBackend initialized
2026-08-12 09:40:24,299 - INFO - hindsight_api.engine.memory_engine - Memory system initialized (pool and task backend started)
2026-08-12 09:40:24,299 - INFO - root - Memory system initialized
2026-08-12 09:40:24,300 - INFO - root - DB pool metrics configured
2026-08-12 09:40:24,301 - INFO - hindsight.loop_watchdog - Loop watchdog started (stall_threshold=1.00s, poll_interval=0.25s)
2026-08-12 09:40:24,302 - INFO - root - Worker id: hindsight-hermes (source: HINDSIGHT_API_WORKER_ID)
2026-08-12 09:40:24,303 - INFO - root - Worker poller started (worker_id=hindsight-hermes)
2026-08-12 09:40:24,303 - INFO - root - Tenant extension started
2026-08-12 09:40:24,325 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes recovered 2 stale tasks from previous run
2026-08-12 09:40:24,325 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes starting polling loop (max_slots=10, reservations=[consolidation=2], shared_pool=8)
2026-08-12 09:40:24,327 - INFO - hindsight_api.engine.maintenance - Retention sweep public.llm_requests: DELETE 6
2026-08-12 09:40:24,329 - INFO - hindsight_api.engine.maintenance - Maintenance: retention took 0.026s
2026-08-12 09:40:24,336 - INFO - hindsight_api.engine.maintenance - Maintenance: consolidation reconcile took 0.008s
2026-08-12 09:40:24,353 - INFO - hindsight_api.worker.poller - Worker hindsight-hermes claimed 2 tasks (1 consolidation): consolidation:1, batch_retain:1 (schemas: default)
2026-08-12 09:40:24,360 - INFO - hindsight_api.engine.memory_engine - [BATCH_RETAIN_TASK] Starting background batch retain for bank_id=hermes-main, 1 items, operation_id=a9fc67a0-f12f-4a5d-9450-14ead5b8aaae
2026-08-12 09:40:24,379 - INFO - hindsight_api.engine.consolidation.consolidator - [CONSOLIDATION] bank=hermes-main total_unconsolidated=11
🎛️  Starting Control Plane...

✅ Hindsight is running!

📍 Access:
   Control Plane: http://localhost:9999
   API:           http://localhost:8888

2026-08-12 09:40:24,755 - INFO - hindsight_api.engine.search.retrieval - Using LinkExpansion graph retriever
▲ Next.js 16.3.0
- Local:         http://localhost:9999
- Network:       http://0.0.0.0:9999
✓ Ready in 0ms
✓ Running next.config took 0.7ms
[Control Plane] Connecting to dataplane at: http://localhost:8888
[Control Plane] No API key configured (public access)
2026-08-12 09:40:26,400 - WARNING - hindsight.loop_watchdog - EVENT LOOP BLOCKED for >= 1.00s (1.10s and counting). The loop is not servicing coroutines — /health cannot be scheduled. Blocking frame:
  File "/app/api/.venv/bin/hindsight-api", line 10, in <module>
    sys.exit(main())
  File "/app/api/hindsight_api/main.py", line 380, in main
    uvicorn.run(**uvicorn_config)
  File "/app/api/.venv/lib/python3.11/site-packages/uvicorn/main.py", line 593, in run
    server.run()
  File "/app/api/.venv/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run
    return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
  File "/app/api/.venv/lib/python3.11/site-packages/uvicorn/_compat.py", line 30, in asyncio_run
    return runner.run(main)
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/app/api/hindsight_api/engine/consolidation/consolidator.py", line 2464, in _find_related_observations
    recall_result = await memory_engine.recall_async(
  File "/app/api/hindsight_api/engine/memory_engine.py", line 145, in wrapper
    return await func(*args, **kwargs)
  File "/app/api/hindsight_api/engine/memory_engine.py", line 4833, in recall_async
    result = await self._search_with_retries(
  File "/app/api/hindsight_api/engine/memory_engine.py", line 5120, in _search_with_retries
    multi_result = await retrieve_all_fact_types_parallel(
  File "/app/api/hindsight_api/engine/search/retrieval.py", line 906, in retrieve_all_fact_types_parallel
    temporal_constraint = extract_temporal_constraint(
  File "/app/api/hindsight_api/engine/search/temporal_extraction.py", line 55, in extract_temporal_constraint
    analysis = analyzer.analyze(query, reference_date)
  File "/app/api/hindsight_api/engine/query_analyzer.py", line 269, in analyze
    results = self._search_dates(query, settings=settings, **self._search_kwargs())
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/__init__.py", line 62, in search_dates
    result = _search_with_detection.search_dates(
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/conf.py", line 100, in wrapper
    return f(*args, **kwargs)
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/search.py", line 284, in search_dates
    language_shortname = self.detect_language(
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/conf.py", line 100, in wrapper
    return f(*args, **kwargs)
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/search.py", line 243, in detect_language
    detected_language = self.language_detector._best_language(text) or (
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/conf.py", line 100, in wrapper
    return f(*args, **kwargs)
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/text_detection.py", line 70, in _best_language
    self.character_check(date_string, settings)
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/text_detection.py", line 54, in character_check
    self.get_unique_characters(settings=settings)
  File "/app/api/.venv/lib/python3.11/site-packages/dateparser/search/text_detection.py", line None, in get_unique_characters

2026-08-12 09:40:27,443 - WARNING - hindsight.db.pool - slow DB pool acquire: waited 2.396s for a connection (in_use=1 max=100 idle=10 waiting=12). The pool is likely saturated; /health can stall on connection acquisition while the event loop is free.
2026-08-12 09:40:27,443 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 2.396s
2026-08-12 09:40:27,444 - WARNING - hindsight.db.pool - slow DB pool acquire: waited 2.203s for a connection (in_use=3 max=100 idle=8 waiting=10). The pool is likely saturated; /health can stall on connection acquisition while the event loop is free.
2026-08-12 09:40:27,444 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 2.203s
2026-08-12 09:40:27,444 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.523s
2026-08-12 09:40:27,444 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.658s
2026-08-12 09:40:27,444 - WARNING - hindsight.db.pool - slow DB pool acquire: waited 1.205s for a connection (in_use=6 max=100 idle=5 waiting=7). The pool is likely saturated; /health can stall on connection acquisition while the event loop is free.
2026-08-12 09:40:27,444 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 1.205s
2026-08-12 09:40:27,444 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.889s
2026-08-12 09:40:27,445 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.362s
2026-08-12 09:40:27,445 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 0.195s
2026-08-12 09:40:27,445 - WARNING - hindsight.db.pool - slow DB pool acquire: waited 1.814s for a connection (in_use=11 max=100 idle=0 waiting=2). The pool is likely saturated; /health can stall on connection acquisition while the event loop is free.
2026-08-12 09:40:27,445 - WARNING - hindsight_api.engine.db_utils - [DB POOL] Slow acquire: 1.814s
2026-08-12 09:40:27,474 - INFO - hindsight_api.worker.poller - [WORKER_STATS] worker=hindsight-hermes slots=2/10 | reserved: [consolidation=1/2(avail=1)] | shared=1/8(avail=7) | global: pending=2 (queried=1/1 schemas: default) | others: none | pool: size=13 limits=5-100 idle=2 in_use=11 free_holders=89 pending_acquires=0 | proc: rss_mb=1025 | my_active: consolidation:hermes-main(1), retain:hermes-main(1)
2026-08-12 09:40:27,474 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0 | consolidation: total=1 claimable=1 payload_null=0 retry_blocked=0 assigned=0
2026-08-12 09:40:27,474 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=b60df688-cd59-4821-8df3-9b723bee1511 type=consolidation op_type=consolidation bank=hermes-main age=3s stage=consolidation.consolidating stage_age=3s
2026-08-12 09:40:27,474 - INFO - hindsight_api.worker.poller - [WORKER_TASK] op=a9fc67a0-f12f-4a5d-9450-14ead5b8aaae type=batch_retain op_type=retain bank=hermes-main age=3s stage=llm.deepseek.retain_extract_facts.attempt=1/4 stage_age=3s
2026-08-12 09:40:27,486 - INFO - hindsight_api.worker.poller - [DB_WAITS] pid=143 app= wait=IO.DataFileRead state=active age=0s query='(SELECT id, text, context, event_date, occurred_start, occurred_end, mentioned_at, fact_type, document_id, chunk_id, tags, metadata, proof_count,        1 - (embedding <=> $1::vector) AS similarity,  '


(Test 2 crash-window logs — dry-run of the second mental model, production env)

paulsto avatar Aug 12 '26 09:08 paulsto

This dump is worth more than the isolated repro was. Two findings in it change where we're looking, and one of them means we sent you down a wrong path — apologies for that.

1. The process was at 10.5GB with consolidation as the only active task

09:39:44 [WORKER_STATS] slots=1/10 | ... | proc: rss_mb=10506 | my_active: consolidation:hermes-main(1)
09:39:46 [REFLECT hermes-m-86834] Starting agentic reflect for query: What is the Hermes memory architecture...

10.5GB, two seconds before the reflect starts, with the pool idle at that instant (size=33 idle=33 in_use=0) — so that's retained heap, not query buffers.

(One caveat we'll state rather than hide: a dry run arrives over HTTP, so it wouldn't appear in my_active. We can't prove from these lines alone that no earlier reflect was in flight. But Starting agentic reflect landing after the reading is the natural reading.)

This demotes the expand hypothesis we gave you last time. Consolidation has no agent loop and never calls expand. What consolidation and reflect share is recall_async. If consolidation alone gets to 10.5GB, then the title of this issue is naming a symptom, and the actual defect is in the retrieval path that both operations sit on.

2. The watchdog traceback is the strongest lead in the thread so far

EVENT LOOP BLOCKED for >= 1.00s (1.10s and counting)
  consolidator.py     _find_related_observations
  memory_engine.py    recall_async
  retrieval.py        retrieve_all_fact_types_parallel
  temporal_extraction.py  extract_temporal_constraint
  query_analyzer.py   analyze
  dateparser/search/search.py        search_dates
  dateparser/search/search.py        detect_language
  dateparser/search/text_detection.py  character_check
  dateparser/search/text_detection.py  get_unique_characters

That's dateparser's automatic language detection, running synchronously on the event loop, inside every recall. It auto-detects because our query analyzer passes no languages restriction unless you set one — and HINDSIGHT_API_QUERY_ANALYZER_LANGUAGES is unset in your config. So _best_language walks the language set, lazily loading each language's data and building unique-character sets.

The traceback proves this is CPU-blocking. It does not by itself prove it's the memory. But it's on the path both consolidation and reflect share, it's the one synchronous data-heavy step in retrieval, and consolidation drives one per fact.

3. Your isolation was probably not isolation — and that's on us, not you

Our env var names promise "off" and deliver "won't enqueue more":

  • HINDSIGHT_API_CONSOLIDATION_RECONCILE_INTERVAL_SECONDS=0 does correctly disable the reconcile loop. But that loop only enqueues consolidation work. The worker poller is a separate loop on a 500ms interval and claims whatever is already pending, regardless. Your own log shows it: after the restart, recovered 2 stale tasks from previous run → claimed 2 tasks (1 consolidation).
  • HINDSIGHT_API_RETAIN_BATCH_POLL_INTERVAL_SECONDS=0 disables nothing at all. It is read in exactly one place — the sleep inside the LLM batch-API polling loop. At 0 it becomes a hot spin if a batch job is in flight.

You marked prior refresh ops failed via SQL, but nothing drained pending consolidation or batch_retain ops — and the bank reports total_unconsolidated=11. So consolidation was likely executing alongside your "isolated" refresh the entire time.

That's our documentation and naming failing you, and we're fixing both: the knobs need to mean what they say, or the docs need to state plainly that they gate enqueueing and not execution.

What would settle this

Given the above, the decisive test is no longer about reflect at all:

A. Consolidation alone, no refresh submitted. Let the pending consolidation ops run and sample RSS. If it climbs past ~10GB on its own, this issue is mistitled and we chase a recall-path leak instead — which is a much better place for us to be looking.

B. HINDSIGHT_API_QUERY_ANALYZER_LANGUAGES=en, everything else unchanged. One variable, directly tests the dateparser lead. If your bank is genuinely multilingual, use the list you actually need — the point is to stop auto-detection, not to restrict your data.

C. If you still want a clean isolated refresh number, you'll need to drain or park pending consolidation and batch_retain operations too, not just the refresh ops. Sorry — we should have told you that the first time.

Test 1 (REFLECT_MAX_ITERATIONS=2) is still useful and we'd still like it, but it drops behind A and B now. And the full 791 lines are still welcome whenever convenient — the window you posted was enough to move us, and more of it can only help.

Thanks for posting the raw log rather than a summary. The two lines that mattered most here are ones neither of us would have thought to ask for.

nicoloboschi avatar Aug 12 '26 12:08 nicoloboschi

Tests A & B — consolidation alone bursts past 10GB and kills; HINDSIGHT_API_QUERY_ANALYZER_LANGUAGES=en does not prevent it; WORKER_STATS rss_mb is a peak counter, not current RSS

Both tests ran on the production bank (hermes-main) with no refresh submitted at any point — only natural production work (batch_retain + consolidation, exactly as your Test A asked: let the pending ops run and sample RSS). Sampling: docker stats + cgroup memory.current + app VmRSS + the app's own WORKER_STATS rss_mb, every 20s.

Sanitisation note (house protocol): operation UUIDs and internal process IDs excluded from the tables below; no secrets, emails, IPs or internal hostnames present; bank name retained as in our previous posts.

Test A — consolidation alone (12 Aug 12:32–12:50 UTC, languages unset)

time UTC docker stats cgroup current app VmRSS event
12:32:24 1.45GiB 2.15GB 1.08GiB (ps) idle baseline
12:33:28 9.84GiB 10.75GB – burst (batch_retain recall)
12:34:11 1.80GiB 1.97GB – released (<60s)
12:35:58 10.65GiB 11.45GB – batch_retain complete; consolidation claimed, total_unconsolidated=1
12:36:08 – – – container killed (start-all.sh: Killed hindsight-api; RestartCount 1→2; no kernel OOM line captured; OOMKilled=false — the restart-policy kill signature we documented on 11 Aug)
12:40:57 6.81GiB 8.08GB – third burst (new container)
12:41:18 2.68GiB 3.58GB – released
  • Peak 10.65GiB docker / 11.45GB cgroup — consolidation + retain alone, no refresh anywhere near. Your Test A criterion is met: it climbs past ~10GB on its own.
  • Not proportional to work: the fatal spike surrounded a consolidation claimed with total_unconsolidated=1.
  • Bursts are transient: ~20s to allocate, released in under a minute when not killed.

Test B — same, HINDSIGHT_API_QUERY_ANALYZER_LANGUAGES=en (12 Aug 12:52–13:12 UTC)

One variable changed; two bursts; one kill:

time UTC docker stats cgroup current app VmRSS event
12:53:41 0.85GiB 1.04GB 918MB fresh boot baseline (rss_mb reset to 896)
12:54:23 4.97GiB 5.44GB 5.36GB burst (batch_retain recall)
12:54:45 5.38GiB 5.92GB 5.36GB peak
12:55:30 1.11GiB 1.49GB 1.04GB released
12:55:05→12:57:11 flat ~1.2GiB – – consolidation (12 facts, 125.9s) — flat through the entire LLM phase
13:07:31 9.50GiB 10.47GB 12,762,028 kB (12.76GB) burst #2 (host 18.0/19.99GB, swap 100% full)
13:07:36 – – – container killed again (same signature; restarted 13:07:36.33; rss_mb reset to 884)
13:11:26→13:11:47 2.82→7.22GiB 3.79→8.34GB 3.15→5.39GB cycle already ramping again (consolidation 52.9s in flight)
  • languages=en does not stop the burst: burst #2 peaked 9.5GiB docker / 12.76GB app VmRSS and killed the container. The dateparser auto-detection lead is not the memory mechanism — the allocation is upstream of it.
  • Memory spikes only in the retrieval step of batch_retain/consolidation recalls (recall_async); the LLM phases are flat.

Finding 1: WORKER_STATS rss_mb is a peak (high-water) counter, not current RSS

Evidence from the first container (boot 10:25:40, killed 12:36:08):

  • rss_mb=906 at boot → stable 1026 → jumped 9232 at 10:41 (boot backlog drain) → frozen at 10423 from 10:44 until death — while ps showed the app at 1.08GiB and cgroup at 1.98GB.
  • Fresh B container: reset to 896 → 9187 after burst #1 → never decreases.

It only ever climbs — it tracks the process's peak anon RSS since boot. Implication for the 09:39:44 line in our dump (rss_mb=10506, pool idle): that is a prior burst's peak, not live heap — the "10.5GB retained heap two seconds before reflect" reading doesn't hold. We are not disputing the kernel-verified burst allocations (15.0 / 14.4GiB anon at the 05:52 / 09:43 OOM kills) — but they are transient bursts, not retained heap: after a completed 36-fact consolidation the app sits at ~1.08GiB.

Finding 2: the event-loop stall is a cold lazy import, not dateparser

The one EVENT LOOP BLOCKED warning (1.76s, in the B window; zero in A's window) traces to:

api_recall
→ memory_engine.recall_async
→ _search_with_retries
→ retrieval.retrieve_all_fact_types_parallel (line 904)
→ "from .temporal_extraction import extract_temporal_constraint"   ← lazy import inside the hot path
→ beartype claw import machinery (get_code / get_data — file read)

A module import running synchronously on the event loop, once per process boot, inside the retrieval hot path. Worth moving to module level. (Zero ELB events in A's window is consistent: the import was already warm in that process.)

What this settles

  • A: consolidation alone exceeds ~10GB → the issue title names a symptom; the defect is in the shared retrieval path (recall_async), as you suspected after demoting expand().
  • B: languages=en has no effect on the burst → dateparser is not the allocation source.
  • The burst is retrieval-side transient allocation, not proportional to input size, and fatal on a host already at the swap edge (ours: 3.8–3.9/3.9GB swap, 19.5GB RAM — the kill at 13:07:36 happened with host memory at 18.0/19.99GB and swap 100% full).

Full 20s sampler CSV (both phases, 108 rows) available — happy to post it in a follow-up comment if useful.

paulsto avatar Aug 12 '26 13:08 paulsto

Both of your findings check out against the source, and one of them means my last comment's headline reading was wrong. Taking those first, then a new candidate that fits every observation you've recorded.

You're right about rss_mb — and it's worse than mislabelled

worker/poller.py:

usage = resource.getrusage(resource.RUSAGE_SELF)
rss = usage.ru_maxrss

ru_maxrss is the high-water mark since process start. It cannot decrease. So WORKER_STATS ... proc: rss_mb= has never reported current RSS in any version, and my "10.5GB of retained heap two seconds before the reflect started" reading of your earlier dump is simply wrong — that was a prior burst's peak. Thank you for catching it; we'd have kept misreading our own telemetry. We're renaming the field and adding a real current-RSS reading alongside it.

Your reframing is the correct one: transient bursts, not retained heap. A settled process at ~1.08GiB after a 36-fact consolidation is the tell.

And right about the event-loop stall

retrieval.py, inside retrieve_all_fact_types_parallel:

if enable_temporal_retrieval:
    from .temporal_extraction import extract_temporal_constraint

A module import in the hot path, paid once per process on the event loop. Moving it to module scope. Your "zero ELB events in A's window because the import was already warm" explanation is exactly right.

So dateparser is dead as a lead, and Test B did its job by killing it.

New candidate: the FlashRank reranker has no batching at all

You're on HINDSIGHT_API_RERANKER_PROVIDER=flashrank. In engine/cross_encoder.py, the FlashRank provider's _predict_sync builds one request containing every candidate:

passages = [{"id": i, "text": text} for i, (_, text) in enumerate(indexed_texts)]
request = RerankRequest(query=query, passages=passages)
results = self._ranker.rerank(request)

That's a single ONNX forward pass over the entire candidate set. Compare the two sibling providers in the same file:

provider batching
local (sentence-transformers) predict(pairs, batch_size=...), default 32
tei explicit for i in range(0, len(texts), self.batch_size), default 128
flashrank none — whole set in one pass

There is no RERANKER_FLASHRANK_BATCH_SIZE in the config at all. The other two have one; this path was never given one.

Rough scale, for ms-marco-MiniLM-L-12-v2 (12 layers, 12 heads) at the default RERANKER_MAX_CANDIDATES=300 and max_length=512: the attention-score tensor for a single layer is 300 × 12 × 512 × 512 × 4B ≈ 3.8GB, and softmax holds another of the same shape. Multiple GB live inside one forward pass, from a handful of layers, is entirely consistent with a 10-13GB burst. The provider also runs on a thread pool with max_concurrent=4, so several of these can overlap in one process.

This fits everything you measured, including the parts that puzzled us:

  • Explosive and transient — one forward pass allocates and frees. Your "~20s to allocate, released in under a minute" is the shape of an inference call, not a leak.
  • Not proportional to work — the burst scales with the candidate count returned by retrieval, which scales with bank size, not with how many facts you're consolidating. A consolidation with total_unconsolidated=1 still issues a recall that returns a full candidate pool. That's your fatal 12:35:58 spike explained.
  • Retrieval step only, LLM phases flat — reranking is the last stage of recall_async.
  • languages=en had no effect — it's downstream of dateparser entirely.
  • Both batch_retain and consolidation — both call recall_async, both rerank.

One more detail that may explain the variance between bursts: FlashRank pads a request to its longest passage. A single long passage in the candidate set inflates the sequence length for all 300, so two recalls returning the same number of candidates can differ several-fold in peak memory depending on the longest text in the pool.

We should also say plainly: there are already two band-aids around this exact spot — cpu_mem_arena=False (comment: "keeping RSS bounded after rerank batches") and a release_local_inference_memory() in the finally. We have been treating the symptom here more than once without going after the batch size.

The test that would confirm it

HINDSIGHT_API_RERANKER_MAX_CANDIDATES=32, everything else unchanged, flashrank kept. This isolates N directly. If the bursts drop roughly an order of magnitude and the kills stop, it's confirmed and we ship batching for the FlashRank path.

Useful cross-check if you have the appetite for a second run: HINDSIGHT_API_RERANKER_PROVIDER=local at default settings. That path batches at 32 internally, so it should be flat even with the candidate cap left at 300. Different mechanism, same prediction — if both hold, there's no ambiguity left.

Expect some recall-quality change from the first one (fewer candidates reranked); it's a diagnostic, not a proposed setting.

Regardless of the outcome

Three fixes are going in on our side from this thread alone: batch the FlashRank path like its siblings, fix the rss_mb field to mean what it says, and hoist that lazy import. The first is the one that matters for you.

And yes, please post the 108-row CSV — burst timing against the recall stage boundaries is exactly what would corroborate or kill the reranker theory, and we'd rather find out it's wrong now.

This has been an unusually well-run investigation from your side. The ru_maxrss catch in particular was ours to find and we didn't.

nicoloboschi avatar Aug 12 '26 13:08 nicoloboschi

Test C — HINDSIGHT_API_RERANKER_MAX_CANDIDATES=32 (flashrank kept): the dial does what it says. Bursts drop ~5–9×, recall latency ~6×, zero kills

Configuration: production env + one variable (RERANKER_MAX_CANDIDATES=32), flashrank provider kept, everything else byte-identical. Same 20s sampler, same natural production work, no refresh submitted.

Results (14:56–15:15 UTC, 12 Aug)

metric A (300, unset) B (300, +languages=en) C (32)
docker stats peak 10.65GiB 9.50GiB 2.11GiB
cgroup memory.current peak 11.45GB 10.47GB 2.83GB
app peak (rss_mb high-water) 10,426MB 9,187MB 2,090MB
burst increment over baseline ~9.5GB ~8.3GB ~1.1GB (~8.6× smaller)
container kills 1 (12:36:08) 1 (13:07:36) 0
EVENT LOOP BLOCKED 0 1 (cold import) 0

Two consolidations and one batch_retain recall ran in the window, all flat. The batch_retain recall is the same trigger that killed A and B:

15:02:42 [RECALL] Starting recall ... Complete: 25 facts | 10.035s      (A/B: ~60.8s, burst 9.5–10.65GiB)

Memory during it: 2.11GiB docker peak, released immediately. RestartCount=0 — the C container never restarted (A/B containers died once each).

Wiring verification (since the dial's honesty is the thing we've learned to check)

  • HINDSIGHT_API_RERANKER_MAX_CANDIDATES is read into config.reranker_max_candidates (config.py:473) and resolved via _resolve_reranker_max_candidates (memory_engine.py:797) — the per-budget overrides (_LOW/_MID/_HIGH) are unset so it falls back to the flat value.
  • Bank config carries no rerank/candidate overrides (checked /banks/hermes-main/config) — no shadowing.
  • Applied upstream of the encoder in the recall path (memory_engine.py:4860); cross_encoder.py never references the cap (expected — truncation happens before the FlashRank single pass).

Honest caveats

  • The drop is ~5–9× depending on metric, not the full ~9.4× the candidate ratio implies — typical candidate pools for our queries appear to sit well under the 300 ceiling (the recall logs show ~25–32 facts returned), so the cap mainly neutralises the worst case (long-passage pools at high N). That worst case is what killed us.
  • rss_mb remains a high-water mark (your fix is pending); the 2,090MB peak is ru_maxrss-style, current RSS sampled ~1.0–1.2GiB.
  • This is a diagnostic setting, not a recommendation: 25–32 candidates reranked is a quality cut for some queries. Your batching fix is the right permanent answer.

Full sampler CSV (A+B+C phases, 20s cadence)

A-phase VmRSS column reads PID 1 (sampler bug, fixed for B/C) — ignore those values; B/C VmRSS columns read the app process. Nothing else altered.

ts_utc,started_at,docker_stats_mem,cgroup_bytes,vmrss_line,rss_mb_metric,host_mem_swap,new_cons_complete,new_elb,pending_breakdown
2026-08-12T12:32:24Z,2026-08-12T10:25:40.922093834Z,1.452GiB / 19.53GiB,2148347904,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6295/19995 swap=3812/3914,0,0,
2026-08-12T12:32:46Z,2026-08-12T10:25:40.922093834Z,1.452GiB / 19.53GiB,2148253696,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=7068/19995 swap=3812/3914,0,0,
2026-08-12T12:33:07Z,2026-08-12T10:25:40.922093834Z,1.453GiB / 19.53GiB,2149425152,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6559/19995 swap=3810/3914,0,0,
2026-08-12T12:33:28Z,2026-08-12T10:25:40.922093834Z,9.838GiB / 19.53GiB,10749448192,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=15004/19995 swap=3834/3914,0,0,"2026-08-12 12:33:27,385 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:33:50Z,2026-08-12T10:25:40.922093834Z,10.05GiB / 19.53GiB,10806915072,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=14763/19995 swap=3837/3914,0,0,"2026-08-12 12:33:27,385 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:34:11Z,2026-08-12T10:25:40.922093834Z,1.799GiB / 19.53GiB,1971703808,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6263/19995 swap=3836/3914,0,0,"2026-08-12 12:33:57,775 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:34:33Z,2026-08-12T10:25:40.922093834Z,1.798GiB / 19.53GiB,1971552256,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6250/19995 swap=3836/3914,0,0,
2026-08-12T12:34:54Z,2026-08-12T10:25:40.922093834Z,1.799GiB / 19.53GiB,1971818496,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6290/19995 swap=3829/3914,0,0,
2026-08-12T12:35:15Z,2026-08-12T10:25:40.922093834Z,1.798GiB / 19.53GiB,1972396032,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6396/19995 swap=3828/3914,0,0,
2026-08-12T12:35:37Z,2026-08-12T10:25:40.922093834Z,1.815GiB / 19.53GiB,1992613888,/proc/1/status:VmRSS:	    2104 kB,rss_mb=10426,mem=6350/19995 swap=3825/3914,1,0,
2026-08-12T12:35:58Z,2026-08-12T10:25:40.922093834Z,10.65GiB / 19.53GiB,11451314176,/proc/1/status:VmRSS:	    2104 kB,,mem=15573/19995 swap=3843/3914,1,0,"2026-08-12 12:35:58,358 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T12:36:19Z,2026-08-12T12:36:08.827939994Z,920.2MiB / 19.53GiB,1159704576,/proc/1/status:VmRSS:	    3484 kB,,mem=5468/19995 swap=3905/3914,0,0,"2026-08-12 12:35:58,358 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T12:36:41Z,2026-08-12T12:36:08.827939994Z,1.675GiB / 19.53GiB,2304315392,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1000,mem=6090/19995 swap=3903/3914,1,0,"2026-08-12 12:36:28,112 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:37:02Z,2026-08-12T12:36:08.827939994Z,1.675GiB / 19.53GiB,2304393216,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1004,mem=6003/19995 swap=3903/3914,1,0,"2026-08-12 12:36:58,216 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:37:23Z,2026-08-12T12:36:08.827939994Z,1.81GiB / 19.53GiB,2526040064,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1004,mem=6034/19995 swap=3903/3914,0,0,"2026-08-12 12:36:58,216 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:37:45Z,2026-08-12T12:36:08.827939994Z,1.811GiB / 19.53GiB,2526900224,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1040,mem=6020/19995 swap=3903/3914,0,0,
2026-08-12T12:38:06Z,2026-08-12T12:36:08.827939994Z,1.811GiB / 19.53GiB,2526879744,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1040,mem=6038/19995 swap=3902/3914,0,0,
2026-08-12T12:38:28Z,2026-08-12T12:36:08.827939994Z,1.834GiB / 19.53GiB,2583822336,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6051/19995 swap=3902/3914,1,0,
2026-08-12T12:38:49Z,2026-08-12T12:36:08.827939994Z,1.835GiB / 19.53GiB,2584084480,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6029/19995 swap=3902/3914,1,0,
2026-08-12T12:39:10Z,2026-08-12T12:36:08.827939994Z,1.834GiB / 19.53GiB,2583818240,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6044/19995 swap=3902/3914,0,0,
2026-08-12T12:39:31Z,2026-08-12T12:36:08.827939994Z,1.834GiB / 19.53GiB,2583564288,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6065/19995 swap=3901/3914,0,0,
2026-08-12T12:39:52Z,2026-08-12T12:36:08.827939994Z,1.835GiB / 19.53GiB,2584080384,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6128/19995 swap=3901/3914,0,0,
2026-08-12T12:40:14Z,2026-08-12T12:36:08.827939994Z,1.834GiB / 19.53GiB,2583560192,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6032/19995 swap=3899/3914,0,0,
2026-08-12T12:40:36Z,2026-08-12T12:36:08.827939994Z,1.86GiB / 19.53GiB,2614804480,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=6057/19995 swap=3897/3914,0,0,
2026-08-12T12:40:57Z,2026-08-12T12:36:08.827939994Z,6.812GiB / 19.53GiB,8080367616,/proc/1/status:VmRSS:	    3484 kB,rss_mb=1048,mem=13092/19995 swap=3897/3914,0,0,
2026-08-12T12:41:18Z,2026-08-12T12:36:08.827939994Z,2.676GiB / 19.53GiB,3579613184,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=7551/19995 swap=3897/3914,0,0,"2026-08-12 12:40:59,405 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:41:40Z,2026-08-12T12:36:08.827939994Z,6.353GiB / 19.53GiB,7666483200,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=12878/19995 swap=3897/3914,0,0,
2026-08-12T12:42:01Z,2026-08-12T12:36:08.827939994Z,1.958GiB / 19.53GiB,2895159296,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6449/19995 swap=3897/3914,0,0,
2026-08-12T12:42:23Z,2026-08-12T12:36:08.827939994Z,1.951GiB / 19.53GiB,2886668288,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6198/19995 swap=3896/3914,0,0,
2026-08-12T12:42:44Z,2026-08-12T12:36:08.827939994Z,1.971GiB / 19.53GiB,2909855744,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6386/19995 swap=3896/3914,1,0,
2026-08-12T12:43:05Z,2026-08-12T12:36:08.827939994Z,1.971GiB / 19.53GiB,2909884416,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6212/19995 swap=3896/3914,1,0,
2026-08-12T12:43:26Z,2026-08-12T12:36:08.827939994Z,1.971GiB / 19.53GiB,2909970432,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6203/19995 swap=3896/3914,0,0,
2026-08-12T12:43:47Z,2026-08-12T12:36:08.827939994Z,1.987GiB / 19.53GiB,2927284224,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6205/19995 swap=3896/3914,0,0,
2026-08-12T12:44:09Z,2026-08-12T12:36:08.827939994Z,1.986GiB / 19.53GiB,2926243840,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6199/19995 swap=3896/3914,0,0,
2026-08-12T12:44:30Z,2026-08-12T12:36:08.827939994Z,1.986GiB / 19.53GiB,2926018560,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6195/19995 swap=3896/3914,0,0,
2026-08-12T12:44:51Z,2026-08-12T12:36:08.827939994Z,1.989GiB / 19.53GiB,2929422336,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6309/19995 swap=3888/3914,0,0,
2026-08-12T12:45:12Z,2026-08-12T12:36:08.827939994Z,1.989GiB / 19.53GiB,2929434624,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6370/19995 swap=3887/3914,0,0,
2026-08-12T12:45:33Z,2026-08-12T12:36:08.827939994Z,2.006GiB / 19.53GiB,2947227648,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6227/19995 swap=3887/3914,0,0,
2026-08-12T12:45:55Z,2026-08-12T12:36:08.827939994Z,2.005GiB / 19.53GiB,2946768896,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6304/19995 swap=3887/3914,0,0,
2026-08-12T12:46:16Z,2026-08-12T12:36:08.827939994Z,2.006GiB / 19.53GiB,2947031040,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6370/19995 swap=3887/3914,0,0,
2026-08-12T12:46:37Z,2026-08-12T12:36:08.827939994Z,2.005GiB / 19.53GiB,2946420736,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6355/19995 swap=3887/3914,0,0,
2026-08-12T12:46:58Z,2026-08-12T12:36:08.827939994Z,2.006GiB / 19.53GiB,2947186688,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6339/19995 swap=3887/3914,0,0,
2026-08-12T12:47:19Z,2026-08-12T12:36:08.827939994Z,2.005GiB / 19.53GiB,2946424832,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6423/19995 swap=3887/3914,0,0,
2026-08-12T12:47:40Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948390912,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6253/19995 swap=3887/3914,0,0,
2026-08-12T12:48:02Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948399104,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6657/19995 swap=3887/3914,0,0,
2026-08-12T12:48:23Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948374528,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6339/19995 swap=3887/3914,0,0,
2026-08-12T12:48:44Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948395008,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6457/19995 swap=3887/3914,0,0,
2026-08-12T12:49:05Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948399104,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6303/19995 swap=3887/3914,0,0,
2026-08-12T12:49:27Z,2026-08-12T12:36:08.827939994Z,2.007GiB / 19.53GiB,2948284416,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6282/19995 swap=3886/3914,0,0,
2026-08-12T12:49:48Z,2026-08-12T12:36:08.827939994Z,2.008GiB / 19.53GiB,2949185536,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6295/19995 swap=3886/3914,0,0,
2026-08-12T12:50:09Z,2026-08-12T12:36:08.827939994Z,2.008GiB / 19.53GiB,2949431296,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6287/19995 swap=3886/3914,0,0,
2026-08-12T12:50:30Z,2026-08-12T12:36:08.827939994Z,2.008GiB / 19.53GiB,2949439488,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6383/19995 swap=3886/3914,0,0,
2026-08-12T12:50:51Z,2026-08-12T12:36:08.827939994Z,2.009GiB / 19.53GiB,2950770688,/proc/1/status:VmRSS:	    3484 kB,rss_mb=9256,mem=6443/19995 swap=3886/3914,0,0,
2026-08-12T12:53:41Z,2026-08-12T12:52:40.510876132Z,851.4MiB / 19.53GiB,1043861504,VmRSS:	  918132 kB,rss_mb=896,mem=5855/19995 swap=3885/3914,0,0,
2026-08-12T12:54:02Z,2026-08-12T12:52:40.510876132Z,857.8MiB / 19.53GiB,1053220864,VmRSS:	  921112 kB,rss_mb=896,mem=5871/19995 swap=3885/3914,0,0,
2026-08-12T12:54:23Z,2026-08-12T12:52:40.510876132Z,4.971GiB / 19.53GiB,5440704512,VmRSS:	 5361140 kB,,mem=9612/19995 swap=3904/3914,0,1,
2026-08-12T12:54:45Z,2026-08-12T12:52:40.510876132Z,5.376GiB / 19.53GiB,5924315136,VmRSS:	 5356760 kB,rss_mb=9187,mem=10224/19995 swap=3900/3914,0,1,"2026-08-12 12:54:28,019 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:55:08Z,2026-08-12T12:52:40.510876132Z,1.638GiB / 19.53GiB,2022768640,VmRSS:	 2163884 kB,rss_mb=9187,mem=7298/19995 swap=3893/3914,0,0,"2026-08-12 12:54:58,316 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:55:30Z,2026-08-12T12:52:40.510876132Z,1.112GiB / 19.53GiB,1490653184,VmRSS:	 1039712 kB,rss_mb=9187,mem=6038/19995 swap=3893/3914,0,0,"2026-08-12 12:54:58,316 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T12:55:51Z,2026-08-12T12:52:40.510876132Z,1.155GiB / 19.53GiB,1612664832,VmRSS:	 1040160 kB,rss_mb=9187,mem=6098/19995 swap=3892/3914,0,0,
2026-08-12T12:56:12Z,2026-08-12T12:52:40.510876132Z,1.156GiB / 19.53GiB,1613463552,VmRSS:	 1040160 kB,rss_mb=9187,mem=6023/19995 swap=3892/3914,0,0,
2026-08-12T12:56:33Z,2026-08-12T12:52:40.510876132Z,1.156GiB / 19.53GiB,1613201408,VmRSS:	 1040160 kB,rss_mb=9187,mem=6003/19995 swap=3892/3914,0,0,
2026-08-12T12:56:55Z,2026-08-12T12:52:40.510876132Z,1.156GiB / 19.53GiB,1613557760,VmRSS:	 1040160 kB,rss_mb=9187,mem=6002/19995 swap=3892/3914,0,0,
2026-08-12T12:57:16Z,2026-08-12T12:52:40.510876132Z,1.228GiB / 19.53GiB,1730547712,VmRSS:	 1093872 kB,rss_mb=9187,mem=6198/19995 swap=3892/3914,1,0,
2026-08-12T12:57:37Z,2026-08-12T12:52:40.510876132Z,1.228GiB / 19.53GiB,1731366912,VmRSS:	 1093872 kB,rss_mb=9187,mem=6167/19995 swap=3892/3914,1,0,
2026-08-12T12:57:58Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1732182016,VmRSS:	 1093872 kB,rss_mb=9187,mem=6106/19995 swap=3892/3914,0,0,
2026-08-12T12:58:19Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1732431872,VmRSS:	 1093872 kB,rss_mb=9187,mem=6054/19995 swap=3892/3914,0,0,
2026-08-12T12:58:41Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1732501504,VmRSS:	 1093872 kB,rss_mb=9187,mem=6055/19995 swap=3892/3914,0,0,
2026-08-12T12:59:02Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1732956160,VmRSS:	 1093872 kB,rss_mb=9187,mem=6173/19995 swap=3892/3914,0,0,
2026-08-12T12:59:23Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1733341184,VmRSS:	 1093872 kB,rss_mb=9187,mem=6076/19995 swap=3892/3914,0,0,
2026-08-12T12:59:44Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1733488640,VmRSS:	 1093872 kB,rss_mb=9187,mem=6078/19995 swap=3892/3914,0,0,
2026-08-12T13:00:05Z,2026-08-12T12:52:40.510876132Z,1.229GiB / 19.53GiB,1733419008,VmRSS:	 1093872 kB,rss_mb=9187,mem=6113/19995 swap=3891/3914,0,0,
2026-08-12T13:00:26Z,2026-08-12T12:52:40.510876132Z,1.164GiB / 19.53GiB,1664262144,VmRSS:	 1093872 kB,rss_mb=9187,mem=6091/19995 swap=3876/3914,0,0,
2026-08-12T13:00:48Z,2026-08-12T12:52:40.510876132Z,1.14GiB / 19.53GiB,1637699584,VmRSS:	 1093872 kB,rss_mb=9187,mem=6028/19995 swap=3876/3914,0,0,
2026-08-12T13:01:09Z,2026-08-12T12:52:40.510876132Z,1.154GiB / 19.53GiB,1654296576,VmRSS:	 1093872 kB,rss_mb=9187,mem=6710/19995 swap=3862/3914,0,0,
2026-08-12T13:01:30Z,2026-08-12T12:52:40.510876132Z,1.133GiB / 19.53GiB,1371000832,VmRSS:	 1086808 kB,rss_mb=9187,mem=6181/19995 swap=3914/3914,0,0,
2026-08-12T13:01:51Z,2026-08-12T12:52:40.510876132Z,1.135GiB / 19.53GiB,1372487680,VmRSS:	 1086792 kB,rss_mb=9187,mem=6118/19995 swap=3913/3914,0,0,
2026-08-12T13:02:13Z,2026-08-12T12:52:40.510876132Z,1.123GiB / 19.53GiB,1359699968,VmRSS:	 1086792 kB,rss_mb=9187,mem=6018/19995 swap=3912/3914,0,0,
2026-08-12T13:02:34Z,2026-08-12T12:52:40.510876132Z,1.153GiB / 19.53GiB,1393999872,VmRSS:	 1087100 kB,rss_mb=9187,mem=6011/19995 swap=3912/3914,0,0,
2026-08-12T13:02:55Z,2026-08-12T12:52:40.510876132Z,1.153GiB / 19.53GiB,1393741824,VmRSS:	 1087100 kB,rss_mb=9187,mem=7512/19995 swap=3897/3914,0,0,
2026-08-12T13:03:16Z,2026-08-12T12:52:40.510876132Z,1.155GiB / 19.53GiB,1396174848,VmRSS:	 1087100 kB,rss_mb=9187,mem=6191/19995 swap=3895/3914,0,0,
2026-08-12T13:03:38Z,2026-08-12T12:52:40.510876132Z,1.16GiB / 19.53GiB,1402109952,VmRSS:	 1087116 kB,rss_mb=9187,mem=6107/19995 swap=3895/3914,0,0,
2026-08-12T13:03:59Z,2026-08-12T12:52:40.510876132Z,1.16GiB / 19.53GiB,1401843712,VmRSS:	 1087116 kB,rss_mb=9187,mem=6268/19995 swap=3894/3914,0,0,
2026-08-12T13:04:20Z,2026-08-12T12:52:40.510876132Z,1.16GiB / 19.53GiB,1401839616,VmRSS:	 1087116 kB,rss_mb=9187,mem=6110/19995 swap=3893/3914,0,0,
2026-08-12T13:04:41Z,2026-08-12T12:52:40.510876132Z,1.182GiB / 19.53GiB,1425047552,VmRSS:	 1087140 kB,rss_mb=9187,mem=6127/19995 swap=3893/3914,0,0,
2026-08-12T13:05:02Z,2026-08-12T12:52:40.510876132Z,1.183GiB / 19.53GiB,1425891328,VmRSS:	 1087140 kB,rss_mb=9187,mem=6091/19995 swap=3893/3914,0,0,
2026-08-12T13:05:23Z,2026-08-12T12:52:40.510876132Z,1.183GiB / 19.53GiB,1426636800,VmRSS:	 1087140 kB,rss_mb=9187,mem=6080/19995 swap=3893/3914,0,0,
2026-08-12T13:05:45Z,2026-08-12T12:52:40.510876132Z,1.19GiB / 19.53GiB,1439408128,VmRSS:	 1087188 kB,rss_mb=9187,mem=6115/19995 swap=3892/3914,0,0,
2026-08-12T13:06:06Z,2026-08-12T12:52:40.510876132Z,1.19GiB / 19.53GiB,1439412224,VmRSS:	 1087188 kB,rss_mb=9187,mem=6156/19995 swap=3887/3914,0,0,
2026-08-12T13:06:27Z,2026-08-12T12:52:40.510876132Z,1.191GiB / 19.53GiB,1439932416,VmRSS:	 1087188 kB,rss_mb=9187,mem=6115/19995 swap=3887/3914,0,0,
2026-08-12T13:06:48Z,2026-08-12T12:52:40.510876132Z,1.191GiB / 19.53GiB,1440395264,VmRSS:	 1087180 kB,rss_mb=9187,mem=6158/19995 swap=3887/3914,0,0,
2026-08-12T13:07:10Z,2026-08-12T12:52:40.510876132Z,1.191GiB / 19.53GiB,1440382976,VmRSS:	 1087180 kB,rss_mb=9187,mem=6222/19995 swap=3886/3914,0,0,
2026-08-12T13:07:31Z,2026-08-12T12:52:40.510876132Z,9.503GiB / 19.53GiB,10469892096,VmRSS:	12762028 kB,rss_mb=9187,mem=18016/19995 swap=3914/3914,0,0,"2026-08-12 13:07:31,416 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T13:07:54Z,2026-08-12T13:07:36.331025736Z,1.541GiB / 19.53GiB,2085515264,VmRSS:	  907188 kB,rss_mb=884,mem=5833/19995 swap=3913/3914,0,0,"2026-08-12 13:07:53,490 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T13:08:15Z,2026-08-12T13:07:36.331025736Z,1.654GiB / 19.53GiB,2245648384,VmRSS:	 1009908 kB,,mem=5891/19995 swap=3910/3914,0,0,"2026-08-12 13:07:53,490 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T13:08:36Z,2026-08-12T13:07:36.331025736Z,1.697GiB / 19.53GiB,2315255808,VmRSS:	 1010476 kB,rss_mb=986,mem=5847/19995 swap=3910/3914,1,0,"2026-08-12 13:08:23,715 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T13:08:57Z,2026-08-12T13:07:36.331025736Z,1.824GiB / 19.53GiB,2512879616,VmRSS:	 1060336 kB,rss_mb=1035,mem=5989/19995 swap=3910/3914,0,0,
2026-08-12T13:09:19Z,2026-08-12T13:07:36.331025736Z,1.824GiB / 19.53GiB,2512637952,VmRSS:	 1060336 kB,rss_mb=1035,mem=5986/19995 swap=3909/3914,0,0,
2026-08-12T13:09:40Z,2026-08-12T13:07:36.331025736Z,1.849GiB / 19.53GiB,2556735488,VmRSS:	 1075300 kB,rss_mb=1035,mem=5971/19995 swap=3909/3914,1,0,
2026-08-12T13:10:01Z,2026-08-12T13:07:36.331025736Z,1.85GiB / 19.53GiB,2557767680,VmRSS:	 1075300 kB,rss_mb=1050,mem=5996/19995 swap=3906/3914,1,0,
2026-08-12T13:10:22Z,2026-08-12T13:07:36.331025736Z,1.85GiB / 19.53GiB,2557886464,VmRSS:	 1075300 kB,rss_mb=1050,mem=5975/19995 swap=3906/3914,0,0,
2026-08-12T13:10:43Z,2026-08-12T13:07:36.331025736Z,1.871GiB / 19.53GiB,2697912320,VmRSS:	 1075320 kB,rss_mb=1050,mem=5985/19995 swap=3906/3914,0,0,
2026-08-12T13:11:05Z,2026-08-12T13:07:36.331025736Z,2.461GiB / 19.53GiB,3481370624,VmRSS:	 1653208 kB,rss_mb=1050,mem=7016/19995 swap=3906/3914,0,0,"2026-08-12 13:10:54,235 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T13:11:26Z,2026-08-12T13:07:36.331025736Z,2.824GiB / 19.53GiB,3785408512,VmRSS:	 3149800 kB,rss_mb=9265,mem=8519/19995 swap=3906/3914,0,0,"2026-08-12 13:11:24,428 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T13:11:47Z,2026-08-12T13:07:36.331025736Z,7.224GiB / 19.53GiB,8340959232,VmRSS:	 5393448 kB,rss_mb=9265,mem=10440/19995 swap=3906/3914,0,0,"2026-08-12 13:11:24,428 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T13:12:09Z,2026-08-12T13:07:36.331025736Z,2.11GiB / 19.53GiB,3034087424,VmRSS:	 1160948 kB,,mem=6415/19995 swap=3905/3914,0,0,"2026-08-12 13:11:54,669 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T13:12:30Z,2026-08-12T13:07:36.331025736Z,2.183GiB / 19.53GiB,3112890368,VmRSS:	 1160996 kB,rss_mb=9265,mem=6373/19995 swap=3905/3914,0,0,
2026-08-12T14:56:43Z,2026-08-12T14:55:59.872999595Z,1.345GiB / 19.53GiB,1781448704,VmRSS:	  937664 kB,rss_mb=914,mem=5676/19995 swap=3813/3914,0,0,
2026-08-12T14:57:05Z,2026-08-12T14:55:59.872999595Z,1.67GiB / 19.53GiB,2193338368,VmRSS:	 1244712 kB,rss_mb=918,mem=6124/19995 swap=3813/3914,0,0,"2026-08-12 14:56:49,968 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T14:57:26Z,2026-08-12T14:55:59.872999595Z,1.441GiB / 19.53GiB,1948065792,VmRSS:	 1006212 kB,rss_mb=2079,mem=5917/19995 swap=3812/3914,0,0,"2026-08-12 14:57:20,164 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T14:57:47Z,2026-08-12T14:55:59.872999595Z,1.625GiB / 19.53GiB,2224664576,VmRSS:	 1082048 kB,,mem=5954/19995 swap=3812/3914,0,0,"2026-08-12 14:57:20,164 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T14:58:08Z,2026-08-12T14:55:59.872999595Z,1.625GiB / 19.53GiB,2225135616,VmRSS:	 1082048 kB,rss_mb=2079,mem=5935/19995 swap=3812/3914,0,0,
2026-08-12T14:58:29Z,2026-08-12T14:55:59.872999595Z,1.625GiB / 19.53GiB,2225115136,VmRSS:	 1082048 kB,rss_mb=2079,mem=6057/19995 swap=3811/3914,0,0,
2026-08-12T14:58:51Z,2026-08-12T14:55:59.872999595Z,1.625GiB / 19.53GiB,2225360896,VmRSS:	 1082048 kB,rss_mb=2079,mem=5935/19995 swap=3809/3914,0,0,
2026-08-12T14:59:12Z,2026-08-12T14:55:59.872999595Z,1.626GiB / 19.53GiB,2225823744,VmRSS:	 1082048 kB,rss_mb=2079,mem=5946/19995 swap=3808/3914,0,0,
2026-08-12T14:59:33Z,2026-08-12T14:55:59.872999595Z,1.605GiB / 19.53GiB,2205237248,VmRSS:	 1067548 kB,rss_mb=2079,mem=6030/19995 swap=3808/3914,0,0,"2026-08-12 14:59:20,798 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T14:59:54Z,2026-08-12T14:55:59.872999595Z,1.667GiB / 19.53GiB,2288689152,VmRSS:	 1099292 kB,rss_mb=2079,mem=5971/19995 swap=3807/3914,0,0,"2026-08-12 14:59:51,230 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] consolidation: total=1 claimable=1 payload_null=0 retry_blocked=0 assigned=0"
2026-08-12T15:00:15Z,2026-08-12T14:55:59.872999595Z,1.676GiB / 19.53GiB,2302660608,VmRSS:	 1105292 kB,rss_mb=2079,mem=5954/19995 swap=3805/3914,1,0,"2026-08-12 14:59:51,230 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] consolidation: total=1 claimable=1 payload_null=0 retry_blocked=0 assigned=0"
2026-08-12T15:00:37Z,2026-08-12T14:55:59.872999595Z,1.695GiB / 19.53GiB,2322321408,VmRSS:	 1105292 kB,rss_mb=2079,mem=6202/19995 swap=3804/3914,1,0,
2026-08-12T15:00:58Z,2026-08-12T14:55:59.872999595Z,1.695GiB / 19.53GiB,2322276352,VmRSS:	 1105292 kB,rss_mb=2079,mem=6473/19995 swap=3803/3914,0,0,
2026-08-12T15:01:20Z,2026-08-12T14:55:59.872999595Z,1.19GiB / 19.53GiB,1839648768,VmRSS:	 1098080 kB,rss_mb=2079,mem=6020/19995 swap=3909/3914,0,0,
2026-08-12T15:01:41Z,2026-08-12T14:55:59.872999595Z,1.2GiB / 19.53GiB,1852477440,VmRSS:	 1077976 kB,rss_mb=2079,mem=5972/19995 swap=3910/3914,0,0,
2026-08-12T15:02:02Z,2026-08-12T14:55:59.872999595Z,1.2GiB / 19.53GiB,1854275584,VmRSS:	 1077976 kB,rss_mb=2090,mem=6181/19995 swap=3908/3914,0,0,"2026-08-12 15:01:52,134 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:02:23Z,2026-08-12T14:55:59.872999595Z,1.2GiB / 19.53GiB,1856077824,VmRSS:	 1078072 kB,rss_mb=2090,mem=6056/19995 swap=3907/3914,0,0,"2026-08-12 15:02:22,271 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:02:45Z,2026-08-12T14:55:59.872999595Z,2.108GiB / 19.53GiB,2834165760,VmRSS:	 2024464 kB,rss_mb=2090,mem=7993/19995 swap=3907/3914,0,0,"2026-08-12 15:02:22,271 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:03:06Z,2026-08-12T14:55:59.872999595Z,1.375GiB / 19.53GiB,2177277952,VmRSS:	 1192148 kB,,mem=6148/19995 swap=3907/3914,0,0,"2026-08-12 15:02:52,641 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=2 claimable=0 payload_null=2 retry_blocked=0 assigned=0"
2026-08-12T15:03:27Z,2026-08-12T14:55:59.872999595Z,1.376GiB / 19.53GiB,2179686400,VmRSS:	 1192148 kB,rss_mb=2090,mem=6177/19995 swap=3906/3914,0,0,"2026-08-12 15:03:22,682 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:03:49Z,2026-08-12T14:55:59.872999595Z,1.472GiB / 19.53GiB,2288615424,VmRSS:	 1291088 kB,rss_mb=2090,mem=6274/19995 swap=3906/3914,0,0,"2026-08-12 15:03:22,682 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:04:10Z,2026-08-12T14:55:59.872999595Z,1.483GiB / 19.53GiB,2309148672,VmRSS:	 1295704 kB,rss_mb=2090,mem=6278/19995 swap=3903/3914,1,0,"2026-08-12 15:03:52,812 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] consolidation: total=1 claimable=1 payload_null=0 retry_blocked=0 assigned=0"
2026-08-12T15:04:31Z,2026-08-12T14:55:59.872999595Z,1.483GiB / 19.53GiB,2309152768,VmRSS:	 1295704 kB,rss_mb=2090,mem=6172/19995 swap=3902/3914,1,0,
2026-08-12T15:04:52Z,2026-08-12T14:55:59.872999595Z,1.485GiB / 19.53GiB,2311712768,VmRSS:	 1295776 kB,rss_mb=2090,mem=6205/19995 swap=3902/3914,0,0,
2026-08-12T15:05:13Z,2026-08-12T14:55:59.872999595Z,1.485GiB / 19.53GiB,2311700480,VmRSS:	 1295776 kB,rss_mb=2090,mem=6198/19995 swap=3902/3914,0,0,
2026-08-12T15:05:35Z,2026-08-12T14:55:59.872999595Z,1.486GiB / 19.53GiB,2312364032,VmRSS:	 1295784 kB,rss_mb=2090,mem=6199/19995 swap=3901/3914,0,0,
2026-08-12T15:05:56Z,2026-08-12T14:55:59.872999595Z,1.421GiB / 19.53GiB,2243559424,VmRSS:	 1229288 kB,rss_mb=2282,mem=6213/19995 swap=3899/3914,0,0,"2026-08-12 15:05:53,273 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:06:17Z,2026-08-12T14:55:59.872999595Z,1.421GiB / 19.53GiB,2243731456,VmRSS:	 1229288 kB,rss_mb=2282,mem=6140/19995 swap=3898/3914,0,0,"2026-08-12 15:05:53,273 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:06:38Z,2026-08-12T14:55:59.872999595Z,1.449GiB / 19.53GiB,2283188224,VmRSS:	 1251516 kB,rss_mb=2282,mem=6177/19995 swap=3894/3914,0,0,"2026-08-12 15:06:23,365 - INFO - hindsight_api.worker.poller - [PENDING_BREAKDOWN] batch_retain: total=1 claimable=0 payload_null=1 retry_blocked=0 assigned=0"
2026-08-12T15:07:00Z,2026-08-12T14:55:59.872999595Z,1.449GiB / 19.53GiB,2283806720,VmRSS:	 1251516 kB,rss_mb=2282,mem=6144/19995 swap=3890/3914,0,0,
2026-08-12T15:07:21Z,2026-08-12T14:55:59.872999595Z,1.473GiB / 19.53GiB,2314858496,VmRSS:	 1270032 kB,rss_mb=2282,mem=6159/19995 swap=3886/3914,1,0,
2026-08-12T15:07:42Z,2026-08-12T14:55:59.872999595Z,1.473GiB / 19.53GiB,2314498048,VmRSS:	 1270032 kB,rss_mb=2282,mem=6152/19995 swap=3878/3914,1,0,
2026-08-12T15:08:03Z,2026-08-12T14:55:59.872999595Z,1.473GiB / 19.53GiB,2314567680,VmRSS:	 1270032 kB,rss_mb=2282,mem=6119/19995 swap=3878/3914,0,0,
2026-08-12T15:08:24Z,2026-08-12T14:55:59.872999595Z,1.404GiB / 19.53GiB,2240532480,VmRSS:	 1270032 kB,rss_mb=2282,mem=6104/19995 swap=3878/3914,0,0,
2026-08-12T15:08:46Z,2026-08-12T14:55:59.872999595Z,1.404GiB / 19.53GiB,2241441792,VmRSS:	 1270032 kB,rss_mb=2282,mem=6342/19995 swap=3877/3914,0,0,
2026-08-12T15:09:07Z,2026-08-12T14:55:59.872999595Z,1.403GiB / 19.53GiB,2240892928,VmRSS:	 1270032 kB,rss_mb=2282,mem=6043/19995 swap=3876/3914,0,0,
2026-08-12T15:09:28Z,2026-08-12T14:55:59.872999595Z,1.403GiB / 19.53GiB,2241134592,VmRSS:	 1270032 kB,rss_mb=2282,mem=6155/19995 swap=3874/3914,0,0,
2026-08-12T15:09:49Z,2026-08-12T14:55:59.872999595Z,1.403GiB / 19.53GiB,2241130496,VmRSS:	 1270032 kB,rss_mb=2282,mem=6126/19995 swap=3874/3914,0,0,
2026-08-12T15:10:10Z,2026-08-12T14:55:59.872999595Z,1.404GiB / 19.53GiB,2241384448,VmRSS:	 1270032 kB,rss_mb=2282,mem=6104/19995 swap=3873/3914,0,0,
2026-08-12T15:10:31Z,2026-08-12T14:55:59.872999595Z,1.403GiB / 19.53GiB,2241114112,VmRSS:	 1270032 kB,rss_mb=2282,mem=6121/19995 swap=3873/3914,0,0,
2026-08-12T15:10:53Z,2026-08-12T14:55:59.872999595Z,1.404GiB / 19.53GiB,2241155072,VmRSS:	 1270032 kB,rss_mb=2282,mem=6069/19995 swap=3873/3914,0,0,
2026-08-12T15:11:14Z,2026-08-12T14:55:59.872999595Z,1.403GiB / 19.53GiB,2240884736,VmRSS:	 1270032 kB,rss_mb=2282,mem=6061/19995 swap=3873/3914,0,0,
2026-08-12T15:11:35Z,2026-08-12T14:55:59.872999595Z,1.37GiB / 19.53GiB,2205097984,VmRSS:	 1270032 kB,rss_mb=2282,mem=6049/19995 swap=3873/3914,0,0,
2026-08-12T15:11:56Z,2026-08-12T14:55:59.872999595Z,1.37GiB / 19.53GiB,2204676096,VmRSS:	 1270032 kB,rss_mb=2282,mem=6037/19995 swap=3873/3914,0,0,
2026-08-12T15:12:17Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191216640,VmRSS:	 1270032 kB,rss_mb=2282,mem=6143/19995 swap=3873/3914,0,0,
2026-08-12T15:12:39Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191261696,VmRSS:	 1270032 kB,rss_mb=2282,mem=6049/19995 swap=3873/3914,0,0,
2026-08-12T15:13:00Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191241216,VmRSS:	 1270032 kB,rss_mb=2282,mem=6027/19995 swap=3872/3914,0,0,
2026-08-12T15:13:21Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191233024,VmRSS:	 1270032 kB,rss_mb=2282,mem=6008/19995 swap=3872/3914,0,0,
2026-08-12T15:13:42Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2190974976,VmRSS:	 1270032 kB,rss_mb=2282,mem=6049/19995 swap=3872/3914,0,0,
2026-08-12T15:14:03Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191241216,VmRSS:	 1270032 kB,rss_mb=2282,mem=6124/19995 swap=3872/3914,0,0,
2026-08-12T15:14:24Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191237120,VmRSS:	 1270032 kB,rss_mb=2282,mem=6019/19995 swap=3872/3914,0,0,
2026-08-12T15:14:46Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191245312,VmRSS:	 1270032 kB,rss_mb=2282,mem=6006/19995 swap=3872/3914,0,0,
2026-08-12T15:15:07Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191241216,VmRSS:	 1270032 kB,rss_mb=2282,mem=6101/19995 swap=3872/3914,0,0,
2026-08-12T15:15:28Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191241216,VmRSS:	 1270032 kB,rss_mb=2282,mem=5989/19995 swap=3872/3914,0,0,

paulsto avatar Aug 12 '26 15:08 paulsto

Test D + serial close-out — refresh is VIABLE under the candidate cap; 13/13 mental models regenerated with real content (12 Aug 2026)

Test C (previous comment) proved the unbatched FlashRank pass was the consolidation/retain burst. Test D closes the loop on the original failure mode — the refresh that has OOM-killed this box five times since 10 Aug.

Sanitisation note (house protocol): mm- IDs redacted (7), operation UUIDs redacted (34), internal process IDs redacted; no secrets/emails/IPs present (the only IP-like strings are docker-stats GiB values). Bank name retained as in previous posts.

Test D — manual refresh of Pauls Working Preferences, MAX_CANDIDATES=32, full default agent loop

Completed in 165.9s — 5 iterations, 13 search_observations tool calls (each retrieved ~25–32K chars), generated a 5,323-char page (populated_content=True). Same mental model, same bank, same config except the cap:

Test 1 (300 candidates, 12 Aug 09:41) Test D (32 candidates, 12 Aug 15:16)
outcome kernel OOM: 953MiB → 13.94GiB in 80s completed, 165.9s
generated content 528-char stub ("retrieval returned no data", zero based-on memories) 5,323 chars, populated
agent loop died mid-loop 5 iterations, 13 tool calls
app peak (ru_maxrss) 13,940MB 5,100MB
container restarts 1 0

Memory shape during D: each tool turn bumps 3.6–5.0GiB docker (cgroup 4.7–6.2GB) and releases between turns (flat 1.42GiB); RestartCount stayed 0. D-window sampler rows (5s cadence):

2026-08-12T15:16:02Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191233024,rss_mb=2282
2026-08-12T15:16:08Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2190991360,rss_mb=2282
2026-08-12T15:16:14Z,2026-08-12T14:55:59.872999595Z,1.357GiB / 19.53GiB,2191253504,rss_mb=2282
2026-08-12T15:16:20Z,2026-08-12T14:55:59.872999595Z,1.367GiB / 19.53GiB,2271232000,rss_mb=2282
2026-08-12T15:16:26Z,2026-08-12T14:55:59.872999595Z,3.593GiB / 19.53GiB,4681375744,rss_mb=2381
2026-08-12T15:16:33Z,2026-08-12T14:55:59.872999595Z,3.639GiB / 19.53GiB,4735295488,rss_mb=2381
2026-08-12T15:16:39Z,2026-08-12T14:55:59.872999595Z,2.076GiB / 19.53GiB,3073830912,rss_mb=2381
2026-08-12T15:16:46Z,2026-08-12T14:55:59.872999595Z,2.468GiB / 19.53GiB,3665969152,rss_mb=2381
2026-08-12T15:16:52Z,2026-08-12T14:55:59.872999595Z,1.466GiB / 19.53GiB,2379673600,rss_mb=2381
2026-08-12T15:16:58Z,2026-08-12T14:55:59.872999595Z,1.465GiB / 19.53GiB,2378768384,rss_mb=5035
2026-08-12T15:17:05Z,2026-08-12T14:55:59.872999595Z,1.466GiB / 19.53GiB,2380042240,rss_mb=5035
2026-08-12T15:17:11Z,2026-08-12T14:55:59.872999595Z,5.015GiB / 19.53GiB,6191017984,rss_mb=5035
2026-08-12T15:17:18Z,2026-08-12T14:55:59.872999595Z,3.263GiB / 19.53GiB,4157571072,rss_mb=5035
2026-08-12T15:17:26Z,2026-08-12T14:55:59.872999595Z,1.415GiB / 19.53GiB,2325946368,rss_mb=5100
2026-08-12T15:17:32Z,2026-08-12T14:55:59.872999595Z,1.415GiB / 19.53GiB,2325966848,rss_mb=5100
2026-08-12T15:17:38Z,2026-08-12T14:55:59.872999595Z,1.415GiB / 19.53GiB,2325929984,rss_mb=5100
2026-08-12T15:17:44Z,2026-08-12T14:55:59.872999595Z,4.126GiB / 19.53GiB,5238407168,rss_mb=5100
2026-08-12T15:17:51Z,2026-08-12T14:55:59.872999595Z,1.505GiB / 19.53GiB,2424123392,rss_mb=5100
2026-08-12T15:17:57Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329100288,rss_mb=5100
2026-08-12T15:18:03Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329108480,rss_mb=5100
2026-08-12T15:18:10Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329108480,rss_mb=5100
2026-08-12T15:18:16Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329337856,rss_mb=5100
2026-08-12T15:18:22Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329112576,rss_mb=5100
2026-08-12T15:18:28Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329628672,rss_mb=5100
2026-08-12T15:18:34Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329513984,rss_mb=5100
2026-08-12T15:18:41Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329899008,rss_mb=5100
2026-08-12T15:18:47Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329604096,rss_mb=5100
2026-08-12T15:18:53Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329513984,rss_mb=5100
2026-08-12T15:18:59Z,2026-08-12T14:55:59.872999595Z,1.417GiB / 19.53GiB,2329276416,rss_mb=5100
2026-08-12T15:19:05Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330722304,rss_mb=5100
2026-08-12T15:19:11Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330701824,rss_mb=5100
2026-08-12T15:19:18Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330816512,rss_mb=5100
2026-08-12T15:19:24Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330730496,rss_mb=5100
2026-08-12T15:19:30Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330972160,rss_mb=5100
2026-08-12T15:19:37Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330873856,rss_mb=5100
2026-08-12T15:19:43Z,2026-08-12T14:55:59.872999595Z,1.418GiB / 19.53GiB,2330468352,rss_mb=5100
2026-08-12T15:19:49Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333876224,rss_mb=5100
2026-08-12T15:19:56Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333675520,rss_mb=5100
2026-08-12T15:20:02Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333691904,rss_mb=5100
2026-08-12T15:20:08Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333446144,rss_mb=5100
2026-08-12T15:20:14Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333691904,rss_mb=5100
2026-08-12T15:20:20Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333683712,rss_mb=5100
2026-08-12T15:20:26Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333622272,rss_mb=5100
2026-08-12T15:20:33Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333450240,rss_mb=5100
2026-08-12T15:20:39Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333446144,rss_mb=5100
2026-08-12T15:20:45Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333925376,rss_mb=5100
2026-08-12T15:20:51Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333687808,rss_mb=5100
2026-08-12T15:20:57Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333687808,rss_mb=5100
2026-08-12T15:21:03Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333675520,rss_mb=5100
2026-08-12T15:21:10Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333691904,rss_mb=5100
2026-08-12T15:21:16Z,2026-08-12T14:55:59.872999595Z,1.42GiB / 19.53GiB,2333880320,rss_mb=5100
2026-08-12T15:21:22Z,2026-08-12T14:55:59.872999595Z,1.421GiB / 19.53GiB,2334027776,rss_mb=5100
2026-08-12T15:21:28Z,2026-08-12T14:55:59.872999595Z,1.396GiB / 19.53GiB,2307596288,rss_mb=5100
2026-08-12T15:21:34Z,2026-08-12T14:55:59.872999595Z,2.292GiB / 19.53GiB,3272278016,rss_mb=5100
2026-08-12T15:21:41Z,2026-08-12T14:55:59.872999595Z,1.4GiB / 19.53GiB,2314547200,rss_mb=5100
2026-08-12T15:21:47Z,2026-08-12T14:55:59.872999595Z,1.4GiB / 19.53GiB,2314854400,rss_mb=5100
2026-08-12T15:21:53Z,2026-08-12T14:55:59.872999595Z,1.4GiB / 19.53GiB,2314571776,rss_mb=5100
2026-08-12T15:21:59Z,2026-08-12T14:55:59.872999595Z,1.4GiB / 19.53GiB,2314838016,rss_mb=5100
2026-08-12T15:22:05Z,2026-08-12T14:55:59.872999595Z,1.401GiB / 19.53GiB,2315247616,rss_mb=5100
2026-08-12T15:22:12Z,2026-08-12T14:55:59.872999595Z,1.39GiB / 19.53GiB,2304274432,rss_mb=5100
2026-08-12T15:22:18Z,2026-08-12T14:55:59.872999595Z,1.39GiB / 19.53GiB,2304626688,rss_mb=5100
2026-08-12T15:22:24Z,2026-08-12T14:55:59.872999595Z,1.39GiB / 19.53GiB,2304536576,rss_mb=5100
2026-08-12T15:22:30Z,2026-08-12T14:55:59.872999595Z,1.456GiB / 19.53GiB,2375393280,rss_mb=5100
2026-08-12T15:22:36Z,2026-08-12T14:55:59.872999595Z,1.571GiB / 19.53GiB,2519040000,
2026-08-12T15:22:42Z,2026-08-12T14:55:59.872999595Z,1.571GiB / 19.53GiB,2519326720,
2026-08-12T15:22:49Z,2026-08-12T14:55:59.872999595Z,1.571GiB / 19.53GiB,2519592960,
2026-08-12T15:22:55Z,2026-08-12T14:55:59.872999595Z,1.571GiB / 19.53GiB,2519171072,
2026-08-12T15:23:01Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520141824,rss_mb=5100
2026-08-12T15:23:07Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520133632,rss_mb=5100
2026-08-12T15:23:13Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520260608,rss_mb=5100
2026-08-12T15:23:19Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520317952,rss_mb=5100
2026-08-12T15:23:26Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520043520,rss_mb=5100
2026-08-12T15:23:34Z,2026-08-12T14:55:59.872999595Z,1.572GiB / 19.53GiB,2520141824,rss_mb=5100

Serial close-out — remaining 12 mental models, one at a time

All 12 completed, every one populated=True, RestartCount 0→0 throughout (script waits for each op to reach terminal + memory settle <2.5GiB before triggering the next):

surface duration content
AI Platform and Media Production 90s 9,123 chars
Agency Reporting and Operations 80s 13,492
Content and SEO Research 80s 9,532
Website Build Conventions 170s 15,568
Ads Management 70s 3,649
Prospecting Reply Handling 90s 11,597
SumFactors Clients and Status 230s 1,378
Infrastructure Map 70s 7,074
SEO Report Conventions 80s 10,067
Hermes Memory Architecture 80s 7,228
Prospecting Pipeline 90s 3,244
Client Onboarding 70s 8,578

13/13 surfaces regenerated 12 Aug, ~101K chars total — the first successful refresh of any knowledge page since 9 Aug (the whole sweep had been disabled since the 10 Aug 17.7GB storm). Close-out burst rows (docker stats > 2.2GiB, 10s cadence):

2026-08-12T15:23:45Z,2026-08-12T14:55:59.872999595Z,5.272GiB / 19.53GiB,6525751296,rss_mb=5100
2026-08-12T15:24:08Z,2026-08-12T14:55:59.872999595Z,4.279GiB / 19.53GiB,5468971008,rss_mb=5208
2026-08-12T15:24:19Z,2026-08-12T14:55:59.872999595Z,3.506GiB / 19.53GiB,4643368960,rss_mb=5208
2026-08-12T15:25:16Z,2026-08-12T14:55:59.872999595Z,2.464GiB / 19.53GiB,3536412672,rss_mb=5208
2026-08-12T15:25:27Z,2026-08-12T14:55:59.872999595Z,3.365GiB / 19.53GiB,4513009664,rss_mb=5208
2026-08-12T15:25:38Z,2026-08-12T14:55:59.872999595Z,3.363GiB / 19.53GiB,4512063488,rss_mb=5208
2026-08-12T15:26:35Z,2026-08-12T14:55:59.872999595Z,4.393GiB / 19.53GiB,5692989440,rss_mb=5208
2026-08-12T15:26:46Z,2026-08-12T14:55:59.872999595Z,3.408GiB / 19.53GiB,4616798208,rss_mb=5208
2026-08-12T15:26:57Z,2026-08-12T14:55:59.872999595Z,2.696GiB / 19.53GiB,3862114304,rss_mb=5208
2026-08-12T15:27:09Z,2026-08-12T14:55:59.872999595Z,3.429GiB / 19.53GiB,4627656704,rss_mb=5208
2026-08-12T15:27:54Z,2026-08-12T14:55:59.872999595Z,5.147GiB / 19.53GiB,6477578240,rss_mb=5208
2026-08-12T15:28:05Z,2026-08-12T14:55:59.872999595Z,2.447GiB / 19.53GiB,3578167296,rss_mb=5208
2026-08-12T15:28:17Z,2026-08-12T14:55:59.872999595Z,3.376GiB / 19.53GiB,4576157696,rss_mb=5208
2026-08-12T15:32:01Z,2026-08-12T14:55:59.872999595Z,5.19GiB / 19.53GiB,6537789440,rss_mb=5208
2026-08-12T15:32:23Z,2026-08-12T14:55:59.872999595Z,3.46GiB / 19.53GiB,4683833344,rss_mb=5208
2026-08-12T15:33:30Z,2026-08-12T14:55:59.872999595Z,4.272GiB / 19.53GiB,5555163136,rss_mb=5214
2026-08-12T15:37:37Z,2026-08-12T14:55:59.872999595Z,3.627GiB / 19.53GiB,5010948096,rss_mb=5214
2026-08-12T15:38:33Z,2026-08-12T14:55:59.872999595Z,3.597GiB / 19.53GiB,4984020992,rss_mb=5214
2026-08-12T15:38:45Z,2026-08-12T14:55:59.872999595Z,3.692GiB / 19.53GiB,5089554432,
2026-08-12T15:38:56Z,2026-08-12T14:55:59.872999595Z,4.571GiB / 19.53GiB,6034657280,
2026-08-12T15:39:53Z,2026-08-12T14:55:59.872999595Z,4.589GiB / 19.53GiB,6060003328,rss_mb=5214
2026-08-12T15:41:11Z,2026-08-12T14:55:59.872999595Z,3.086GiB / 19.53GiB,4488974336,rss_mb=5214
2026-08-12T15:41:34Z,2026-08-12T14:55:59.872999595Z,3.716GiB / 19.53GiB,5128380416,rss_mb=5214
2026-08-12T15:41:45Z,2026-08-12T14:55:59.872999595Z,4.567GiB / 19.53GiB,6042419200,rss_mb=5214
2026-08-12T15:43:04Z,2026-08-12T14:55:59.872999595Z,3.549GiB / 19.53GiB,4954140672,rss_mb=5214

Bottom line

  • The reranker cap makes every path survivable at 40K-node scale: consolidation ~1.7GiB, refresh ~5.1GB peak with per-turn release, zero kills across C + D + 12 serial refreshes.
  • We're keeping RERANKER_MAX_CANDIDATES=32 in production until your FlashRank batching ships — it's a diagnostic-quality tradeoff we're willing to carry; the batching fix is the permanent answer.
  • rss_mb remains high-water-mark only (your rename + current-RSS field will fix telemetry for the next round).

This thread moved the diagnosis from "single refresh OOM" to "unbatched rerank pass on the shared recall path" — thanks for the back-and-forth that got us there.

paulsto avatar Aug 12 '26 15:08 paulsto

Fixed and merged — #3441 (3e1b4611c). Thanks for four rounds of controlled testing; this would not have been found from our side.

What it was

FlashRank scored the entire candidate pool in a single ONNX forward pass. That pass allocates attention tensors sized batch × heads × seq², so at the default RERANKER_MAX_CANDIDATES=300 with max_length=512 one layer's attention-score tensor alone is ~3.8GB, and softmax holds another of the same shape. The provider runs on a 4-thread pool, so several can overlap.

The local (32) and tei (128) providers already batched. FlashRank was the only path left unbounded, and it had no batch-size setting at all — plus two prior band-aids around the symptom (cpu_mem_arena=False, release_local_inference_memory) that never bounded the batch.

That is why every one of your observations held: the burst was one inference call (explosive, transient, freed on return), it sat in the retrieval step with LLM phases flat, and it scaled with the candidate pool the retrieval arms return — a function of bank size — rather than with the work requested. Hence a consolidation at total_unconsolidated=1 still paying the full allocation.

The fix

FlashRankCrossEncoder now splits each query group into batch_size chunks. Scores are unchanged — passages are scored independently, so only the allocation profile moves.

New HINDSIGHT_API_RERANKER_FLASHRANK_BATCH_SIZE, default 32, also settable per failover-chain member. Non-positive values clamp to 1 so a misconfiguration can't restore the unbounded pass.

One correction, and it's in your favour

From your Test C writeup:

typical candidate pools for our queries appear to sit well under the 300 ceiling (the recall logs show ~25–32 facts returned), so the cap mainly neutralises the worst case

Those 25–32 are post-rerank, post-token-budget results. The cap truncates merged_candidates — the RRF-fused pool from all four retrieval arms — before the cross-encoder ever sees it. The two numbers aren't related.

Your own data settles it: had the pool really been ≤32, setting the cap to 32 would have been a no-op. Instead it moved peak memory 5× and recall latency 6×. The pool was at or near 300 on those recalls.

So RERANKER_MAX_CANDIDATES=32 is costing you real recall quality, and it isn't buying you anything once you're on the fix. Restore it to the default after upgrading — you get the memory ceiling and the candidate depth.

Also worth flagging on its own: the unbatched pass was a ~6× latency tax on every recall (your 60.8s → 10.0s). Nobody was looking for that, and it applies to every flashrank deployment, not just large banks.

The rss_mb catch

Shipped in the same PR. You were right that it was ru_maxrss. It now reports current RSS from /proc/self/statm, with the high-water mark alongside as peak_rss_mb; platforms without /proc report peak_rss_mb alone rather than passing the peak off as current. The Prometheus gauge was already labelled rss_max and is unchanged.

That mislabel cost us a full round of this investigation — we read a released burst as retained heap. Good catch.

Three things we owe you separately

Filing these as their own issues; none of them are the OOM:

  1. retrieve_all_fact_types_parallel imports temporal_extraction inside the hot path — a module import on the event loop, once per boot. Your traceback, your diagnosis; moving it to module scope.

  2. The interval knobs don't mean what they look like they mean — and there's a knob you needed that we never pointed you at. CONSOLIDATION_RECONCILE_INTERVAL_SECONDS=0 and MENTAL_MODEL_REFRESH_TICK_SECONDS=0 correctly disable those sweeps, but the sweeps only enqueue work. The worker poller is independent and keeps claiming whatever is already pending — which is why your "isolated" runs weren't isolated. To actually quiesce execution the knob is HINDSIGHT_API_WORKER_ENABLED=false. It exists today and is documented 150 lines away from the interval knobs with nothing linking them. Separately, RETAIN_BATCH_POLL_INTERVAL_SECONDS is not a worker knob at all — it's the poll interval against the LLM provider's Batch API, and at 0 it hot-spins that endpoint. Docs fix plus a floor on the sleep.

  3. Refresh operations are re-claimed on every boot, so an OOM mid-refresh becomes a self-sustaining crash loop that only manual SQL breaks. Your RC 3→7 observation.

Closing this one as the memory bug is fixed. If your next production window still shows bursts on recall_async with the default candidate cap restored, reopen and we'll go again — but the evidence says it won't.

nicoloboschi avatar Aug 13 '26 07:08 nicoloboschi