Skip to main content
The Seer Python SDK provides a lightweight client for logging retrieval events.
Seer is currently in private beta. Email ben@seersearch.com to request access and receive SDK installation instructions.

Installation

Quick Start


Configuration

Environment Variables

Constructor Options


SeerClient API

log()

Log a retrieval event.
Returns:
  • fire_and_forget=True (default): None (event queued async)
  • fire_and_forget=False: record_id string from API

flush()

Wait for all queued events to be sent.

stats()

Get client statistics.
Returns a ClientStats object:

close()

Shutdown client gracefully (flushes remaining events).

Context Format

Passages can be simple strings or objects with metadata:

Decorator

Use @seer_trace to automatically log function calls:

Decorator Parameters


Fire-and-Forget vs Synchronous

Fire-and-Forget (Default)

Events are queued and sent asynchronously. log() returns immediately.
Note: Auto-flush via atexit happens on normal exit. Call flush() explicitly before os._exit() or in process pools.

Synchronous

Events are sent immediately. log() blocks and returns record_id.

OpenTelemetry Integration

The SDK automatically captures OTEL trace context when available:

Manual Trace IDs

Span Name Patterns

Span names are used for filtering in the UI:

Ground Truth (Accuracy Testing)

Include expected results for accuracy measurement:

Convenience Function

For simple cases, use the global seer_log:
Creates a global SeerClient on first call.

Error Handling

The SDK is designed to be non-blocking and fail gracefully:
  • Queue overflow: Events are dropped (logged to seer.client logger)
  • Network errors: Retried with exponential backoff, then dropped
  • Invalid API key: Warning logged, event sent (server rejects)
Check client.stats() for failure counts.

Examples

  • Basic usage
  • OpenTelemetry integration
  • Replay rollouts

See Also