Skip to content

Quickstart

Connect your agent, turn its real runs into eval cases, and ship a measured improvement. Your coding agent does most of the work. Plan for about half an hour; mining cases takes the longest.

You need:

  • An agent.
  • Python 3.12 or newer in your agent's project.
  • A coding agent, such as Claude Code or Codex.

Stuck at a step? Read the page that step links to, or open an issue on GitHub.

There are two paths. They differ only in step 3, which has a tab for each:

  • My agent already sends traces somewhere. evalkit imports your trace history from that trace source.
  • No traces yet. Your agent sends its traces straight to evalkit, and you use it a few times.

This quickstart assumes a Python agent. Is yours in another language, or does it run in another process? evalkit still works:

  • Write a small Python task that calls your agent over HTTP or as a subprocess.
  • Have your agent send its traces with its own OpenTelemetry SDK, as in From any OpenTelemetry SDK.
  • Link each run to its spans. Either the task takes metadata and passes metadata["session_id"] to your agent as its session id, or your agent returns the session id it set on its spans and the task returns it in RunResult(session_id=...). See An agent in another process.

Let your coding agent drive

Open your coding agent in your agent's project folder and tell it:

Install evalkit-py==0.9.0 into this project, run `evalkit skills install`, then use the getting-started skill to set up evalkit for this agent.

On a server you run yourself, add: Log in to http://localhost:8020.

It runs every step below. It stops only when it needs you: how fast to go, which path you take, the sign-in in your browser, your trace store's URL and project and the name of the environment variable that holds its API key, and your OK on the plan for the cases.

Prefer to do it by hand? The steps are the same.

1. Install and log in

Install evalkit-py into your agent's own project, at the version of the evalkit server you use: runs refuse to start when the two differ. evalkit needs Python 3.12 or newer.

In the virtualenv your agent uses:

pip install "evalkit-py==0.9.0"
uv add "evalkit-py==0.9.0"
poetry add "evalkit-py==0.9.0"

Run every evalkit command below in that environment: with the virtualenv active, or as uv run evalkit ... or poetry run evalkit ....

evalkit login

Your browser opens. Sign up or sign in to hosted evalkit.

On a server you run yourself:

evalkit login --url http://localhost:8020

2. Create your agent

Pick the preset for your framework. A preset is a ready-made mapping: it tells evalkit how to read your agent's spans. Framework mappings says which preset fits which framework. List them:

evalkit traces mapping presets

Create your agent with it:

evalkit agents create myagent --trajectory-source otel --mapping langchain

In the UI: Agents › New agent, set Trajectories to "From traces (OTel spans)" and pick the preset under Span mapping.

The New agent dialog with Trajectories set to From traces and the langchain preset picked

3. Get real runs onto evalkit

Each session of your agent becomes an app run. Pick your path:

evalkit imports traces from trace sources. Supported today: Phoenix and Langfuse. For another, file a GitHub issue.

Tell evalkit where your traces live. This makes a trace source, and it needs an admin:

evalkit trace-sources create phoenix --url <your Phoenix URL> --api-key-env PHOENIX_API_KEY

For Langfuse, the env var holds the public key and secret key joined with a colon, and the agent uses the langfuse preset in step 2. See Tracing:

evalkit trace-sources create langfuse --provider langfuse --url https://cloud.langfuse.com --api-key-env LANGFUSE_KEYS

In the UI: Settings › Organization › Trace sources.

The Trace sources page with a trace source named phoenix

Point your agent at its project there:

evalkit agents edit myagent --trace-source phoenix --project <project>

In the UI: Agents › myagent › Edit, then set Trace source and Project.

The Edit agent dialog with Trace source phoenix and a Project

Check that evalkit reads your traces. Import one session from the project:

evalkit traces import myagent <session id>

The command prints one line per check. session, root, mapping, llm and trajectory must have a ✓, and so must tools when your agent called a tool. A ! on unmapped is fine: it lists span attributes evalkit did not need. A ! or ✗ on a required line means your spans differ from the preset: the connect-traces skill fixes the mapping. See Mappings.

In the UI: Agents › myagent › Import, pick One session and enter its id.

The Import tab after importing one session, with its span counts, messages and tokens

Bring in your recent history:

evalkit traces import myagent --since <date>

