Sentrial - Observability and time-travel debugging for AI agents
Project description
Sentrial Python SDK
Observability and time-travel debugging for AI agents. Track every decision, tool call, and state change in your agent workflows.
Features
- Automatic Tracking: Capture agent reasoning, tool calls, and state changes
- Git-like Branching: Fork agent sessions at any point
- Time Travel: Replay and debug past agent executions
- Framework Agnostic: Works with LangChain, custom agents, and more
- Visual UI: Beautiful web interface to explore agent behavior
Installation
From PyPI
# Standard installation
pip install sentrial
# With LangChain integration
pip install sentrial[langchain]
# All integrations
pip install sentrial[all]
From GitHub
pip install git+https://github.com/neelshar/Sentrial.git#subdirectory=packages/python-sdk
Local Development
cd packages/python-sdk
pip install -e .
Quick Start
Basic Usage
from sentrial import SentrialClient
# Initialize client
client = SentrialClient(
api_url="https://api.sentrial.app", # Or your self-hosted URL
project_id="your-project-id"
)
# Create a session
session_id = client.create_session(name="Customer Support Agent")
# Track tool calls
client.track_tool_call(
session_id=session_id,
tool_name="search_knowledge_base",
tool_input={"query": "password reset"},
tool_output={"articles": ["KB-001", "KB-002"]},
reasoning="Searching for relevant articles"
)
# Track LLM decisions
client.track_decision(
session_id=session_id,
reasoning="User already tried KB solutions. Escalating to human support.",
alternatives=["Try another KB article", "Ask for more info"],
confidence=0.85
)
# Close session
client.close_session(session_id)
LangChain Integration
from sentrial import SentrialClient, SentrialCallbackHandler
from langchain.agents import AgentExecutor, create_react_agent
# Initialize Sentrial
client = SentrialClient(api_url="...", project_id="...")
session_id = client.create_session(name="LangChain Agent")
# Create callback handler
handler = SentrialCallbackHandler(client, session_id, verbose=True)
# Use with LangChain - automatic tracking!
agent_executor = AgentExecutor(
agent=agent,
tools=tools,
callbacks=[handler], # ← That's it!
verbose=True
)
result = agent_executor.invoke({"input": "Help user with login issue"})
The callback handler automatically tracks:
- Agent reasoning (Chain of Thought)
- Tool calls (inputs & outputs)
- Tool errors
- Agent completion
Examples
- simple_agent.py - Basic agent tracking
- langchain_agent.py - Full LangChain integration
Documentation
Support
- Email: support@sentrial.ai
- Discord: Join our community
- Issues: GitHub Issues
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sentrial-0.1.3.tar.gz
(11.2 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
sentrial-0.1.3-py3-none-any.whl
(11.0 kB
view details)
File details
Details for the file sentrial-0.1.3.tar.gz.
File metadata
- Download URL: sentrial-0.1.3.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73dbefdfd4dd313e3d8d854629b63815222a56b3e3fedb2a938cdf80d74f160f
|
|
| MD5 |
60548e7fd9c056d6475f06ae4761d02c
|
|
| BLAKE2b-256 |
b261177013b29f94c8a82596044cbeff0c5ad7431d91dc5b4a9748723bbaca51
|
File details
Details for the file sentrial-0.1.3-py3-none-any.whl.
File metadata
- Download URL: sentrial-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b4133c3ce69b6970da67d0a7ba99a69d8edaff55504c626132806f2c9d1e744
|
|
| MD5 |
dfd9fe8845528629b30b9b7c3ea35bb9
|
|
| BLAKE2b-256 |
e1e576a7adb3421f4f0652022f1471aecbdd982f7726127393493e46ff6aa8f4
|