{"record":{"id":"90af93c1988f3a3b","repo":"OpenBMB/ChatDev","slug":"simplememory-requires-a-simple-memory-store-config","errorCode":null,"errorMessage":"SimpleMemory requires a simple memory store configuration","messagePattern":"SimpleMemory requires a simple memory store configuration","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"runtime/node/agent/memory/simple_memory.py","lineNumber":26,"sourceCode":"\nfrom entity.configs import MemoryStoreConfig\nfrom entity.configs.node.memory import SimpleMemoryConfig\nfrom runtime.node.agent.memory.memory_base import (\n    MemoryBase,\n    MemoryContentSnapshot,\n    MemoryItem,\n    MemoryWritePayload,\n)\nimport faiss\nimport numpy as np\n\nlogger = logging.getLogger(__name__)\n\nclass SimpleMemory(MemoryBase):\n    def __init__(self, store: MemoryStoreConfig):\n        config = store.as_config(SimpleMemoryConfig)\n        if not config:\n            raise ValueError(\"SimpleMemory requires a simple memory store configuration\")\n        super().__init__(store)\n        self.config = config\n        # Optimized prompt templates for clarity\n        self.retrieve_prompt = \"Query: {input}\"\n        self.update_prompt = \"Input: {input}\\nOutput: {output}\"\n        self.memory_path = self.config.memory_path  # auto\n        \n        # Content extraction configuration\n        self.max_content_length = 500  # Maximum content length\n        self.min_content_length = 20   # Minimum content length\n        \n    def _extract_key_content(self, content: str) -> str:\n        \"\"\"Extract key content while stripping redundant text.\"\"\"\n        # Remove redundant whitespace\n        content = re.sub(r'\\s+', ' ', content.strip())\n        \n        # Skip heavy processing for short snippets\n        if len(content) <= 100:","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/agent/memory/simple_memory.py#L8-L44","documentation":"SimpleMemory requires the store config to include a SimpleMemoryConfig section. A None result from store.as_config(SimpleMemoryConfig) means the MemoryStoreConfig is for another backend type.","triggerScenarios":"Constructing SimpleMemory with a store whose type is not 'simple' (e.g. 'blackboard' or 'file'); usually a mismatch between the config type string and the class being built.","commonSituations":"YAML memory.type typos; reusing configs across templates; direct instantiation instead of create_memory dispatch.","solutions":["Set the memory store type to 'simple' in the config","Use create_memory(store) so the class follows the config type","Check for typos/case in the type field"],"exampleFix":"# before\nstore = MemoryStoreConfig(type='file', ...)\nmem = SimpleMemory(store)\n\n# after\nstore = MemoryStoreConfig(type='simple', ...)\nmem = SimpleMemory(store)","handlingStrategy":"validation","validationCode":"cfg = store.as_config(SimpleMemoryConfig)\nif cfg is None:\n    raise ConfigError('store type must be simple for SimpleMemory')\nmem = SimpleMemory(store)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use create_memory for dispatch","Match memory.type to the target class"],"tags":["memory","configuration","type-mismatch"],"backgroundTag":"config-type-mismatch","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}