Docs/Get started

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

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:

Akb-answerer
1.31s
Rsearch_kb
0.24s
Mclaude-haiku-4-5
1.04s

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:

OptionTypeDefaultDescription
samplefloat1.0Share of traces to score, from 0 to 1.
agentstrallLimit the evaluator to one agent.
thresholdfloat0.7Scores below this are marked as failures.
alertstrNoneSlack 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.

Next steps