MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / __init__

Method __init__

methods/mirix_agent.py:43–124  ·  view source on GitHub ↗
(
        self,
        model: str = "gpt-4o-mini",
        temperature: float = 1.0,
        max_tokens: int = 2000,
        provider: str = "openai",
        api_key: Optional[str] = None,
        base_url: Optional[str] = None,
        # Embedding config
        embedding_model: str = "text-embedding-3-small",
        embedding_provider: str = "openai",
        embedding_model_path: Optional[str] = None,
        embedding_dim: int = 1536,
        embedding_device: Optional[str] = None,  # For local embedding: "cuda", "cpu", "mps"
        # Memory retrieval config
        retrieve_num: int = 5,  # Number of memories to retrieve per memory type
        # Chunking config
        memorize_chunk_tokens: int = 2500,
        memorize_chunk_overlap_tokens: int = 200,
        query_memory_item_tokens: int = 300,
        query_memory_context_tokens: int = 1800,
        # Context limits
        max_input_tokens: int = 8000,
        max_question_tokens: int = 4096,
        max_context_tokens: int = 120000,
        # Query mode
        use_native_query: bool = True,  # Use MIRIX native send_message for query
        **kwargs
    )

Source from the content-addressed store, hash-verified

41 METHOD_TYPE = "agentic_memory"
42
43 def __init__(
44 self,
45 model: str = "gpt-4o-mini",
46 temperature: float = 1.0,
47 max_tokens: int = 2000,
48 provider: str = "openai",
49 api_key: Optional[str] = None,
50 base_url: Optional[str] = None,
51 # Embedding config
52 embedding_model: str = "text-embedding-3-small",
53 embedding_provider: str = "openai",
54 embedding_model_path: Optional[str] = None,
55 embedding_dim: int = 1536,
56 embedding_device: Optional[str] = None, # For local embedding: "cuda", "cpu", "mps"
57 # Memory retrieval config
58 retrieve_num: int = 5, # Number of memories to retrieve per memory type
59 # Chunking config
60 memorize_chunk_tokens: int = 2500,
61 memorize_chunk_overlap_tokens: int = 200,
62 # Context limits
63 max_input_tokens: int = 8000,
64 max_question_tokens: int = 4096,
65 max_context_tokens: int = 120000,
66 **kwargs
67 ):
68 super().__init__(model, temperature, max_tokens, **kwargs)
69
70 # Store config
71 self._provider = provider
72 self._api_key = api_key or os.environ.get("OPENAI_API_KEY", "")
73 self._base_url = base_url or os.environ.get("OPENAI_BASE_URL", "https://api.openai.com/v1")
74
75 # Embedding config
76 self.embedding_model = embedding_model
77 self.embedding_provider = embedding_provider
78 self.embedding_model_path = embedding_model_path
79 self.embedding_dim = embedding_dim
80 self.embedding_device = embedding_device
81
82 # Memory config
83 self.retrieve_num = retrieve_num
84
85 # Chunking config
86 self.memorize_chunk_tokens = memorize_chunk_tokens
87 self.memorize_chunk_overlap_tokens = memorize_chunk_overlap_tokens
88
89 # Limits
90 self.max_input_tokens = max_input_tokens
91 self.max_question_tokens = max_question_tokens
92 self.max_context_tokens = max_context_tokens
93
94 # LLM client for fallback Q&A (uses utils/llm_client for token tracking)
95 self._llm_client: BaseLLMClient = create_llm_client(
96 provider=provider,
97 model=model,
98 temperature=temperature,
99 max_tokens=max_tokens,
100 api_key=api_key,

Callers

nothing calls this directly

Calls 3

_init_mirixMethod · 0.95
create_llm_clientFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected