Skip to content

fix(serve): HTTP ingest visibility + start embed daemon - #44

Open
eSlider wants to merge 1 commit into
mainfrom
fix/http-ingest-embed-daemon
Open

fix(serve): HTTP ingest visibility + start embed daemon#44
eSlider wants to merge 1 commit into
mainfrom
fix/http-ingest-embed-daemon

Conversation

@eSlider

@eSlider eSlider commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Deployment benchmark found + fixed two real bugs (see commit).\n\n1. HTTP /ingest invisible without restart: Ladybug WAL snapshots the serve read connection; ingested leafs stayed hidden from /search, /get, /stats. Fixed by closing the writable conn then reopening the serve read conn (refreshBrain).\n2. ~12s search latency: embedQuery polls for an embed daemon on :17830 that the api image never started — every query spawned a doomed subprocess + 10s poll, then a per-query model load. Fixed by starting brain-search serve in the entrypoint. Latency 12.4s → ~25ms.\n\nVerified on clean DB: ingest facts visible immediately (no restart), /get + /search return them, recall@5 = 1.0.

Deployment benchmark (Phase 5 verify) surfaced two real bugs:

1. HTTP /ingest wrote facts through its own connection, but Ladybug WAL
   snapshots the serve read connection at first query — ingested leafs were
   invisible to /search, /get and /stats until the process restarted.
   Fix: close the writable connection (commit), then reopen the serve read
   connection (refreshBrain).

2. embedQuery tries a search daemon on KBSEARCH_PORT (17830) that was never
   started in the api image. Every query spawned a doomed subprocess and
   polled 10s before falling back to a per-query model load: ~12s per search.
   Fix: docker-entrypoint serve starts /usr/local/bin/brain-search serve
   <port> in the background before exec brain-serve. Search latency drops
   12.4s -> ~25ms.

Verified on a clean DB: ingest facts D/E visible immediately (stats facts:2
without restart), /get + /search return them, recall@5 = 1.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant