File size: 3,023 Bytes
c2ea5ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7d48c14
 
 
 
 
 
 
 
 
c2ea5ed
 
 
 
 
 
 
 
 
 
 
 
 
 
7d48c14
c2ea5ed
7d48c14
 
 
 
 
 
c2ea5ed
 
 
 
 
 
7d48c14
 
 
c2ea5ed
 
 
 
 
 
 
 
9f8c703
c2ea5ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import sys
import os

"""
AgentGraph: Agent Monitoring and Analysis Framework

A comprehensive framework for monitoring, analyzing, and understanding agent behavior through:
- Input processing and analysis
- Knowledge graph extraction
- Prompt reconstruction
- Perturbation testing
- Causal analysis

Hybrid Functional + Pipeline Architecture:
- input: Trace processing, content analysis, and chunking
- extraction: Knowledge graph processing and multi-agent extraction
- reconstruction: Prompt reconstruction and content reference resolution
- testing: Perturbation testing and robustness evaluation
- causal: Causal analysis and relationship inference

Usage:
    from agentgraph.input import ChunkingService, analyze_trace_characteristics
    from agentgraph.extraction import SlidingWindowMonitor
    from agentgraph.reconstruction import PromptReconstructor, reconstruct_prompts_from_knowledge_graph
    from agentgraph.testing import KnowledgeGraphTester
    from agentgraph.causal import analyze_causal_effects, generate_causal_report
"""

# Import core components from each functional area
from .input import (
    ChunkingService,
    analyze_trace_characteristics, 
    display_trace_summary,
    preprocess_content_for_cost_optimization
)
# NOTE: High-level functionality restored after fixing evaluation module dependency
from .extraction import SlidingWindowMonitor
from .reconstruction import (
    PromptReconstructor, 
    reconstruct_prompts_from_knowledge_graph,
    enrich_knowledge_graph_with_prompts as enrich_reconstruction_graph
)
from .testing import run_knowledge_graph_tests
from .causal import analyze_causal_effects, enrich_knowledge_graph as enrich_causal_graph, generate_report as generate_causal_report

# Import parser system for platform-specific trace analysis
from .input.parsers import (
    BaseTraceParser, LangSmithParser, ParsedMetadata,
    create_parser, detect_trace_source, parse_trace_with_context,
    get_context_documents_for_source
)

# Import shared models and utilities
from .shared import *

__version__ = "0.1.0"

__all__ = [
    # Core components - High-level functionality restored! 🚀
    'ChunkingService',
    'SlidingWindowMonitor',  # ✅ Restored after fixing evaluation dependency
    'PromptReconstructor',
    'run_knowledge_graph_tests',
    'analyze_causal_effects',
    'enrich_causal_graph',
    'generate_causal_report',
    
    # Input analysis functions
    'analyze_trace_characteristics',
    'display_trace_summary',
    'preprocess_content_for_cost_optimization',
    
    # Reconstruction functions - ✅ Restored!
    'reconstruct_prompts_from_knowledge_graph',
    'enrich_reconstruction_graph',
    
    # Parser system
    'BaseTraceParser', 'LangSmithParser', 'ParsedMetadata',
    'create_parser', 'detect_trace_source', 'parse_trace_with_context',
    'get_context_documents_for_source',
    
    # Shared models and utilities
    'Entity', 'Relation', 'KnowledgeGraph',
    'ContentReference', 'Failure', # 'Report' - might not exist
]