@e-volv/agents
v0.1.1
Published
e-volv Observer for Agents SDK for Node.js: agent runs, model calls and tool calls as spans the Observer rollup reads, with OpenAI, Anthropic, MCP and Vercel AI SDK wrappers.
Maintainers
Readme
@e-volv/agents
Agent runs as e-volv Observer reads them. Every model call, tool call and
agent run becomes a span with the OpenTelemetry GenAI attributes, sent through
the @e-volv/logs SDK you already have, so Observer's Agents pages show each
run with its tokens, cost, session and prompt version.
npm install @e-volv/agentsimport {
init,
instrumentOpenAI,
traceAgent,
traceTool,
withSession,
} from '@e-volv/agents';
import OpenAI from 'openai';
init({
key: process.env.EVOLVE_LOGS_KEY,
url: 'https://api.e-volv.io/api/public/v1/logs',
service: 'support-bot',
});
const openai = instrumentOpenAI(new OpenAI());
await withSession({ sessionId: thread.id, userId: user.id }, () =>
traceAgent('triage', async () => {
const res = await openai.chat.completions.create({
model: 'gpt-5-mini',
messages,
});
await traceTool('read_ticket', () => tickets.read(id));
return res.choices[0].message.content;
})
);What it gives you
init(options):@e-volv/logsoptions pluscontent: trueto record prompts, completions, tool arguments and results (off by default). e-volv Launch flags are off too, since a Berserker project key has noflags:read; passflagsto turn them on for a key that does.traceAgent(name, fn, { agentId?, model?, provider? }): the run.traceChat(model, fn, { provider }): one model call; callchat.usage({ input, output, cacheRead, cacheWrite }, responseModel)inside.traceTool(name, fn): one tool call.withSession({ sessionId, userId }, fn)andwithPrompt({ name, version }, fn): tag every span inside.instrumentOpenAI(client),instrumentAnthropic(client): wrap the client in place; chat completions, the Responses API and messages, streams included.traceMcp(client, serverName): everycallToolis a tool span.aiMiddleware(): a Vercel AI SDK middleware forwrapLanguageModel.
Already on OpenTelemetry? You do not need this package: point your exporter at
https://api.e-volv.io/api/public/v1/logs/otlp/v1/traces with the ingest key
as Authorization and Observer reads the GenAI spans directly.
