Skip to content

fix(evaluation): construct LongTermMemory with the concrete declarative params - #1703

Merged
malatewang merged 2 commits into
mainfrom
fix/1476-explicit-ltm-backend
Sep 24, 2026
Merged

malatewang merged 2 commits into
mainfrom
fix/1476-explicit-ltm-backend

Conversation

@marvinyu-memverge

Copy link
Copy Markdown
Collaborator

Purpose of the change

The evaluation entry point crashes at startup: evaluation/utils/agent_utils.py calls LongTermMemoryParams(...) as a constructor, but since #1395 that name is an Annotated discriminated union of DeclarativeBackendParams | EventBackendParams, and calling it raises TypeError: 'types.UnionType' object is not callable on Python 3.12. This picks the backend explicitly, as #1476 proposes.

Description

  • init_memmachine_params builds DeclarativeBackendParams directly instead of the union alias. The keyword arguments are unchanged; that class is what the alias resolved to for the declarative backend, and it is what the server's own service_locator constructs.
  • The setup now refuses an event long-term memory configuration with a ValueError naming the selected backend, next to the existing "not configured" check. It reads vector_graph_store off the configuration, which only the declarative LongTermMemoryConf carries, so without the check an event configuration would fail later with an AttributeError.

No change to the server packages. The issue's alternative, making the alias callable via a dispatching factory, is not taken: the union is the intended shape after #1395 and the server never calls the alias.

Fixes/Closes

Fixes #1476

Type of change

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

How Has This Been Tested?

  • Manual verification
    • ruff check and ruff format --check on the changed file: clean.
    • In the server environment, LongTermMemoryParams(session_id="s") reproduces the reported TypeError; evaluation.utils.agent_utils imports and init_memmachine_params constructs DeclarativeBackendParams.
    • evaluation/ has no test suite and is outside the packages CI type-checks, so no unit test is added.

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have checked my code and corrected any misspellings

🤖 Generated with Claude Code

…ve params

Since #1395, `LongTermMemoryParams` is an `Annotated` discriminated union of
`DeclarativeBackendParams | EventBackendParams`, not a class. The evaluation
entry point still called it as a constructor, so `init_memmachine_params`
raised `TypeError: 'types.UnionType' object is not callable` at startup.

Build `DeclarativeBackendParams` directly, and refuse an `event` long-term
memory configuration up front with a clear error: the evaluation setup reads
`vector_graph_store` off the configuration, which only the declarative backend
carries.

Fixes #1476

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@edwinyyyu edwinyyyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's fine, but ideally it would support both.

@malatewang
malatewang merged commit 0e1882d into main Sep 24, 2026
52 checks passed
@malatewang
malatewang deleted the fix/1476-explicit-ltm-backend branch September 24, 2026 19:59
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.

[Feat]: Pick explicit LongTermMemory backend in evaluation setup

3 participants