usememos/memos · error

Internal

Internal

Error message

transcription response did not include text

What it means

After the audio LLM returned a transcription with FinishStop, the response's Text field was empty/whitespace, so the memo transcription pipeline treats it as an unusable result (Internal error). The model completed without producing any transcript content.

Source

Thrown at server/router/api/v1/ai_service.go:177

	m, err := audiollmgemini.New(provider, audiollm.ApplyOptions(nil))
	if err != nil {
		return "", errors.Wrap(err, "failed to create audio LLM")
	}
	resp, err := m.GenerateFromAudio(ctx, audiollm.Request{
		Audio:        bytes.NewReader(content),
		Size:         int64(len(content)),
		ContentType:  contentType,
		Model:        model,
		Instructions: buildTranscriptionInstructions(persisted.GetPrompt(), persisted.GetLanguage()),
	})
	if err != nil {
		return "", err
	}
	if resp.FinishReason != audiollm.FinishStop {
		return "", errors.Errorf("transcription incomplete (finish reason: %s)", resp.FinishReason)
	}
	if strings.TrimSpace(resp.Text) == "" {
		return "", errors.New("transcription response did not include text")
	}
	return resp.Text, nil
}

func buildTranscriptionInstructions(prompt, language string) string {
	parts := []string{
		"Transcribe the audio accurately. Return only the transcript text. " +
			"Do not summarize, explain, or add content that is not spoken.",
	}
	if language = strings.TrimSpace(language); language != "" {
		parts = append(parts, "The input language is "+language+".")
	}
	if prompt = strings.TrimSpace(prompt); prompt != "" {
		parts = append(parts, "Context and spelling hints:\n"+prompt)
	}
	return strings.Join(parts, "\n\n")
}

View on GitHub (pinned to 14d757ce1f)

Solutions

  1. Verify the audio actually contains speech (play it back; check duration/waveform)
  2. Confirm the AI provider and model settings in Memos are correct and the model supports audio transcription
  3. Retry once — occasional empty completions happen; if persistent, test the same file against the provider directly
  4. File an issue if the provider returns text in a field Memos does not map
Defensive patterns

Strategy: retry

Validate before calling

// Before transcribing, sanity-check the audio has speech-sized content
func likelyHasSpeech(path string) bool {
  info, err := os.Stat(path)
  if err != nil || info.Size() < 1024 { return false } // <1s of compressed audio
  return true
}

Try / catch

// Retry once, then surface a user-actionable error
text, err := transcribe(ctx, content)
if err != nil {
  if strings.Contains(err.Error(), "did not include text") {
    text, err = transcribe(ctx, content) // one retry for flaky completions
    if err != nil { return status.Errorf(codes.InvalidArgument, "no speech detected in audio") }
  } else { return err }
}

Prevention

When it happens

Trigger: Transcribing a silent or near-silent audio file, a file whose content is all filtered noise, or a model/provider misconfiguration that returns an empty completion; also possible when a provider returns content in a non-standard field Memos does not read.

Common situations: Uploading music/noise files expecting transcription; very short clips; wrong model name configured for the AI provider so responses lack text; provider API version changes altering the response shape.

Related errors


AI-assisted analysis of usememos/memos@14d757ce1f (2026-08-15). Data as JSON: /api/errors/7d0217adb23ebab9. Report an issue: GitHub.