feat: Day 13 - root README, example agent scripts, and demo seed script

This commit is contained in:
Vectry
2026-02-10 01:48:47 +00:00
parent e0f13cdaa6
commit 98bfa968ce
7 changed files with 2189 additions and 2 deletions

48
examples/README.md Normal file
View File

@@ -0,0 +1,48 @@
# AgentLens Examples
Example scripts demonstrating the AgentLens SDK for tracing and observing AI agent behavior.
## Setup
```bash
pip install vectry-agentlens
```
## Examples
| Script | Description |
|--------|-------------|
| `basic_agent.py` | Simplest usage — init, trace, log decisions, shutdown |
| `openai_agent.py` | OpenAI integration — wrap the client for automatic LLM call tracing |
| `multi_agent.py` | Nested traces — planner delegates to researcher, writer, and editor sub-agents |
| `customer_support_agent.py` | Realistic support workflow — classification, routing, escalation, error handling |
| `seed_demo_traces.py` | Seeds the live dashboard with 11 realistic traces via direct HTTP POST (no SDK) |
## Running
Each SDK example follows the same pattern:
```bash
# Set your API key and endpoint
export AGENTLENS_API_KEY="your-key"
# Run any example
python examples/basic_agent.py
```
For the OpenAI example, you also need:
```bash
pip install openai
export OPENAI_API_KEY="sk-..."
```
### Seed Script
The seed script sends pre-built traces directly to the API — no SDK or OpenAI key needed:
```bash
python examples/seed_demo_traces.py
```
This populates the dashboard with varied traces (COMPLETED, ERROR, RUNNING) across multiple agent types.