How agentinsight/agentinsight-sdk-python works
AgentInsight is a Python SDK for LLM observability, tracing, evaluation, and prompt management. Users initialize a client, instrument LLM or application work, and export trace data to the AgentInsight platform; they can then score traces or run dataset experiments and batch evaluations. OpenAI and LangChain instrumentation, manual spans, context propagation, prompt management, and asynchronous media/score processing are distinct capabilities. Edges rely on README workflow statements and SOURCE INDEX references; unsampled implementation details are not assumed.
Main entry points: client.py AgentInsight client · resource_manager.py Tracer runtime · api Platform API · __init__.py Initialize SDK
Components 18
Instrumentation
- Initialize SDK
agentinsight/__init__.py - OpenAI instrumentation
agentinsight/openai.py - LangChain handler
agentinsight/langchain/CallbackHandler.py - Observe decorator
agentinsight/_client/observe.py
Telemetry runtime
- AgentInsight client
agentinsight/_client/client.py - Span operations
agentinsight/_client/span.py - Context propagation
agentinsight/_client/propagation.py - Tracer runtime
agentinsight/_client/resource_manager.py - Media upload
agentinsight/_task_manager/media_manager.py - Score ingestion
agentinsight/_task_manager/score_ingestion_consumer.py
Evaluation workflows
- Dataset experiments
agentinsight/experiment.py - Batch evaluation
agentinsight/batch_evaluation.py - Prompt management
agentinsight/_utils/prompt_cache.py
Platform API
- Platform API
agentinsight/api - HTTP transport
agentinsight/api/core/client_wrapper.py
Other components
- Application developer
- AgentInsight platform
- LLM provider
Connections 22
- Application developer → Initialize SDK: configures
- Application developer → OpenAI instrumentation: instruments calls
- Application developer → LangChain handler: registers handler
- Application developer → Observe decorator: decorates work
- OpenAI instrumentation → LLM provider: wraps calls
- LangChain handler → AgentInsight client: creates observations
agentinsight/langchain/CallbackHandler.py - Observe decorator → AgentInsight client: traces functions
- Initialize SDK → AgentInsight client: provides client
agentinsight/__init__.py - AgentInsight client → Span operations: creates spans
agentinsight/_client/client.py - AgentInsight client → Context propagation: uses propagation
agentinsight/_client/client.py - AgentInsight client → Tracer runtime: uses tracer runtime
agentinsight/_client/client.py - Tracer runtime → Media upload: starts workers
agentinsight/_client/resource_manager.py - Tracer runtime → Score ingestion: starts workers
agentinsight/_client/resource_manager.py - AgentInsight client → Platform API: uses API
agentinsight/_client/client.py - Platform API → HTTP transport: uses transport
agentinsight/api/annotation_queues/raw_client.py - Platform API → AgentInsight platform: sends requests
- Tracer runtime → AgentInsight platform: exports telemetry
- AgentInsight client → Dataset experiments: supports experiments
agentinsight/_client/client.py - Dataset experiments → Batch evaluation: supports evaluation
agentinsight/experiment.py - Batch evaluation → AgentInsight client: fetches and scores
agentinsight/batch_evaluation.py - AgentInsight client → Prompt management: uses prompt cache
agentinsight/_client/client.py - Prompt management → AgentInsight platform: retrieves prompts