Realm SDK - Observability and time-travel debugging for AI agents
Project description
Realm 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 realm-sdk
# With LangChain integration
pip install realm-sdk[langchain]
# All integrations
pip install realm-sdk[all]
From GitHub
pip install git+https://github.com/neelshar/Realm.git#subdirectory=packages/python-sdk
Local Development
cd packages/python-sdk
pip install -e .
Quick Start
Basic Usage
from realm import RealmClient
# Initialize client
client = RealmClient(
api_url="https://realm-api.vercel.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 realm import RealmClient, RealmCallbackHandler
from langchain.agents import AgentExecutor, create_react_agent
# Initialize Realm
client = RealmClient(api_url="...", project_id="...")
session_id = client.create_session(name="LangChain Agent")
# Create callback handler
handler = RealmCallbackHandler(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
examples/simple_agent.py- Basic agent trackingexamples/langchain_agent.py- Full LangChain integration
Documentation
Support
- 📧 Email: support@realm.space
- 💬 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
realm_sdk-0.1.0.tar.gz
(9.7 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
File details
Details for the file realm_sdk-0.1.0.tar.gz.
File metadata
- Download URL: realm_sdk-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa156bebb08586be01fde9722b034f89d27813a67a2e4927e99191149113d17
|
|
| MD5 |
48cc70e3a2cfcce8d7c49be8e037679f
|
|
| BLAKE2b-256 |
5e4d2c02b1dc3f30fb57a4272a1b434ff99f558eca5dc77cd646f922de9f0a19
|
File details
Details for the file realm_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: realm_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 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 |
6ff77d2cf08fbeb75cc081a3ace4b4d7d8859911feb7b68cfeabef7a814e4a2b
|
|
| MD5 |
d8d5774b36bd22cd7b566c67538cb6b9
|
|
| BLAKE2b-256 |
17c7dae68513b73321a9cc7c5b74cbd2e1424fd9ff53ee424d8c7f2d713e7d57
|