Quickstart
Send your first trace to Sightline and add an evaluator. Takes about five minutes.
1Install the SDK
The SDK supports Python 3.9+ and Node.js 18+.
pip install sightline
npm install @sightline/sdk
2Set your API key
Create a key in Settings → API keys. Keys are scoped to one project and one environment.
SIGHTLINE_API_KEY=sl_live_4f9a…c21e SIGHTLINE_ENV=production
Never ship a sl_live_ key in browser code. Use the server SDK or the ingest proxy.
3Trace your agent
Call init() once at startup. Calls to Anthropic, OpenAI and the other supported clients are captured automatically. Wrap your entry point with @sightline.agent to group them into one trace.
import sightline, anthropic sightline.init(project="acme-support") client = anthropic.Anthropic() @sightline.agent(name="kb-answerer") def answer(question: str) -> str: docs = search_kb(question) # traced as a retrieval span msg = client.messages.create( model="claude-haiku-4-5", max_tokens=1024, messages=[{"role": "user", "content": prompt(question, docs)}], ) return msg.content[0].text
Run your agent once, then open Traces. The trace should appear within a second:
4Add an evaluator
Evaluators score traces after they finish, so they never add latency. Start with groundedness on 20% of traffic:
sightline.evaluate("groundedness", agent="kb-answerer", sample=0.2)
Common options:
| Option | Type | Default | Description |
|---|---|---|---|
sample | float | 1.0 | Share of traces to score, from 0 to 1. |
agent | str | all | Limit the evaluator to one agent. |
threshold | float | 0.7 | Scores below this are marked as failures. |
alert | str | None | Slack channel to notify when the failure rate rises. |
LLM judges are included in your plan’s eval runs. To use your own model key instead, set judge_model.