Skip to content

[codex] Fix vNext keyword memory retrieval#219

Merged
samrusani merged 1 commit into
mainfrom
codex/vnext-memory-keyword-retrieval
May 15, 2026
Merged

[codex] Fix vNext keyword memory retrieval#219
samrusani merged 1 commit into
mainfrom
codex/vnext-memory-keyword-retrieval

Conversation

@samrusani
Copy link
Copy Markdown
Owner

Summary

This fixes the vNext context-pack retrieval path for committed memories that match the user query by keywords but not as one contiguous phrase. The Postgres store now searches memories and sources with an exact phrase first, then keyword fallback patterns, while preserving the existing domain and sensitivity filters.

Root Cause

search_memories() and search_sources() previously built a single ILIKE %query% predicate. Agent queries such as agent-first /vnext audit correction cockpit could exclude the intended memory before the Python ranker saw it, even though the memory had strong token overlap and domain=unknown was allowed by policy.

Validation

  • ./.venv/bin/pytest tests/unit/test_vnext_store.py tests/integration/test_vnext_agentic_memory_commit_api.py -q
  • ./.venv/bin/python -m py_compile apps/api/src/alicebot_api/vnext_store.py
  • git diff --check
  • Manual CLI context-pack check selected memory 138a27e2-4eec-48e7-b71d-ca10ef57caae with no retrieval warnings.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@samrusani samrusani merged commit c2fa8e0 into main May 15, 2026
5 checks passed
@samrusani samrusani deleted the codex/vnext-memory-keyword-retrieval branch May 15, 2026 19:09
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