Skip to content
XLinkedIn
Sign Up →

Agents

An agent in Kelet represents a named AI component within a project — a retriever, a planner, a responder, a tool-calling loop. Agents are the unit Kelet uses for credit assignment: when a multi-agent session fails, Kelet identifies which specific agent caused it.

You don’t register agents manually. Kelet discovers them automatically from your traces as sessions flow in. The first time a named agent appears in a trace, Kelet creates it in your project.

Agent names are inferred from your framework’s span metadata. Most orchestration frameworks (pydantic-ai, LangChain, LangGraph) set agent names automatically.

If your framework doesn’t expose agent names — or you want to override what’s inferred — use kelet.agent() in Python or agentContext() in TypeScript:

Python:

with kelet.agent(name="retriever"):
docs = await fetch_docs(query)

TypeScript:

await agentContext({ name: 'retriever' }, async () => {
return await fetchDocs(query);
});

Every span emitted inside the context is attributed to that agent.

In multi-agent sessions, Kelet’s credit assignment traces failures back to the specific agent responsible. Unnamed agents are grouped as “unknown” — you’ll still see failures, but without agent-level attribution you lose the ability to know which component to fix.