git:20260907.ae194c2 to git:20260917.482a267

22 added, 15 removed. Audit A to A.

# SymPy Documentation Agent
> **๐Ÿ“‹ Document Metadata**
> **Type**: Symbolic Mathematics Integration Agent | **Audience**: Researchers, Mathematicians | **Complexity**: Intermediate-Advanced
> **Cross-References**: [README.md](README.md) | [SymPy GNN Guide](gnn_sympy.md) | [MCP Integration](../mcp/README.md) | [Mathematical Foundations](../gnn/advanced/advanced_modeling_patterns.md) | [Main Documentation](../README.md)
## Overview
This directory contains comprehensive documentation, resources, and implementation guides for integrating **SymPy** (Symbolic Mathematics Library) with GNN (Generalized Notation Notation). SymPy provides symbolic computation capabilities through the Model Context Protocol (MCP), enhancing mathematical processing for Active Inference model specification, validation, and analysis.
- **Status**: โœ… Production Ready
+ > **Scope note**: SymPy is integrated as an MCP tool surface (`src/gnn/mcp/sympy_mcp.py`, `sympy_mcp_client.py`), not as a render or execution framework. It is not an entry in `src/gnn/render/framework_registry.py`, has no Step 12 executor, and does no continuous linear-Gaussian rendering.
+
+ **Status**: MCP tool integration implemented in `src/gnn/mcp/` (8 SymPy tools registered via Step 21); SymPy itself is not a render/execution framework
**Version**: 1.0
## Purpose
SymPy integration enables:
- **Mathematical Validation**: Validate mathematical expressions in GNN files
- **Expression Simplification**: Simplify and canonicalize GNN equations
- **LaTeX Generation**: Consistent mathematical formatting
- **Symbolic Analysis**: Symbolic manipulation of Active Inference equations
- **MCP Integration**: Model Context Protocol server for AI agent interaction
## Contents
**Files**: 4 | **Subdirectories**: 1
## Quick Navigation
- **README.md**: [Directory overview](README.md)
- **GNN Documentation**: [gnn/AGENTS.md](../gnn/AGENTS.md)
- **Main Documentation**: [docs/README.md](../README.md)
- **Pipeline Reference**: [src/gnn/AGENTS.md](../../src/gnn/AGENTS.md)
## Documentation Structure
This module is organized as follows:
- **Overview**: High-level description and purpose
- **Contents**: Files and subdirectories
- **Integration**: Connection to the broader pipeline
- **Usage**: How to work with this subsystem
## Integration with Pipeline
- This documentation is integrated with the 25-step GNN processing pipeline:
+ This documentation references the 25-step GNN processing pipeline as follows:
- ### Core Processing (Steps 0-9)
- - **Step 3 (GNN)**: SymPy validation of equation sections
- - **Step 5 (Type Checker)**: Mathematical expression validation
- - **Step 6 (Validation)**: Expression simplification and canonicalization
+ The implemented integration point is **Step 21 (MCP)**: SymPy MCP tool registration.
+ Other touchpoints listed below are **proposals**, not implemented behavior:
- ### Simulation (Steps 10-16)
- - **Step 11 (Render)**: Symbolic computation for code generation
- - **Step 13 (LLM)**: SymPy MCP integration for LLM analysis
- - **Step 16 (Analysis)**: Mathematical validation and analysis
+ ### Implemented
- ### Integration (Steps 17-24)
- - **Step 21 (MCP)**: SymPy MCP tool registration
- - **Step 23 (Report)**: Mathematical documentation generation
+ - **Step 21 (MCP)**: SymPy MCP tool registration (`src/gnn/mcp/sympy_mcp.py`)
+ ### Proposed (not implemented)
+
+ - **Step 3 (GNN)**: SymPy validation of equation sections
+ - **Step 5 (Type Checker)**: mathematical expression validation via SymPy
+ - **Step 11 (Render)** / **Step 12 (Execute)**: no SymPy render target or executor exists
+
+
See [src/gnn/AGENTS.md](../../src/gnn/AGENTS.md) for complete pipeline documentation.
- ## Function Signatures and API
+ ## Function Signatures and API (proposed โ€” not implemented)
+ The signatures below are illustrative sketches of a pipeline-level validation API;
+ the implemented surface is the eight `sympy_*` MCP tools in
+ `src/gnn/mcp/sympy_mcp.py` (e.g. `sympy_validate_equation`,
+ `sympy_validate_matrix`, `sympy_simplify_expression`, `sympy_get_latex`).
+
### Symbolic Computation Functions
```python
def validate_gnn_equations(gnn_equations: List[str]) -> Dict[str, ValidationResult]:
"""
Validate mathematical expressions from GNN Equations section.
Parameters:
gnn_equations: List of equation strings from GNN file
Returns:
Dictionary mapping equations to validation results
"""
def simplify_expression(expression: str) -> str:
"""
Simplify mathematical expression using SymPy.
Parameters:
expression: Mathematical expression string
Returns:
Simplified expression string
"""
```
## Standards and Guidelines
All documentation in this module adheres to professional standards:
- **Clarity**: Concrete, technical writing
- **Functionality**: Describes actual capabilities
- **Completeness**: Comprehensive coverage
- **Consistency**: Uniform structure and style
## Related Resources
### Main GNN Documentation
- **[GNN Overview](../gnn/gnn_overview.md)**: Core GNN concepts
- **[GNN Quickstart](../gnn/tutorials/quickstart_tutorial.md)**: Getting started guide
- **[Mathematical Foundations](../gnn/advanced/advanced_modeling_patterns.md)**: Mathematical modeling
### Mathematical Resources
- **[MCP Integration](../mcp/README.md)**: Model Context Protocol
- **[Type Checking](../../src/gnn/type_checker/AGENTS.md)**: Type validation
- **[Mathematical Foundations](../gnn/advanced/advanced_modeling_patterns.md)**: Mathematical modeling
### Pipeline Architecture
- **[Pipeline Documentation](../gnn/operations/gnn_tools.md)**: Complete pipeline guide
- **[Pipeline AGENTS](../../src/gnn/AGENTS.md)**: Implementation details
- **[Pipeline README](../../src/gnn/README.md)**: Pipeline overview
## See Also
- **[SymPy Cross-Reference](../CROSS_REFERENCE_INDEX.md#sympy)**: Cross-reference index entry
- **[MCP Integration](../mcp/README.md)**: Model Context Protocol
- **[Mathematical Foundations](../gnn/advanced/advanced_modeling_patterns.md)**: Mathematical modeling
- **[Main Index](../README.md)**: Return to main documentation
---
- **Status**: โœ… Production Ready
+ **Status**: MCP tool integration implemented in `src/gnn/mcp/` (8 SymPy tools registered via Step 21); SymPy itself is not a render/execution framework
**Compliance**: Professional documentation standards
**Maintenance**: Regular updates with new SymPy features and integration capabilities