wu981526092's picture
🚀 Deploy AgentGraph: Complete agent monitoring and knowledge graph system
c2ea5ed
"""
Platform-Specific Trace Parsers
This module provides rule-based parsers for extracting structured metadata
from traces originating from different AI observability platforms.
These parsers complement the multi-agent knowledge extractor by providing
platform-specific structural information that every trace from that platform
will contain, helping to improve extraction accuracy and completeness.
Architecture:
- base_parser.py: Base parser interface and common functionality
- langsmith_parser.py: LangSmith-specific trace structure parsing
- langfuse_parser.py: Langfuse-specific trace structure parsing (future)
- parser_factory.py: Factory for selecting appropriate parser based on trace source
Usage:
from agentgraph.input.parsers import create_parser, detect_trace_source
# Detect source and create appropriate parser
source = detect_trace_source(trace_content, trace_metadata)
parser = create_parser(source)
# Extract platform-specific metadata
parsed_metadata = parser.parse_trace(trace_content, trace_metadata)
"""
from .base_parser import BaseTraceParser, ParsedMetadata
from .langsmith_parser import LangSmithParser
from .parser_factory import create_parser, detect_trace_source, get_context_documents_for_source, parse_trace_with_context
from .universal_parser import GenericLangSmithParser
__all__ = [
'BaseTraceParser',
'ParsedMetadata',
'LangSmithParser',
'GenericLangSmithParser',
'create_parser',
'detect_trace_source',
'get_context_documents_for_source',
'parse_trace_with_context'
]