diff --git a/README.md b/README.md index dfba8c84..f6a4e67e 100644 --- a/README.md +++ b/README.md @@ -300,15 +300,14 @@ async def main(): result = await reme.summarize_memory( messages=messages, user_name="alice", # Personal memory - task_name="code_writing", # Task memory + # task_name="code_writing", # Task memory ) print(f"Summarize result: {result}") # 2. Retrieve relevant memory memories = await reme.retrieve_memory( query="Python programming", - user_name="alice", - task_name="code_writing", + # user_name="alice", ) print(f"Retrieve result: {memories}") @@ -316,7 +315,6 @@ async def main(): memory_node = await reme.add_memory( memory_content="User prefers concise code style", user_name="alice", - when_to_use="When writing code for the user", ) print(f"Added memory: {memory_node}") memory_id = memory_node.memory_id @@ -330,7 +328,6 @@ async def main(): memory_id=memory_id, user_name="alice", memory_content="User prefers concise, well-commented code style", - when_to_use="When writing or reviewing code for the user", ) print(f"Updated memory: {updated_memory}") diff --git a/README_ZH.md b/README_ZH.md index d78c7474..2dbf02f3 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -291,7 +291,7 @@ async def main(): result = await reme.summarize_memory( messages=messages, user_name="alice", # 个人记忆 - task_name="code_writing", # 任务记忆 + # task_name="code_writing", # 任务记忆 ) print(f"总结结果: {result}") @@ -299,7 +299,7 @@ async def main(): memories = await reme.retrieve_memory( query="Python 编程", user_name="alice", - task_name="code_writing", + # task_name="code_writing", ) print(f"检索结果: {memories}") @@ -307,7 +307,6 @@ async def main(): memory_node = await reme.add_memory( memory_content="用户喜欢简洁的代码风格", user_name="alice", - when_to_use="当为用户编写代码时", ) print(f"添加的记忆: {memory_node}") memory_id = memory_node.memory_id @@ -321,7 +320,6 @@ async def main(): memory_id=memory_id, user_name="alice", memory_content="用户喜欢简洁且带注释的代码风格", - when_to_use="当为用户编写或审查代码时", ) print(f"更新后的记忆: {updated_memory}") diff --git a/benchmark/halumem/eval_reme.py b/benchmark/halumem/eval_reme.py index 685f8249..14c0cb64 100644 --- a/benchmark/halumem/eval_reme.py +++ b/benchmark/halumem/eval_reme.py @@ -191,7 +191,7 @@ async def answer_question_with_memories( question: str, memories: str, user_id: str = None, - model_name: str = "qwen3-30b-a3b-instruct-2507", + eval_model_name: str = "qwen3-30b-a3b-instruct-2507", ): """ Answer a question using retrieved memories with PROMPT_MEMZERO_JSON template. @@ -201,7 +201,7 @@ async def answer_question_with_memories( question: The question to answer memories: The retrieved memories (formatted as context) user_id: Optional user ID for context formatting - model_name: Model name to use for LLM request + eval_model_name: Model name to use for LLM request Returns: dict with 'reasoning' and 'answer' fields @@ -223,7 +223,7 @@ async def answer_question_with_memories( question=question, ) - result = await reme.get_llm(model_name).simple_request_for_json( + result = await reme.get_llm(eval_model_name).simple_request_for_json( prompt=prompt, model_name=None, ) @@ -236,6 +236,7 @@ async def evaluation_for_memory_accuracy( dialogue: str, golden_memories: list[dict], candidate_memory: dict, + eval_model_name: str = "qwen-flash", ): """ Memory Accuracy Evaluation - Check if an extracted memory is accurate. @@ -245,7 +246,7 @@ async def evaluation_for_memory_accuracy( dialogue: The formatted dialogue string golden_memories: List of golden memory points from the session candidate_memory: The extracted memory to evaluate - model_name: Model name to use for LLM request + eval_model_name: Model name to use for LLM request Returns: dict with 'accuracy_score' (0/1/2), 'is_included_in_golden_memories' (true/false), and 'reason' @@ -265,7 +266,7 @@ async def evaluation_for_memory_accuracy( candidate_memory=candidate_content, ) - result = await reme.get_llm("qwen-flash").simple_request_for_json( + result = await reme.get_llm(eval_model_name).simple_request_for_json( prompt=prompt, model_name=None, ) @@ -454,7 +455,7 @@ class MemoryProcessor: question=query, memories=memories, user_id=user_id, - model_name=self.eval_model_name, + eval_model_name=self.eval_model_name, ) # Add original memories to the result @@ -1420,8 +1421,7 @@ if __name__ == "__main__": parser.add_argument( "--data_path", type=str, - # required=True, - default="/Users/zhouwk/PycharmProjects/MemAgent/dataset/halumem/HaluMem-Medium.jsonl", + required=True, help="Path to HaluMem JSONL file", ) parser.add_argument( diff --git a/reme/__init__.py b/reme/__init__.py index 2621a539..d5304a7f 100644 --- a/reme/__init__.py +++ b/reme/__init__.py @@ -8,7 +8,7 @@ from .reme import ReMe from .reme_cli import ReMeCli from .reme_fb import ReMeFb -__version__ = "0.3.0.1" +__version__ = "0.3.0.2" __all__ = [ "config", diff --git a/reme/config/cli.yaml b/reme/config/cli.yaml index 35c9c2f6..7d348d45 100644 --- a/reme/config/cli.yaml +++ b/reme/config/cli.yaml @@ -21,6 +21,7 @@ embedding_models: model_name: text-embedding-v4 dimensions: 1024 enable_cache: true + use_dimensions: false file_stores: default: diff --git a/reme/core/embedding/base_embedding_model.py b/reme/core/embedding/base_embedding_model.py index 242734e5..36c6def7 100644 --- a/reme/core/embedding/base_embedding_model.py +++ b/reme/core/embedding/base_embedding_model.py @@ -30,7 +30,7 @@ class BaseEmbeddingModel(ABC): base_url: str | None = None, model_name: str = "", dimensions: int | None = 1024, - use_dimensions: bool = True, + use_dimensions: bool = False, max_batch_size: int = 10, max_retries: int = 3, raise_exception: bool = True,