{"record":{"id":"aef05f986344a84e","repo":"lfnovo/open-notebook","slug":"ask-feature-requires-an-embedding-model-please-co","errorCode":null,"errorMessage":"Ask feature requires an embedding model. Please configure one in the Models section.","messagePattern":"Ask feature requires an embedding model\\. Please configure one in the Models section\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"api/routers/search.py","lineNumber":150,"sourceCode":"        if not strategy_model:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"Strategy model {ask_request.strategy_model} not found\",\n            )\n        if not answer_model:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"Answer model {ask_request.answer_model} not found\",\n            )\n        if not final_answer_model:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"Final answer model {ask_request.final_answer_model} not found\",\n            )\n\n        # Check if embedding model is available\n        if not await model_manager.get_embedding_model():\n            raise HTTPException(\n                status_code=400,\n                detail=\"Ask feature requires an embedding model. Please configure one in the Models section.\",\n            )\n\n        # For streaming response\n        return StreamingResponse(\n            stream_ask_response(\n                ask_request.question, strategy_model, answer_model, final_answer_model\n            ),\n            media_type=\"text/event-stream\",\n            headers={\n                \"Cache-Control\": \"no-cache\",\n                \"Connection\": \"keep-alive\",\n                \"X-Accel-Buffering\": \"no\",\n            },\n        )\n\n    except HTTPException:","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/lfnovo/open-notebook/blob/a7de90d38aaf18ee85fd661854d35c11e44613e2/api/routers/search.py#L132-L168","documentation":"400 from /api/search/ask: the ask pipeline requires embeddings for retrieval, and no default embedding model is configured. Even though chat models are set, the embedding model is a separate configuration.","triggerScenarios":"POST /api/search/ask (or /ask/simple) when model_manager.get_embedding_model() returns None.","commonSituations":"Fresh setup where only chat models were added, embedding model removed, or provider key invalid so the model never loaded.","solutions":["Configure a default embedding model in Settings → Models","Verify provider credentials are saved and the model shows as available","Retry the ask request after configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const hasEmbedding = models.some(m => m.type === 'embedding' && m.is_default);\nif (!hasEmbedding) promptModelSetup();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat embedding model as a required part of ask setup","Warn users on the ask UI when no embedding model exists"],"tags":["ask","embedding-model","configuration","http-400"],"backgroundTag":"missing-model-configuration","analyzedSha":"a7de90d38aaf18ee85fd661854d35c11e44613e2","analyzedAt":"2026-08-27T02:39:58.166Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}