How unknoun01/laplace works
Laplace is an observability and optimization product for AI agents. Its main workflow instruments agent execution in the Python SDK, sends hierarchical traces to backend ingestion, stores spans, then exposes trace exploration and cost/problem analysis through the API and web UI. From those findings, users can track remediation, configure alerts, evaluate agent changes, and manage prompt versions. The README documents these product areas; sampled source confirms SDK capture, backend setup/auth, diagnosis coverage, storage behavior, and selected UI data paths, but not every route-to-service call.
Main entry points: api.py Read and product APIs · base.py Span storage · api.ts API client · main.py Backend app
Components 22
Capture and ingestion
- Python SDK
packages/sdk-python/laplace/decorators.py - Model integrations
packages/sdk-python/laplace/integrations - OTLP ingestion
apps/backend/laplace_backend/ingest/otlp.py
Backend analysis
- Backend app
apps/backend/laplace_backend/main.py - Access control
apps/backend/laplace_backend/auth.py - Read and product APIs
apps/backend/laplace_backend/api.py - Span storage
apps/backend/laplace_backend/storage/base.py - Local SQLite
apps/backend/laplace_backend/storage/sqlite.py - Cloud stores
apps/backend/laplace_backend/storage
Product capabilities
- Waste detection
apps/backend/laplace_backend/insights/motor.py - Coverage analysis
apps/backend/laplace_backend/coverage.py - Threshold alerts
apps/backend/laplace_backend/alerts.py - Cost dashboard
apps/backend/laplace_backend/panel.py - Evaluations
apps/backend/laplace_backend/evals.py - Prompt versions
apps/backend/laplace_backend/prompts.py
Web interface
- Web application
apps/web/app - Diagnosis screen
apps/web/app/page.tsx - Trace explorer
apps/web/components/TraceTree.tsx - API client
apps/web/lib/api.ts
Other components
- AI agent
- Project user
- Slack and webhooks
Connections 23
- AI agent → Python SDK: runs instrumented
- Model integrations → Python SDK: auto-instrumented by
- Python SDK → OTLP ingestion: exports traces
- Backend app → OTLP ingestion: hosts ingestion
- Backend app → Read and product APIs: hosts routes
- Backend app → Access control: installs middleware
- OTLP ingestion → Span storage: writes spans
- Span storage → Local SQLite: implemented by
- Span storage → Cloud stores: implemented by
- Read and product APIs → Span storage: reads traces
- Read and product APIs → Waste detection: requests findings
- Read and product APIs → Coverage analysis: requests coverage
- Read and product APIs → Threshold alerts: serves alert settings
- Read and product APIs → Cost dashboard: serves panel data
- Read and product APIs → Evaluations: serves evaluations
- Read and product APIs → Prompt versions: serves prompt data
- Waste detection → Span storage: reads usage facts
- Threshold alerts → Slack and webhooks: sends notifications
- Project user → Web application: uses
- Web application → API client: loads data through
- API client → Read and product APIs: requests data
- Diagnosis screen → API client: loads diagnosis
- Trace explorer → API client: renders trace data