Skip to content

fix(langgraph): summarize nested episodic search results - #1854

Open
March-7 wants to merge 1 commit into
MemMachine:mainfrom
March-7:codex/round96-langgraph-nested-summary
Open

March-7 wants to merge 1 commit into
MemMachine:mainfrom
March-7:codex/round96-langgraph-nested-summary

Conversation

@March-7

@March-7 March-7 commented Oct 22, 2026

Copy link
Copy Markdown

Purpose of the change

When a search returns episodic records in the current long-term/short-term response shape, the LangGraph tool preserves the records but can report No relevant memories found. in its summary. Read those nested episodes so the summary includes their count and content previews.

Description

The formatter now reads long_term_memory.episodes followed by short_term_memory.episodes. Legacy flat-dictionary/list inputs, the three-preview limit, semantic summaries, empty results, error handling, and the returned results payload are preserved.

This is a client-only change. It does not alter retrieval, storage, response schemas, deduplication, or summary-only episode_summary behavior.

Fixes/Closes

Fixes #1852

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Python 3.12.13, using the current client/common source and real shared DTOs:

  • The same regression tests fail on the base with 4 failures / 7 passes, then pass 11/11 with this change. They include real public-factory/client HTTP calls to an ephemeral loopback fixture, fixed expected summaries, payload-preservation checks, and legacy inputs.
  • All 34 LangGraph tests pass, including the original 26.
  • All 267 selected client tests pass. The live-server integration module was excluded; its collection-time health requests and server tests were not run.
  • Scoped Ruff lint/format at the repository's exact 0.16.8 pin, ty (0.0.84), and git diff --check pass.

Client test command from the repository root, in the Python environment:

PYTHONPATH=packages/client/src:packages/common/src python -m pytest -o addopts= packages/client/client_tests --ignore=packages/client/client_tests/test_integration_complete.py -m 'not integration' -q

No live MemMachine retrieval server, database, embedding model, or model-quality evaluation was used. The loopback fixture validates the current request/response contract and SDK transformation.

Checklist

  • I have signed the commit(s) within this pull request
  • I have performed a self-review of my own code
  • I have added unit tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Further comments

Prepared with AI assistance. A characterization test records that responses containing only episode_summary and no episodes retain their existing behavior; this fix addresses episode previews without expanding that scope.

Fixes MemMachine#1852

Signed-off-by: Kexin Chen <155554077+March-7@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

[Bug]: LangGraph memory search summary reports no memories for nonempty episodic results

1 participant