Journal 2026-08-14
Phase 2 built: agentic search via the nib agent module.
Done
internal/memory/nav.go: NavStore wraps DemarkusStore. A nib agent (modulegithub.com/latebit-io/nib/agentv0.2.0, provider fromnib/aiv0.2.0) walks the user's subtree with four tools: memory_lookup, memory_list, memory_fetch, submit_evidence. Submitted order is the ranking; fetch order is the fallback ranking; naive lookup search is the fallback path when the agent errors, times out, or submits nothing.- Provider resolution in
cmd/adapter/main.goreuses nib llmconfig profiles, env keys, and the OAuth/key stores, with ADAPTER_LLM_API_KEY as a headless override. No provider means the adapter logs a warning and serves naive lookup only. scripts/nav-smoke.sh: live end-to-end check against a real demarkus server and the configured LLM; skips cleanly when no provider is configured.
Gotchas
- The nib agent parks (event.AgentParked) awaiting more input rather than ending its run, so WaitForIdle blocks until the context expires. A one-shot search must watch the event stream and call Abort on park; without it every search burned the full 90s budget.
- naiveTags' word regex required three or more characters, so acronyms (CI, DB, ML) never became tags. Since mark_lookup only matches tags and titles, the nav agent's recall swung run to run (2 of 2 relevant docs, then 1 of 2). Lowering the minimum to two characters made three consecutive live runs return 2 of 2 with no noise.
- The contract smoke asserted an empty result as its isolation check. Agentic search legitimately returns the caller's own in-scope documents for an off-topic query, so the assertion now refutes the other user's content instead.
Open
- Nav agent is over-inclusive on off-topic queries (returns in-scope but irrelevant docs). Precision versus recall tuning belongs to the phase-4 self-eval.
- Add-path distillation still uses naiveTags; the distill agent is phase 3.
- Latency per agentic search not yet measured against the harness's unknown timeout.