Getting Started
Go from zero to full agent observability in under five minutes. This guide walks you through installing the SDK, initializing it, and sending your first trace.
Prerequisites
- Python 3.9+ or Node.js 18+
- An AgentLens instance (use agentlens.vectry.tech or self-host)
- An API key for authentication
Step 1: Install the SDK
Python
terminal
pip install vectry-agentlensTypeScript / Node.js
terminal
npm install agentlens-sdkStep 2: Initialize AgentLens
Python
main.py
import agentlens
agentlens.init(
api_key="your-api-key",
endpoint="https://agentlens.vectry.tech"
)TypeScript
index.ts
import { init } from "agentlens-sdk";
init({
apiKey: "your-api-key",
endpoint: "https://agentlens.vectry.tech",
});Step 3: Trace your first agent
Python
agent.py
import agentlens
from agentlens import trace
agentlens.init(
api_key="your-api-key",
endpoint="https://agentlens.vectry.tech"
)
@trace(name="my-first-agent")
def my_agent(prompt: str) -> str:
# Your agent logic here
response = call_llm(prompt)
return response
# Run it — the trace is sent automatically
result = my_agent("What is the capital of France?")TypeScript
agent.ts
import { init, TraceBuilder } from "agentlens-sdk";
init({
apiKey: "your-api-key",
endpoint: "https://agentlens.vectry.tech",
});
const trace = new TraceBuilder("my-first-agent");
trace.addSpan({
name: "llm-call",
type: "LLM_CALL",
input: { prompt: "What is the capital of France?" },
output: { response: "Paris" },
status: "COMPLETED",
});
await trace.end();Step 4: View in the dashboard
Open your AgentLens dashboard to see the trace you just sent. You will see the trace name, its status, timing information, and any spans or decision points you recorded.
Open Dashboard