| name | gnn-llm-analysis |
| description | GNN LLM-enhanced analysis and model interpretation. Use when generating natural language descriptions of GNN models, getting AI-assisted model explanations, or performing LLM-powered analysis of Active Inference specifications. |
GNN LLM Analysis (Step 13)
Purpose
Provides LLM-enhanced analysis of GNN models including natural language interpretation, model summarization, structural analysis, and AI-assisted insights using multiple provider backends.
Key Commands
python src/13_llm.py --target-dir input/gnn_files --output-dir output --verbose
python src/main.py --only-steps 13 --verbose
Provider Recovery Chain
The LLM module supports multiple providers with automatic recovery:
- Ollama (local) — Preferred for privacy and speed
- OpenAI — GPT-4/3.5 API
- Anthropic / OpenRouter — Additional providers
API
from llm import (
process_llm, LLMProcessor, LLMAnalyzer,
analyze_gnn_file_with_llm, extract_variables, extract_connections,
perform_semantic_analysis, generate_model_insights,
generate_documentation, generate_llm_summary,
get_available_providers, get_module_info
)
process_llm(target_dir, output_dir, verbose=True)
processor = LLMProcessor()
result = processor.analyze(gnn_content)
description = processor.generate_description(gnn_content)
analyzer = LLMAnalyzer()
insights = analyzer.analyze_content(gnn_content)
result = await analyze_gnn_file_with_llm(content)
variables = extract_variables(content)
connections = extract_connections(content)
providers = get_available_providers()
Key Exports
LLMProcessor — class with analyze(), analyze_model(), generate_description()
LLMAnalyzer — class with analyze_content(), extract_insights()
analyze_gnn_file_with_llm — async full analysis
extract_variables, extract_connections, extract_sections — component extraction
generate_model_insights, generate_documentation, generate_llm_summary
UnifiedLLMProcessor, AnalysisType, ProviderType — advanced provider API
Dependencies
uv sync
Output
- LLM analysis reports in
output/13_llm_output/
- Natural language model summaries
- AI-generated insights and recommendations
MCP Tools
This module registers tools with the GNN MCP server (see mcp.py):
analyze_gnn_with_llm
generate_llm_documentation
get_llm_module_info
get_llm_providers
process_llm
References
Documentation
- README: Module Overview
- AGENTS: Agentic Workflows
- SPEC: Architectural Specification
- SKILL: Capability API