Download code_release/code/vendor/patches/MIRIX.patch from clinical-agent-memory-bench/meme-bench: direct link, hf CLI and curl.
- Browser
- Download file 4.31 kB
-
https://huggingface.co/spaces/clinical-agent-memory-bench/meme-bench/resolve/main/code_release/code/vendor/patches/MIRIX.patch
- Command line
-
hf download hf://spaces/clinical-agent-memory-bench/meme-bench/code_release/code/vendor/patches/MIRIX.patch
-
curl -L -o MIRIX.patch https://huggingface.co/spaces/clinical-agent-memory-bench/meme-bench/resolve/main/code_release/code/vendor/patches/MIRIX.patch
4.31 kB
| --- a/MIRIX/mirix/functions/function_sets/base.py | |
| +++ b/MIRIX/mirix/functions/function_sets/base.py | |
| +# Modified. | |
| from typing import Optional | |
| from mirix.agent import Agent, AgentState | |
| Returns: | |
| str: Query result string | |
| """ | |
| + from mirix.constants import MAX_RETRIEVAL_LIMIT_IN_SYSTEM | |
| if not self.user: | |
| raise ValueError("Can not search in memory. User is not set") | |
| embedded_text=embedded_text_padded if search_method == "embedding" and query else None, | |
| search_field=search_field if search_field != "null" else "summary", | |
| search_method=search_method, | |
| - limit=10, | |
| + limit=MAX_RETRIEVAL_LIMIT_IN_SYSTEM, | |
| timezone_str=timezone_str, | |
| ) | |
| formatted_results_from_episodic = [ | |
| search_field if search_field != "null" else ("summary" if search_method == "embedding" else "content") | |
| ), | |
| search_method=search_method, | |
| - limit=10, | |
| + limit=MAX_RETRIEVAL_LIMIT_IN_SYSTEM, | |
| timezone_str=timezone_str, | |
| ) | |
| formatted_results_resource = [ | |
| embedded_text=embedded_text if search_method == "embedding" and query else None, | |
| search_field=search_field if search_field != "null" else "summary", | |
| search_method=search_method, | |
| - limit=10, | |
| + limit=MAX_RETRIEVAL_LIMIT_IN_SYSTEM, | |
| timezone_str=timezone_str, | |
| ) | |
| formatted_results_procedural = [ | |
| embedded_text=embedded_text if search_method == "embedding" and query else None, | |
| search_field=search_field if search_field != "null" else "caption", | |
| search_method=search_method, | |
| - limit=10, | |
| + limit=MAX_RETRIEVAL_LIMIT_IN_SYSTEM, | |
| timezone_str=timezone_str, | |
| ) | |
| formatted_results_knowledge_vault = [ | |
| embedded_text=embedded_text if search_method == "embedding" and query else None, | |
| search_field=search_field if search_field != "null" else "summary", | |
| search_method=search_method, | |
| - limit=10, | |
| + limit=MAX_RETRIEVAL_LIMIT_IN_SYSTEM, | |
| timezone_str=timezone_str, | |
| ) | |
| # title, summary, details, source | |
| --- a/MIRIX/mirix/services/agent_manager.py | |
| +++ b/MIRIX/mirix/services/agent_manager.py | |
| +# Modified. | |
| import os | |
| from datetime import datetime | |
| from typing import Dict, List, Optional | |
| actor: The Client performing the operation. | |
| user_id: The user whose messages to trim. If None, trims all non-system messages. | |
| """ | |
| - message_ids = await self.get_agent_by_id(agent_id=agent_id, actor=actor).message_ids | |
| + message_ids = (await self.get_agent_by_id(agent_id=agent_id, actor=actor)).message_ids | |
| system_message_id = message_ids[0] | |
| message_ids = message_ids[1:] | |
| actor: The Client performing the operation. | |
| user_id: The user whose messages to remove. If None, removes all non-system messages. | |
| """ | |
| - message_ids = await self.get_agent_by_id(agent_id=agent_id, actor=actor).message_ids | |
| + message_ids = (await self.get_agent_by_id(agent_id=agent_id, actor=actor)).message_ids | |
| system_message_id = message_ids[0] # 0 is system message | |
| # Keep system message and only filter out messages belonging to the specified user | |
| actor: PydanticClient, | |
| user_id: Optional[str] = None, | |
| ) -> PydanticAgentState: | |
| - message_ids = await self.get_agent_by_id(agent_id=agent_id, actor=actor).message_ids | |
| + message_ids = (await self.get_agent_by_id(agent_id=agent_id, actor=actor)).message_ids | |
| new_messages = await self.message_manager.create_many_messages(messages, actor=actor, user_id=user_id) | |
| message_ids = [message_ids[0]] + [m.id for m in new_messages] + message_ids[1:] | |
| return await self.set_in_context_messages(agent_id=agent_id, message_ids=message_ids, actor=actor) | |