AGENTS.md@docs/sympy · git:20260906.82c8031 · 2026-09-06 · sha256 7104b5db18890cdf

AGENTS.md@docs/sympy git:20260906.82c8031A

Immutable. This exact content is served forever at /api/v1/blob/7104b5db18890cdf.

# 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  
**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**: [doc/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:

### 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

### 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

### Integration (Steps 17-24)
- **Step 21 (MCP)**: SymPy MCP tool registration
- **Step 23 (Report)**: Mathematical documentation generation

See [src/gnn/AGENTS.md](../../src/gnn/AGENTS.md) for complete pipeline documentation.

## Function Signatures and API

### 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  
**Compliance**: Professional documentation standards  
**Maintenance**: Regular updates with new SymPy features and integration capabilities