Tencent/WeKnora · error

no chat model available for memory extraction; configure one

Error message

no chat model available for memory extraction; configure one under workspace memory settings

What it means

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.

Source

Thrown at internal/application/service/memory/extract.go:948

// callExtractionModel runs the single LLM call in the write path.
func (s *Service) callExtractionModel(
	ctx context.Context,
	cfg *types.MemoryConfig,
	payload types.MemoryExtractPayload,
	segment transcriptSegment,
	existing []*types.MemoryItem,
	forgotten []*types.MemoryTombstone,
	knownTopics []*types.MemoryTopicStat,
) (extractionResponse, error) {
	modelID := s.extractionModelID(ctx, cfg, payload)
	if modelID == "" {
		// Returning an error keeps the watermark where it is. Skipping here
		// silently consumed every message the run was given: distillation
		// reported success, advanced past them, and no model had ever seen
		// them — which is how a workspace on default settings ends up with an
		// enabled memory feature that has learned nothing.
		return extractionResponse{}, fmt.Errorf(
			"no chat model available for memory extraction; " +
				"configure one under workspace memory settings")
	}
	chatModel, err := s.modelService.GetChatModel(ctx, modelID)
	if err != nil {
		return extractionResponse{}, fmt.Errorf("get extraction model: %w", err)
	}

	userPrompt := buildExtractionPrompt(segment, existing, forgotten, knownTopics, cfg.ExtractInstructions)

	response, err := s.completeExtraction(ctx, chatModel, userPrompt, extractBudgetTokens)
	if err != nil {
		return extractionResponse{}, err
	}
	if response == nil {
		return extractionResponse{}, nil
	}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Configure a chat model in the workspace memory settings
  2. Disable the memory feature for that workspace if extraction is not wanted
  3. Verify modelService.GetChatModel resolution returns a valid configured model ID
  4. After configuring, confirm the next distillation run advances the watermark

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

// before enabling memory, ensure a chat model is configured
modelID := workspace.Settings.MemoryExtractionModelID
if modelID == "" {
	return errors.New("workspace has no memory extraction model configured")
}

Try / catch

_, err := memorySvc.Handle(ctx, run)
if err != nil && strings.Contains(err.Error(), "no chat model available for memory extraction") {
	// non-transient: alert an admin to configure the model; do not retry
	return ErrExtractionModelUnconfigured
}

Prevention

When it happens

Trigger: Background distillation Handle() runs for a workspace where modelID resolves to "" — i.e. no chat model configured under workspace memory settings.

Common situations: 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.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/fde4d6fd23fbfbbc. Report an issue: GitHub.