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.1.0.tar.gz (23.7 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.1.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentlens_server-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 b5ba664af796b192c68e2624fc4d2c1f826f6822fed0aa7dadabf63383cc7e2d
MD5 93a0602a78a8a3076eff2b2bbd7b449b
BLAKE2b-256 ae741ee0e2fa7a27ccc0c70575d335c9b32a2948174a2d643164629e56ad358b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for agentlens_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 893ef98100705e5a9b1dcdbe0fb2b95f83d3e9e61410ba6dbab9f8a216efb702
MD5 552892259df9421be6c4587156ee1255
BLAKE2b-256 172b080dacd4ba4af15bbbc3f331fd11af2483076b2ff7dfe2a0d6b56a5cae8c

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