Skip to content

feat(longmem): wire the Go MemPalace server into the LongMemEval harness#260

Merged
jphein merged 1 commit into
mainfrom
feat/longmem-goserver
Jul 4, 2026
Merged

feat(longmem): wire the Go MemPalace server into the LongMemEval harness#260
jphein merged 1 commit into
mainfrom
feat/longmem-goserver

Conversation

@jphein

@jphein jphein commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Adds a self-ingesting mempalace-server factory to cross_validate_longmemeval (per-question haystack, session-stem source ids, wipe-per-question — mirroring the reference benchmark's methodology) and fixes the adapter's Entity.id to carry the corpus/session id the session-level R@K scorer matches (drawer hash preserved in properties). Live 5q smoke: 80% R@5. Enables the retrieval-only (no-LLM) independent verification of the Go server's published 0.972.

🤖 Generated with Claude Code

- Factory self-ingests the per-question vault (hindsight pattern),
  source_file = session stem, per-question wipe via reset_before_ingest
- Adapter surfaces the corpus/session id as Entity.id (scorer contract:
  'their .id is the session_id'); server's content-hash drawer id moves
  to properties for provenance
- 5q retrieval smoke: 80% R@5 (4/5) — pipeline verified live

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jphein, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e6d74cc7-0979-4cc6-a270-e6d2b2ff8bd9

📥 Commits

Reviewing files that changed from the base of the PR and between 30d7fcd and ff1b95c.

📒 Files selected for processing (4)
  • scripts/cross_validate_longmemeval.py
  • sme/adapters/mempalace_server_adapter.py
  • sme/cli.py
  • tests/test_mempalace_server_adapter.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/longmem-goserver

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request integrates the mempalace-server adapter into the evaluation harness, enabling per-question isolation via a full wipe, and updates the adapter's query method to use the source file stem as the entity ID for correct retrieval scoring. The remaining changes primarily involve extensive code formatting across CLI, script, and test files. The review feedback suggests explicitly checking for the required API key environment variable to fail fast, using a platform-independent path parsing approach instead of pathlib.Path for extracting the filename stem, and avoiding runtime modifications to sys.path.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +389 to +394
adapter = MemPalaceServerAdapter(
api_url=_os.environ.get("MEMPALACE_SERVER_URL", "http://localhost:8000"),
api_key=_os.environ.get("MEMPALACE_SERVER_API_KEY", "local-dev-key-change-me"),
reset_before_ingest=True,
read_only=False,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When fetching credentials from environment variables, explicitly check for their presence and raise a RuntimeError if missing to ensure the application fails fast. This aligns with the repository's general rules.

Suggested change
adapter = MemPalaceServerAdapter(
api_url=_os.environ.get("MEMPALACE_SERVER_URL", "http://localhost:8000"),
api_key=_os.environ.get("MEMPALACE_SERVER_API_KEY", "local-dev-key-change-me"),
reset_before_ingest=True,
read_only=False,
)
api_key = _os.environ.get("MEMPALACE_SERVER_API_KEY")
if not api_key:
raise RuntimeError("MEMPALACE_SERVER_API_KEY environment variable is missing")
adapter = MemPalaceServerAdapter(
api_url=_os.environ.get("MEMPALACE_SERVER_URL", "http://localhost:8000"),
api_key=api_key,
reset_before_ingest=True,
read_only=False,
)
References
  1. When fetching credentials from environment variables, explicitly check for their presence and raise a RuntimeError if missing to ensure the application fails fast.

# server's own drawer id is a content hash and can never match,
# so surface the source stem as the entity id and keep the
# drawer hash in properties for provenance.
entity_id = Path(source_file).stem if source_file else drawer_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using platform-specific path parsing with pathlib.Path can lead to issues if the client and server run on different operating systems (e.g., Windows vs. Unix) and use different path separators. Extracting the filename stem in a platform-independent manner is more robust.

Suggested change
entity_id = Path(source_file).stem if source_file else drawer_id
entity_id = source_file.replace("\\\\", "/").split("/")[-1].rsplit(".", 1)[0] if source_file else drawer_id

Comment thread sme/cli.py
Comment on lines 2084 to 2086
_scripts_dir = str(Path(__file__).resolve().parent.parent / "scripts")
if _scripts_dir not in _sys.path:
_sys.path.insert(0, _scripts_dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Avoid runtime modifications to sys.path for project imports; rely on proper package installation (e.g., editable installs) or PYTHONPATH instead. This aligns with the repository's general rules.

Suggested change
_scripts_dir = str(Path(__file__).resolve().parent.parent / "scripts")
if _scripts_dir not in _sys.path:
_sys.path.insert(0, _scripts_dir)
# Avoid runtime modifications to sys.path; rely on proper package installation or PYTHONPATH instead.
References
  1. Avoid runtime modifications to sys.path for project imports; rely on proper package installation (e.g., editable installs) instead.

@jphein jphein merged commit 2ced067 into main Jul 4, 2026
4 checks passed
@jphein jphein deleted the feat/longmem-goserver branch July 4, 2026 15:36
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