Skip to main content

LogSpanRetrievalContent

Span content for retrieval operations. Use this type when logging RAG (Retrieval-Augmented Generation) queries — vector similarity searches, keyword lookups, or any step that fetches context documents before passing them to an LLM.

Import

Type Definition

Properties

  • type - Discriminator field, always 'Retrieval' for this content type
  • input - The retrieval query as a JSON string (JSON.stringify() of the search parameters)
  • output - The retrieved results as a JSON string (JSON.stringify() of the documents/chunks)
Both input and output must be valid, parseable JSON strings (the result of JSON.stringify()). Passing a plain string that isn’t valid JSON will cause the span to be rejected.

Example


  • LogSpanContent — union type that includes LogSpanRetrievalContent
  • LogSpanEmbeddingsContent — often used before retrieval to generate query embeddings
  • Span — class that accepts LogSpanContent via span.update()