vequil-sdk
v0.2.0
Published
Reliability and observability SDK for AI agent operators
Downloads
146
Maintainers
Readme
vequil
Prevent runaway agents. Detect anomalies. Track cost.
Reliability and observability infrastructure for AI agent operators. Connect any runtime — every action is logged, anomalies are flagged in real time, and spend is tracked by agent and tool.
npm install vequilQuickstart
import { VequilClient } from 'vequil'
const vq = new VequilClient({ workspaceKey: 'vk_ws_...' })
// Log any agent event
await vq.ingest({
source: 'my-agent',
eventType: 'tool_call',
eventStatus: 'success',
agentId: 'ops-agent-1',
sessionId: 'session-abc',
toolName: 'bash',
costUsd: 0.012,
})
// Wrap any async call — logs success or failure automatically
const result = await vq.watch(
{ source: 'openclaw', agentId: 'ops-agent-1', toolName: 'bash' },
() => runBashCommand('ls -la'),
)Integrations
LangChain
import { VequilCallbackHandler } from 'vequil/integrations/langchain'
const handler = new VequilCallbackHandler(vq, { agentId: 'my-chain' })
await chain.invoke({ input: '...' }, { callbacks: [handler] })Tool calls, LLM invocations, and chain errors are all captured automatically.
LangGraph
import { vequilNode } from 'vequil/integrations/langgraph'
const searchNode = vequilNode(
vq,
{ agentId: 'my-graph', toolName: 'search' },
async (state) => { /* your node logic */ return state },
)
graph.addNode('search', searchNode)Vercel AI SDK
import { withVequil } from 'vequil/integrations/vercel-ai'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
const trackedGenerate = withVequil(vq, { agentId: 'my-agent' }, generateText)
const { text } = await trackedGenerate({ model: openai('gpt-4o'), prompt: '...' })OpenTelemetry (Vercel AI SDK, LangChain JS, any OTel-compatible runtime)
Drop-in span exporter. Works with Vercel AI SDK's experimental_telemetry and any other OTel-instrumented framework.
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'
import { VequilSpanExporter } from 'vequil/integrations/otel'
const provider = new NodeTracerProvider()
provider.addSpanProcessor(new SimpleSpanProcessor(new VequilSpanExporter(vq)))
provider.register()
// Vercel AI SDK spans are now captured automatically
const { text } = await generateText({
model: openai('gpt-4o'),
prompt: 'Hello',
experimental_telemetry: { isEnabled: true, functionId: 'my-agent' },
})Environment variables
| Variable | Description |
|---|---|
| VEQUIL_WORKSPACE_KEY | Your workspace ingest key (alternative to passing in constructor) |
| VEQUIL_URL | Custom instance URL (default: https://vequil.com) |
Get your workspace key at vequil.com/quickstart.
What gets detected
- Logic loops and retry storms
- Runaway spend (cost spikes by agent or tool)
- Failed tool calls and chain errors
- Missing auth keys and blocked actions
- Session-level failure chains (cascade detection)
