smolagents
smolagents is Hugging Face’s minimal Python agent library — CodeAgent (which writes and runs Python as its actions) and ToolCallingAgent. Neens ingests its traces through standard OpenTelemetry with zero Neens-specific code — you instrument smolagents once at startup and point an OTLP exporter at Neens.
At a glance
| Language | Python |
| Instrumentation | openinference-instrumentation-smolagents (OpenInference smolagents instrumentor — community-maintained by Arize) |
| Endpoint | POST /v1/traces (OTLP/HTTP) |
| Auth | Authorization: Bearer nk_live_… agent key |
Instrument your agent
Install the instrumentation
The OpenInference instrumentor wraps agent runs, steps, model calls and tools, and emits them as OpenTelemetry spans.
pip install openinference-instrumentation-smolagents opentelemetry-sdk opentelemetry-exporter-otlpThis assumes you already have smolagents itself installed (pip install smolagents).
Point the exporter at Neens
from openinference.instrumentation.smolagents import SmolagentsInstrumentor
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
exporter = OTLPSpanExporter(
endpoint="https://<your-neens-host>/v1/traces",
headers={"Authorization": "Bearer nk_live_your_key_here"},
)
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(exporter))
trace.set_tracer_provider(provider)
# Instrument once, before you create your agents.
SmolagentsInstrumentor().instrument(tracer_provider=provider)Run your agent
Run your agent as usual — agent.run("…"). Spans export to Neens in the background.
What Neens captures
The instrumentor emits spans for each agent run and each step of the agent’s loop, every model call (model, token counts, prompt/response messages), and every tool call — so you see the full trajectory, including the code a CodeAgent wrote at each step. Managed agents show up nested under the agent that called them. For multi-turn agents, set a conversation/session id on your runs so Neens groups them into one session (see Traces & sessions).
Neens speaks standard OTLP — this is not a Neens SDK fork. Any OpenTelemetry-instrumented smolagents app exports to Neens by pointing its exporter at the endpoint above. See Send traces for the full attribute reference, size limits, and response codes.
Verify
Open Traces in Neens; your smolagents runs appear within a few seconds. Continue to Traces & sessions.