๐Ÿค– Self-Documentation Agent System

An AI-powered system that automatically analyzes, documents, and validates Python code using LangGraph workflows and Google's Gemini 2.5 Flash model.

โœจ Features

  • ๐Ÿง  Intelligent Documentation: Adds comprehensive docstrings and comments
  • ๐Ÿ” Code Analysis: Identifies issues and provides recommendations
  • ๐Ÿงช Automated Testing: Executes code with various test scenarios
  • ๐Ÿ“‹ Professional Output: Clean, business-appropriate formatting
  • ๐ŸŒ Library Research: Uses web search to understand unfamiliar libraries

๐Ÿš€ How to Use

  1. ๐Ÿ”‘ Enter API Keys: Get your free keys from the links below
  2. ๐Ÿ“ Add Your Code: Paste Python code or use the sample
  3. โšก Process: Click "Analyze & Document Code"
  4. ๐Ÿ“Š Review Results: Check documented code and analysis

๐Ÿ’ก Tip: The system works best with functions, classes, and complete code snippets!

๐Ÿ”‘ API Configuration

๐Ÿ“ Input Code

Ready to analyze code. Please provide your API keys and code.

๐Ÿ“š Documented Code

๐Ÿ” Analysis Results

Workflow Steps

  1. Research Node: Analyzes code structure, identifies libraries, and checks existing documentation
  2. Document Node: Adds comprehensive docstrings and inline comments using Google style
  3. Analyze Node: Executes code with various test scenarios and identifies potential issues
  4. Final Node: Saves results and provides summary

What You Get

  • Enhanced Code: Your original code with professional documentation
  • Detailed Analysis: Comprehensive testing results and recommendations
  • Issue Identification: Potential problems and improvement suggestions
  • Usage Guidelines: Instructions for implementation and testing

API Keys Required

  • Google API Key: Get it from Google AI Studio
  • Tavily API Key: Get it from Tavily for web search functionality

Technologies Used

  • LangGraph: Workflow orchestration and state management
  • Google Gemini 2.5 Flash: Advanced language model for analysis
  • Tavily Search: Web search for library research
  • Python AST: Code structure analysis
  • Code Execution Tools: Safe code testing environment

Supported Features

  • Function and class documentation
  • Inline code comments
  • Error handling analysis
  • Performance recommendations
  • Security issue identification
  • Test case generation
  • I/O behavior documentation