Skip to main content
Seer accepts one event per retrieval with a task (query) and a context array. You can log events two ways:
  1. Direct client: Call client.log(...) where you construct the payload.
  2. Decorator: Wrap your retrieval function to auto-capture inputs/outputs.
New to the context format? See Context & Event Schema for the exact shapes.

Install & Initialize


Option A: Direct Logging (client.log)

Use this when you already have the query + context assembled.
Notes:
  • context must be either list[str] / string[] or list[dict] / Passage[]. If using dicts/objects, include text. Full shape + examples: Context & Event Schema.
  • metadata is free-form. Include anything you want to filter by later.
  • sample_rate controls what % of events get evaluated (for cost management).

Option B: Decorator / Wrapper

The decorator (Python) or wrapper (TypeScript) eliminates boilerplate by mapping your function’s arguments/return to Seer’s event fields.

Pattern 1: Context from Return Value

For retrieval functions where the return value is the context:
The return value can be list[dict] / Passage[] (must have text key) or list[str] / string[] (auto-converted).

Pattern 2: Context from Input Argument

For processing functions where context is an input argument (not the return):

Options

Use either context_from_return=True / contextFromReturn: true or context_arg / contextArgIndex. They are mutually exclusive.

Adding Metadata


Choosing Between Client vs Decorator


Fire-and-Forget vs Synchronous

By default, the SDK uses fire-and-forget mode. Events are queued and sent asynchronously in the background.

OpenTelemetry Integration

The SDK automatically captures OTEL trace context when available:
Install with pip install seer-sdk[otel] to enable auto-detection. If you already have opentelemetry-api in your environment, it works automatically.
To disable auto-detection or provide manual IDs:

What Happens After Logging

Once logs arrive, Seer evaluates each retrieval and computes Recall, Precision, F1, and nDCG, all without labeled data. See Metrics for full definitions and worked examples.

Next Steps