Spaces:
Running
Running
| 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 | |
| ] | |