Skip to content

feat: add opt-in Jev memory reranking - #704

Open
Koimiao-zz wants to merge 3 commits into
NevaMind-AI:mainfrom
Koimiao-zz:codex/jev-memory-reranker
Open

Koimiao-zz wants to merge 3 commits into
NevaMind-AI:mainfrom
Koimiao-zz:codex/jev-memory-reranker

Conversation

@Koimiao-zz

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in JevRerankedMemoryBackend that wraps the existing agentic memory backend without changing MemoryService or storage contracts
  • call the real TypeSafe Python SDK and /v1/systemone with typed Noul questions to rerank retrieved memory candidates
  • preserve vector scores, scope filtering, result shapes, cancellation behavior, and the existing default path
  • enable only through MEMU_RETRIEVAL_RERANKER=jev; without that flag, current behavior is unchanged
  • add fallback/strict error policies, SDK contract coverage, live integration coverage, benchmark tooling, README guidance, and ADR 0019

Why this shape

The integration sits outside the current composition root and wraps AgenticMemoryBackend, so it does not add an LLM/chat call to MemoryService, does not change any repository protocol, and requires no inmemory/sqlite/postgres migration. Scope filtering and candidate generation happen in memU before Jev receives candidates.

Validation

  • full suite: 697 passed, 9 skipped
  • official SDK contract target: 24 passed, 1 deselected
  • live Jev integration: 1 passed; real POST https://api.typesafe.ai/v1/systemone returned 200 OK
  • live benchmark, jev-1.13.0, 10 measured runs after 2 warmups, 5 candidates:
    • base memU retrieval: median 0.41 ms, p95 0.57 ms
    • Jev provider: median 485.00 ms, p95 566.80 ms
    • end-to-end: median 485.08 ms, p95 567.03 ms
  • ruff check .
  • ruff format --check .
  • mypy: Success: no issues found in 168 source files
  • deptry src
  • uv lock --locked
  • full pre-commit suite

Notes

The live test remains credential-gated with MEMU_RUN_LIVE_JEV=1 plus TYPESAFE_API_KEY, so normal CI does not require a TypeSafe account. API credentials are never committed.

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.

2 participants