Skip to main content

agrag.retrieval.tracing

Span helpers shared by the retrieval spans.

Every retrieval span that returns a list records the results the same way, so a trace answers "what came back" without a second lookup.

Functions:

  • filters_json – Return the scope as JSON, an empty scope when filters is None.
  • record_chunks – Record loaded chunks as OpenTelemetry-safe attributes.
  • record_results – Write the results onto span.
  • result_text – Return the text a result stands for.
  • retrieval_span – Open a RETRIEVER span that records the query and the scope.

Attributes: