PathFlow Python Telemetry SDK
pathflow is a zero-config, lightweight AI Agent Telemetry and Profiling SDK for PathFlow.
It automatically captures execution traces, DAG parent/child span trees, duration timing, model details, token counts, cost attribution, and exceptions for AI agents—with zero friction and zero changes to your core agent logic.
🚀 Installation
pip install pathflow
⚙️ Configuration
Set your credentials via environment variables:
export PATHFLOW_API_KEY="pf_live_..."
# Optional (only if self-hosting or using custom endpoint)
export PATHFLOW_ENDPOINT="https://pathflow-psi.vercel.app/api/v1"
Or pass them explicitly into the constructor:
from pathflow import PathFlow
pf = PathFlow(
api_key="pf_live_...",
endpoint="https://pathflow-psi.vercel.app/api/v1"
)
⚡ Basic Usage: Function Decorator
Wrap your main agent function with @pf.trace():
from pathflow import PathFlow
pf = PathFlow()
@pf.trace(
name="Customer Support Resolution Agent",
project="backend-service",
environment="production"
)
def run_agent(user_query: str):
# Your agent code here
return "Issue resolved"
if __name__ == "__main__":
run_agent("How do I reset my password?")
Note: Telemetry dispatching runs safely in the background. Telemetry errors will never interrupt or crash your agent application logic.
🔍 Granular Spans & Context Management
Create granular parent/child spans around LLM completions, database queries, and tool executions using with pf.span(...):
from pathflow import PathFlow
pf = PathFlow()
@pf.trace(name="Deep Research Agent", project="analytics")
def research_agent(topic: str):
# 1. Search Tool Span
with pf.span(name="Web Search", type="Tool") as span:
span.set_input({"query": topic})
results = ["Doc 1", "Doc 2"]
span.set_output({"docs_found": len(results)})
# 2. LLM Completion Span
with pf.span(name="Groq Llama 3.3 LLM", type="LLMCall") as span:
span.set_input({"prompt": topic})
span.set_model("llama-3.3-70b-versatile")
# Attach exact tokens and cost if available
span.set_tokens(input_tokens=1400, output_tokens=350)
span.set_cost(0.0028)
response = "Synthesized analysis..."
span.set_output({"response": response})
return response
🔒 Secret Sanitization
PathFlow automatically redacts sensitive patterns (such as API keys sk-, gsk_, pf_live_, Bearer , passwords, and authorization tokens) from stringified raw inputs and outputs before transmission.
📜 License
MIT License. See LICENSE for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 pathflow-0.1.0.tar.gz.
File metadata
- Download URL: pathflow-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45d72e0824a1fceade2c530a264b0ba8d0feb33bf5ca040fbd43916de44ce444
|
|
| MD5 |
111bb85a946fc25ee97dd1a4e2a12392
|
|
| BLAKE2b-256 |
2e754a0e9df367e86b105ee265d2833a3355e174c5f2f000bdded7bfcf0e6daa
|
Provenance
The following attestation bundles were made for pathflow-0.1.0.tar.gz:
Publisher:
publish.yml on anothercodingguy/pathflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathflow-0.1.0.tar.gz -
Subject digest:
45d72e0824a1fceade2c530a264b0ba8d0feb33bf5ca040fbd43916de44ce444 - Sigstore transparency entry: 2380234787
- Sigstore integration time:
-
Permalink:
anothercodingguy/pathflow@2c4d162936eeed4f9ca6b14bad23f2db74c2f516 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anothercodingguy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c4d162936eeed4f9ca6b14bad23f2db74c2f516 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pathflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pathflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
134ae05d4555ae45d327a2bf3d9972aab99dcffa2cff879b1b1f2ca94ae0c4e1
|
|
| MD5 |
9045a6cc16ede22f82c6747bdea915be
|
|
| BLAKE2b-256 |
131cd1dfcb7153074321824b7b48ad91bf4a60f73a91cee866db0f760b66ea8a
|
Provenance
The following attestation bundles were made for pathflow-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on anothercodingguy/pathflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathflow-0.1.0-py3-none-any.whl -
Subject digest:
134ae05d4555ae45d327a2bf3d9972aab99dcffa2cff879b1b1f2ca94ae0c4e1 - Sigstore transparency entry: 2380235010
- Sigstore integration time:
-
Permalink:
anothercodingguy/pathflow@2c4d162936eeed4f9ca6b14bad23f2db74c2f516 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/anothercodingguy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2c4d162936eeed4f9ca6b14bad23f2db74c2f516 -
Trigger Event:
workflow_dispatch
-
Statement type: