{"record":{"id":"5eefa1fb4b3d5afd","repo":"run-llama/llama_index","slug":"unexpected-kwargs-kwargs-5eefa1","errorCode":null,"errorMessage":"Unexpected kwargs: {kwargs}","messagePattern":"Unexpected kwargs: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/memory/simple_composable_memory.py","lineNumber":53,"sourceCode":"    secondary_memory_sources: List[SerializeAsAny[BaseMemory]] = Field(\n        default_factory=list, description=\"Secondary memory sources.\"\n    )\n\n    @classmethod\n    def class_name(cls) -> str:\n        \"\"\"Class name.\"\"\"\n        return \"SimpleComposableMemory\"\n\n    @classmethod\n    def from_defaults(\n        cls,\n        primary_memory: Optional[BaseMemory] = None,\n        secondary_memory_sources: Optional[List[BaseMemory]] = None,\n        **kwargs: Any,\n    ) -> \"SimpleComposableMemory\":\n        \"\"\"Create a simple composable memory from an LLM.\"\"\"\n        if kwargs:\n            raise ValueError(f\"Unexpected kwargs: {kwargs}\")\n\n        primary_memory = primary_memory or ChatMemoryBuffer.from_defaults()\n        secondary_memory_sources = secondary_memory_sources or []\n\n        return cls(\n            primary_memory=primary_memory,\n            secondary_memory_sources=secondary_memory_sources,\n        )\n\n    def _format_secondary_messages(\n        self, secondary_chat_histories: List[List[ChatMessage]]\n    ) -> str:\n        \"\"\"Formats retrieved historical messages into a single string.\"\"\"\n        # TODO: use PromptTemplate for this\n        formatted_history = \"\\n\\n\" + DEFAULT_INTRO_HISTORY_MESSAGE + \"\\n\"\n        for ix, chat_history in enumerate(secondary_chat_histories):\n            formatted_history += (\n                f\"\\n=====Relevant messages from memory source {ix + 1}=====\\n\\n\"","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/memory/simple_composable_memory.py#L35-L71","documentation":"Error \"Unexpected kwargs: {kwargs}\" thrown in run-llama/llama_index.","triggerScenarios":"Thrown at llama-index-core/llama_index/core/memory/simple_composable_memory.py:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the unexpected keyword arguments from the constructor call.","Pass only supported arguments such as primary_memory and secondary_memory_sources."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}