In the UI: Agents › myagent › Import, pick Time range and set Since.

The Import tab with a finished range import

Does your agent start its own trace? Read An agent with its own trace store before step 5.

Make your agent a token for sending traces:

evalkit tokens create --agent myagent

On hosted evalkit you can also make it in the UI: Settings › API keys.

Export it in every shell that runs your agent:

export EVALKIT_OTEL_TOKEN=<token>

Add the OpenTelemetry instrumentor for your framework. The Instrumentation column of Framework mappings names it.

Turn tracing on where your agent starts, in code that also runs when run_evals.py imports your agent:

from evalkit.sdk import tracing
from openinference.instrumentation.langchain import LangChainInstrumentor

tracing.register(agent="myagent")
LangChainInstrumentor().instrument()

register only adds evalkit as a destination; the instrumentor makes the spans.

Give each run its own session. Wrap each question your agent answers:

from uuid import uuid4

from openinference.instrumentation import using_session

with using_session(str(uuid4())):
    answer = agent.ask(question)

Other instrumentors: see a session id on each turn.

Now use your agent the way you normally do: ask it 5 to 10 real questions.

Check one session. List the runs, then check one by its id:

evalkit runs list myagent --source app

In the UI: Runs, then pick myagent.

The Runs page listing myagent's app runs

evalkit traces check myagent <session id>

The command prints one line per check. session, root, mapping, llm and trajectory must have a ✓, and so must tools when your agent called a tool. A ! on unmapped is fine: it lists span attributes evalkit did not need. A ! or ✗ on a required line means your spans differ from the preset: the connect-traces skill fixes the mapping. See Mappings.

In the UI: Agents › myagent › Mappings, under Preview over recent sessions.

The Mappings tab previewing one session: span counts, messages, tokens and the trajectory

Tracing has the details for both paths.

4. Mine cases from real runs

Tell your coding agent:

Use the eval-driven-development skill to mine cases from myagent's app runs since <date> into a dataset named mined. Keep the first batch to 30 runs or fewer.

It reads each run, groups the ones that failed or ran slow, shows you a plan, and writes the cases to evalkit/cases/mined/. That folder is your first dataset, built from real questions. Case schema has the format.

5. Run the baseline

Write run_evals.py in your project's root. The task calls your agent once per case:

from evalkit.sdk import run_experiment

from myagent import ask  # however your code calls your agent


def task(input: dict) -> str:
    return ask(input["question"])


if __name__ == "__main__":
    run_experiment(dataset="mined", agent="myagent", task=task)

Is your agent async? Write async def task and await it. Do not wrap it in asyncio.run. See The task.

run_experiment(dataset="mined") syncs evalkit/cases/mined/ before it runs. You need no evalkit.yaml.

Each case runs once here, to keep the demo fast. Real comparisons pass repetitions (for example repetitions=3), because one run can flip by chance.

Run it from your project's root (with uv, uv run python run_evals.py; with poetry, poetry run python run_evals.py):

python run_evals.py

evalkit picks up each run's trajectory, scores it, and prints the scorecard and a link to the experiment.

Some cases fail. Good: they came from runs that went wrong.

The experiment page: score cards per bucket and a table of cases, two of them failing

6. Improve

Tell your coding agent:

Use the eval-driven-development skill with --apply to fix the failing cases of my latest experiment on the mined dataset, then run the whole dataset again.

It pulls the failed runs, finds the cause of each, fixes your agent and runs the dataset again. Does your agent run as a service? Restart it after each fix, before the next run.

Then compare the two experiments:

evalkit experiments list --dataset mined
evalkit summary <new id> --baseline <old id>

You see which cases it fixed, and how response time, cost and tokens moved.

In the UI: open the new experiment and pick the old one under Compare with.

The Compare page: each bucket's score before and after, and the cases that improved

What you just did

  • Set up evalkit in your agent repo.
  • Mapped your agent's spans.
  • Built a dataset from your agent's real runs.
  • Ran an experiment and got a scorecard.
  • Found what went wrong, fixed it, and measured the gain.

Where next

  • Beyond the quickstart: write a case by hand, attach files, drive your agent through the Harness API, share cases with your team.
  • Concepts: every term on this page.
  • Try locally: run evalkit on your own machine with a sample agent.
  • GitHub issues: report a problem or ask a question.