StateLens
Chrome DevTools for AI Agents
StateLens is a local-first debugging workspace for AI applications. Inspect every node, state transition, tool call, prompt, and execution path in your LangGraph agents.
Quick Start
1. Install the SDK
cd sdk
uv sync --extra langgraph
# or: pip install -e ".[langgraph]"
2. Instrument your graph
from statelens import observe
app = graph.compile()
app = observe(app) # ← one line, zero config
result = app.invoke({"messages": [...]})
3. Start the server
cd backend
uv sync
statelens-server
4. View your executions
Open http://localhost:8000/conversations
Architecture
SDK (writes) → SQLite (~/.statelens/statelens.db) ← Backend (reads) → Frontend (displays)
- SDK — instruments LangGraph via callbacks, writes events to SQLite
- Backend — FastAPI server, reads from the same SQLite, serves REST API
- Frontend — Next.js app (separate repo concern), consumes the REST API
Project Structure
statelens/
├── contracts/ # Shared schemas and API contracts
├── sdk/ # Python SDK (statelens-sdk package)
├── backend/ # FastAPI server (statelens-server package)
├── frontend/ # Next.js UI (managed by OpenCode)
├── examples/ # Example LangGraph apps
└── docs/ # Documentation
API Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| GET | /conversations | List all conversations |
| GET | /conversations/{id} | Get conversation with events |
| GET | /events/{conversationId} | Get events for a conversation |
Configuration
| Env Variable | Default | Description |
|---|---|---|
| STATELENS_DB_PATH | ~/.statelens/statelens.db | SQLite database path |
| STATELENS_HOST | 127.0.0.1 | Server bind address |
| STATELENS_PORT | 8000 | Server port |
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
statelens_ai-0.1.0.tar.gz
(555.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
statelens_ai-0.1.0-py3-none-any.whl
(326.8 kB
view details)
File details
Details for the file statelens_ai-0.1.0.tar.gz.
File metadata
- Download URL: statelens_ai-0.1.0.tar.gz
- Upload date:
- Size: 555.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bb0f4f13c98160be117dfe36a14a4337218607ad993e45afbb2eb8ed4310940
|
|
| MD5 |
c8d47bc5331df27fc9f08e1885f7229e
|
|
| BLAKE2b-256 |
8118a3007c729a44fd3793a03d876872265617b687d232ff2d033824f6b68196
|
File details
Details for the file statelens_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: statelens_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 326.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f72066faa63ec57022f1046c9a498a5deb1b76dd7984820e8d8562c8d0e9d5e
|
|
| MD5 |
53db2dd3412e214235e034a2895d8748
|
|
| BLAKE2b-256 |
79a093db747138b9e12fb9b13827f93255b1e7590201b6b63634f4a3b1acf48d
|