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.
Auto-discovery
Section titled “Auto-discovery”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.
Naming agents explicitly
Section titled “Naming agents explicitly”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.
Why naming matters
Section titled “Why naming matters”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.