Skip to main content

AgentLens observability server for AI agents

Project description

agentlens-server

FastAPI backend for AgentLens — real-time observability for AI agents.

Install

pip install agentlens-server

Run

agentlens-server
# REST API: http://localhost:8766/api/v1
# WebSocket: ws://localhost:8766/ws
# Dashboard: http://localhost:5173 (start separately)

Run from source

git clone https://github.com/ArkFelix7/agentlens
cd agentlens
make install && make dev

API Endpoints

Method Path Description
GET /api/v1/sessions List all sessions
GET /api/v1/traces/{session_id} Get all trace events for a session
POST /api/v1/traces/{session_id} Ingest trace events
GET /api/v1/costs/{session_id} Cost breakdown
GET /api/v1/hallucinations/{session_id} Hallucination alerts
POST /api/v1/hallucinations/{session_id}/detect Run detection
GET /api/v1/memory/{session_id} Memory entries
PATCH /api/v1/memory/entry/{id} Edit memory entry
DELETE /api/v1/memory/entry/{id} Delete memory entry
GET /api/v1/replay/{session_id} Replay event stream
GET /health Health check

WebSocket Protocol

Connect to ws://localhost:8766/ws and send a hello message:

{ "type": "hello", "role": "sdk" }

Roles: "sdk" (agent sending events) or "dashboard" (browser receiving events).

Configuration

Environment variables (all optional):

Variable Default Description
DATABASE_URL sqlite+aiosqlite:///agentlens.db Database URL
HOST 0.0.0.0 Bind address
PORT 8766 Port
CORS_ORIGINS ["*"] Allowed CORS origins

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentlens_server-0.2.0.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentlens_server-0.2.0-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

Details for the file agentlens_server-0.2.0.tar.gz.

File metadata

  • Download URL: agentlens_server-0.2.0.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for agentlens_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 507dcfebea407ff04878aaac667e427cf73fae2eca249a634e6006772644ab74
MD5 f1cbcf385f4673840c9e53735e917f64
BLAKE2b-256 ec776024dd76c1e11734b6223ff91a304ab93a84a1a4dcc2df7967ff4cbda7cb

See more details on using hashes here.

File details

Details for the file agentlens_server-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentlens_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28fd023cc76a0d08c39e832ccb0574fcf358ff120f4803bfb83a84690e7aba00
MD5 d3b42435635f81de166c297042a63312
BLAKE2b-256 f810ea63f1ff4f9304adec992f4aab4be506d617728bd2b68aa5c9a4151fc7f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page