{"record":{"id":"9706709af1c706fb","repo":"run-llama/llama_index","slug":"system-prompt-is-not-supported-for-condensequestio","errorCode":null,"errorMessage":"system_prompt is not supported for CondenseQuestionChatEngine.","messagePattern":"system_prompt is not supported for CondenseQuestionChatEngine\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/chat_engine/condense_question.py","lineNumber":100,"sourceCode":"        memory_cls: Type[BaseMemory] = Memory,\n        verbose: bool = False,\n        system_prompt: Optional[str] = None,\n        prefix_messages: Optional[List[ChatMessage]] = None,\n        llm: Optional[LLM] = None,\n        **kwargs: Any,\n    ) -> \"CondenseQuestionChatEngine\":\n        \"\"\"Initialize a CondenseQuestionChatEngine from default parameters.\"\"\"\n        condense_question_prompt = condense_question_prompt or DEFAULT_PROMPT\n\n        llm = llm or Settings.llm\n\n        chat_history = chat_history or []\n        memory = memory or memory_cls.from_defaults(\n            chat_history=chat_history, token_limit=llm.metadata.context_window - 256\n        )\n\n        if system_prompt is not None:\n            raise NotImplementedError(\n                \"system_prompt is not supported for CondenseQuestionChatEngine.\"\n            )\n        if prefix_messages is not None:\n            raise NotImplementedError(\n                \"prefix_messages is not supported for CondenseQuestionChatEngine.\"\n            )\n\n        return cls(\n            query_engine,\n            condense_question_prompt,\n            memory,\n            llm,\n            verbose=verbose,\n            callback_manager=Settings.callback_manager,\n        )\n\n    def _condense_question(\n        self, chat_history: List[ChatMessage], last_message: str","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/chat_engine/condense_question.py#L82-L118","documentation":"CondenseQuestionChatEngine.from_defaults() raises NotImplementedError when system_prompt is passed. This engine works by rewriting the chat history into a standalone question and delegating to a query_engine; it has no code path that injects a persistent system message, so the argument is explicitly rejected instead of silently ignored.","triggerScenarios":"CondenseQuestionChatEngine.from_defaults(query_engine=qe, system_prompt='You are...') — the check `if system_prompt is not None` fires before construction. Also hit when copying a SimpleChatEngine/ContextChatEngine example that used system_prompt and swapping the engine class.","commonSituations":"Migrating chat engine types while keeping the same kwargs; wanting persona control and assuming all chat engines accept system_prompt; UI config that passes system_prompt to whatever engine is selected.","solutions":["Bake instructions into the condense_question_prompt (the prompt used to rewrite the standalone question)","Switch to ContextChatEngine (supports system_prompt) or SimpleChatEngine if a persistent system message is required","Use CondensePlusContextChatEngine, which supports a system_prompt together with condensing","Remove system_prompt if it was passed through a shared config by mistake"],"exampleFix":"# before\nengine = CondenseQuestionChatEngine.from_defaults(\n    query_engine=qe, system_prompt='You are a pirate.'\n)  # NotImplementedError\n\n# after\nfrom llama_index.core.chat_engine import CondensePlusContextChatEngine\nengine = CondensePlusContextChatEngine.from_defaults(\n    query_engine=qe, system_prompt='You are a pirate.'\n)","handlingStrategy":"validation","validationCode":"if engine_cls is CondenseQuestionChatEngine:\n    assert system_prompt is None, 'CondenseQuestionChatEngine does not accept system_prompt; use CondensePlusContextChatEngine'","typeGuard":null,"tryCatchPattern":"try:\n    engine = CondenseQuestionChatEngine.from_defaults(query_engine=qe, **kwargs)\nexcept NotImplementedError as e:\n    raise ConfigError(str(e)) from e","preventionTips":["Keep per-engine kwargs dictionaries instead of one shared dict","Check the from_defaults signature of the specific engine class you build","Prefer CondensePlusContextChatEngine when persona prompts are required"],"tags":["llama-index","chat-engine","unsupported-argument","condense-question"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}