Skip to content

fix: use memory_type_label instead of undefined memory_type (NameError)#2

Open
Exploreunive wants to merge 5 commits intomainfrom
fix/search-api-support-multiple-memory-types
Open

fix: use memory_type_label instead of undefined memory_type (NameError)#2
Exploreunive wants to merge 5 commits intomainfrom
fix/search-api-support-multiple-memory-types

Conversation

@Exploreunive
Copy link
Owner

@Exploreunive Exploreunive commented Mar 20, 2026

Problem

src/agentic_layer/memory_manager.pymemory_type_label 已定义但错误引用为 memory_type(未定义),共 8 处,运行时会抛 NameError

受影响方法

方法 行号 问题
_to_response 817, 820 Metadata 构造用了 memory_type 而非 memory_type_label
retrieve_mem_agentic 910, 944, 997, 1009 record_retrieve_request() 调用
retrieve_mem_agentic 920, 991 _rerank() 位置参数

Root Cause

memory_type_labelreq.memory_types 拼接而成(如 "episodic,semantic"),但代码引用了不存在的 memory_type 变量。

Fix

将 8 处 memory_type 替换为 memory_type_label

…ing the first one

Previously, the search API silently ignored all memory_types except the first one.
Now all specified memory_types are searched and results are merged.

This fixes the issue where passing memory_types=episodic_memory,foresight
would only search episodic_memory and silently ignore foresight.

Fixes EverMind-AI#78
…sponse and retrieve_mem_agentic

The local variable 'memory_type_label' is defined but was incorrectly
referenced as 'memory_type' in 8 places across two methods:

- _to_response: lines 817, 820 (Metadata construction)
- retrieve_mem_agentic: lines 910, 920, 944, 991, 997, 1009
  (record_retrieve_request calls and _rerank positional args)

Using undefined 'memory_type' would cause NameError at runtime
when these code paths are executed.
@Exploreunive Exploreunive changed the title Fix/search api support multiple memory types fix: use memory_type_label instead of undefined memory_type (NameError) Mar 20, 2026
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