{"record":{"id":"fde4d6fd23fbfbbc","repo":"Tencent/WeKnora","slug":"no-chat-model-available-for-memory-extraction-con","errorCode":null,"errorMessage":"no chat model available for memory extraction; configure one under workspace memory settings","messagePattern":"no chat model available for memory extraction; configure one under workspace memory settings","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/memory/extract.go","lineNumber":948,"sourceCode":"\n// callExtractionModel runs the single LLM call in the write path.\nfunc (s *Service) callExtractionModel(\n\tctx context.Context,\n\tcfg *types.MemoryConfig,\n\tpayload types.MemoryExtractPayload,\n\tsegment transcriptSegment,\n\texisting []*types.MemoryItem,\n\tforgotten []*types.MemoryTombstone,\n\tknownTopics []*types.MemoryTopicStat,\n) (extractionResponse, error) {\n\tmodelID := s.extractionModelID(ctx, cfg, payload)\n\tif modelID == \"\" {\n\t\t// Returning an error keeps the watermark where it is. Skipping here\n\t\t// silently consumed every message the run was given: distillation\n\t\t// reported success, advanced past them, and no model had ever seen\n\t\t// them — which is how a workspace on default settings ends up with an\n\t\t// enabled memory feature that has learned nothing.\n\t\treturn extractionResponse{}, fmt.Errorf(\n\t\t\t\"no chat model available for memory extraction; \" +\n\t\t\t\t\"configure one under workspace memory settings\")\n\t}\n\tchatModel, err := s.modelService.GetChatModel(ctx, modelID)\n\tif err != nil {\n\t\treturn extractionResponse{}, fmt.Errorf(\"get extraction model: %w\", err)\n\t}\n\n\tuserPrompt := buildExtractionPrompt(segment, existing, forgotten, knownTopics, cfg.ExtractInstructions)\n\n\tresponse, err := s.completeExtraction(ctx, chatModel, userPrompt, extractBudgetTokens)\n\tif err != nil {\n\t\treturn extractionResponse{}, err\n\t}\n\tif response == nil {\n\t\treturn extractionResponse{}, nil\n\t}\n","sourceCodeStart":930,"sourceCodeEnd":966,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/memory/extract.go#L930-L966","documentation":"Memory extraction runs call a chat model to distill statements from messages; when no model ID is configured for the workspace's memory settings, callExtractionModel refuses to run. Deliberately returns an error instead of silently skipping, so the watermark stays put and messages are re-read later instead of being consumed unprocessed.","triggerScenarios":"Background distillation Handle() runs for a workspace where modelID resolves to \"\" — i.e. no chat model configured under workspace memory settings.","commonSituations":"Fresh workspace using default settings with memory enabled but no model selected; admin removed the configured model; model service config not migrated after an upgrade.","solutions":["Configure a chat model in the workspace memory settings","Disable the memory feature for that workspace if extraction is not wanted","Verify modelService.GetChatModel resolution returns a valid configured model ID","After configuring, confirm the next distillation run advances the watermark"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// before enabling memory, ensure a chat model is configured\nmodelID := workspace.Settings.MemoryExtractionModelID\nif modelID == \"\" {\n\treturn errors.New(\"workspace has no memory extraction model configured\")\n}","typeGuard":null,"tryCatchPattern":"_, err := memorySvc.Handle(ctx, run)\nif err != nil && strings.Contains(err.Error(), \"no chat model available for memory extraction\") {\n\t// non-transient: alert an admin to configure the model; do not retry\n\treturn ErrExtractionModelUnconfigured\n}","preventionTips":["Require a chat model selection before allowing the memory feature toggle","Alert when distillation runs fail with this error (watermark will stall)","Validate workspace settings at save time: memory on => model set","Document the dependency between memory settings and model configuration"],"tags":["memory","configuration","model"],"backgroundTag":"missing-model-configuration","analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}