Skip to main content

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-flax.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

Documentation

Support

License

MIT License - see LICENSE for details.

Metadata

Release files for realm-sdk 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for realm-sdk 0.1.2
File Size Uploaded Provenance Actions
realm_sdk-0.1.2.tar.gz 9.6 kB Without provenance Details for realm_sdk-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for realm-sdk 0.1.2
File Interpreter ABI Platform Actions
realm_sdk-0.1.2-py3-none-any.whl Python 3 none any Details for realm_sdk-0.1.2-py3-none-any.whl

Total release size: 18.7 kB

Release files / realm_sdk-0.1.2.tar.gz

Download URL realm_sdk-0.1.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f65f0d5315b8d5bde24895058044cb7d9822e82b77a16e27e643496ba077181
BLAKE2b-256 checksum
How to use checksums
7b1c57dd4f513a86ce2159a5d2242132a78be652b333e5e5ba28bb1df8d41287
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / realm_sdk-0.1.2-py3-none-any.whl

Download URL realm_sdk-0.1.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c72f61e9bc33264418d04fbaa9ecd1970f772f2291e9f9496635e1781c25d0f7
BLAKE2b-256 checksum
How to use checksums
73b38c9604f47ef6de06ceda1ee4443e81dcd36a4b2c8cde737fda2878a65f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Security for realm-sdk 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page