Skip to main content

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

Documentation

Support

License

MIT License - see LICENSE for details.

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

sentrial-0.1.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

sentrial-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file sentrial-0.1.2.tar.gz.

File metadata

  • Download URL: sentrial-0.1.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for sentrial-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f00cfd9e30161f3a0042b09244135f85fef3ffa4b972a21a02f59bce1d75b966
MD5 01f38bda1fa4ee290336cdd2527dde22
BLAKE2b-256 e0f3054ae81485603c427005c93177e13440c85a9946ab389e00114ecbc54a70

See more details on using hashes here.

File details

Details for the file sentrial-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sentrial-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for sentrial-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b3eb52d9cfef29df9ae566f780f267805d38b934221719927ef823513314202
MD5 66e61ab9a748072959a14564db50b2fa
BLAKE2b-256 df967ce8d2d4c863355ee44e8332a59d1173b0e633ee684193d725102308a1b9

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