Seer is currently in private beta. Email ben@seersearch.com to request access and receive SDK installation instructions.
Installation
Quick Start
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
SEER_API_KEY | API key (required) | — |
SEER_INGESTION_URL | Ingestion endpoint | https://api.seersearch.com/v1/log |
Constructor Options
SeerClient API
log()
Log a retrieval event.
fire_and_forget=True(default):None(event queued async)fire_and_forget=False:record_idstring from API
flush()
Wait for all queued events to be sent.
stats()
Get client statistics.
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
| Parameter | Type | Description |
|---|---|---|
task_arg | str | Name of argument containing the query (default: "query") |
context_from_return | bool | Use return value as context |
context_arg | str | Name of argument containing context (mutually exclusive with context_from_return) |
metadata | dict | Static metadata to attach |
use_otel_trace | bool | Auto-detect OTEL trace context (default: True) |
client | SeerClient | Client instance to use (default: global client) |
Fire-and-Forget vs Synchronous
Fire-and-Forget (Default)
Events are queued and sent asynchronously.log() returns immediately.
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:| Pattern | UI Color |
|---|---|
retrieval, retrieval_hop_N | Blue |
rerank, reranker | Purple |
llm_call, llm | Amber |
synthesis, answer | Emerald |
Ground Truth (Accuracy Testing)
Include expected results for accuracy measurement:Convenience Function
For simple cases, use the globalseer_log:
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.clientlogger) - Network errors: Retried with exponential backoff, then dropped
- Invalid API key: Warning logged, event sent (server rejects)
client.stats() for failure counts.
Examples
- Basic usage
- OpenTelemetry integration
- Replay rollouts