Skip to main content

Plott Analytics SDK for LangGraph - Automatic analytics tracking for LangGraph

Project description

Plott SDK for LangGraph

Automatic analytics tracking for LangGraph applications. Just wrap your graph and analytics are collected transparently.

Installation

pip install plott-sdk-langgraph

Quick Start

from langgraph.graph import StateGraph
from langchain_core.messages import HumanMessage
from plott_langgraph import plott_tracked_graph

# Create and compile your graph
graph = workflow.compile(checkpointer=memory)

# Wrap with Plott - that's it!
tracked_graph = plott_tracked_graph(graph, {
    "api_key": "cpk_...",  # or set PLOTT_API_KEY env var
    "environment": "development",
})

# Use exactly like the original graph - analytics are automatic
async for event in tracked_graph.astream_events(
    {"messages": [HumanMessage(content="Hello!")]},
    config={"configurable": {"thread_id": "123", "run_id": "run-456"}},
):
    # Your normal event handling
    if event["event"] == "on_chat_model_stream":
        print(event["data"]["chunk"].content, end="", flush=True)

What Gets Tracked

The SDK automatically tracks:

Event Description
Messages User input and assistant responses
Tool Calls Tool executions with arguments and results
State Snapshots State changes as the graph executes
Run Lifecycle Start and end of each graph run
Errors Any errors that occur during execution

Configuration

tracked_graph = plott_tracked_graph(graph, {
    "api_key": "cpk_...",           # Required (or PLOTT_API_KEY env var)
    "environment": "production",     # production, staging, development, test
    "retry_attempts": 3,             # Number of retry attempts on failure
    "retry_delay": 1.0,              # Seconds between retries
    "debug": False,                  # Enable debug logging
})

Environment Variables

  • PLOTT_API_KEY - API key (if not provided in config)

Tracked Methods

The following methods have analytics tracking:

  • astream_events() - Full event streaming with detailed tracking
  • astream() - State streaming with lifecycle tracking
  • invoke() - Synchronous invocation with lifecycle tracking
  • ainvoke() - Async invocation with lifecycle tracking

License

Apache 2.0

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

plott_sdk_langgraph-0.0.1a1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

plott_sdk_langgraph-0.0.1a1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file plott_sdk_langgraph-0.0.1a1.tar.gz.

File metadata

File hashes

Hashes for plott_sdk_langgraph-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 c7c8040a6af8f326507ee4362f323b842ee4566186848db6095984e816a5a785
MD5 5a6a374a687db7edc3b3acfbb10bd035
BLAKE2b-256 9857940bdcad16e53edd4e4b386ee680f35c484a7e0eecab6a80a3ae4156257e

See more details on using hashes here.

File details

Details for the file plott_sdk_langgraph-0.0.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for plott_sdk_langgraph-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ba531a72500a0f749fd22e2ff1526a9bd9bfe13ee1aaa7e6b8d3c291e4176d7
MD5 4c1791cecf52b78c9e5e42ec5a0f0cca
BLAKE2b-256 90fced8f7965c2cb803c526e6a4a19ea52f331699c51117b02aef28ebed49779

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