Syntax Sage is an intelligent web application designed to enhance coding education through automated code analysis and feedback. Leveraging CrewAI, it employs a team of AI agents to provide comprehensive insights into submitted code.
Syntax Sage provides an intuitive user interface for code analysis. Below is a screenshot of the main interface:
The interface consists of two main sections:
-
Code Input (Left Side):
- A text area where users can input their Python code.
- The image shows a sample Python function for creating a full pyramid pattern.
- A "Run Code" button at the bottom to submit the code for analysis.
-
Agent Outputs (Right Side):
- Four distinct sections for different types of analysis:
- Code Execution Agent
- Code Summary Agent
- Code Suggestion Agent
- Time Complexity Estimation Agent
- Each agent provides specialized feedback in its respective section.
- Four distinct sections for different types of analysis:
This layout allows users to easily input their code and receive comprehensive feedback from multiple perspectives, all in one view.
- 🤖 Automated Code Analysis: Utilizes a crew of AI agents to analyze submitted code from multiple perspectives.
- 🏃♂️ Code Compilation and Execution: Compiles and executes code, providing immediate output or error messages.
- 🔧 Optimization Suggestions: Analyzes code for optimization opportunities and calculates time and space complexity.
- 📚 Comprehensive Explanations: Generates clear, concise summaries and explanations of code structures and algorithms.
- 📊 Performance Tracking: Monitors and analyzes student coding patterns over time, tracking improvements in various aspects.
- Backend: Python, Flask
- AI Framework: CrewAI
- Language Models: Ollama (llama3.1:latest)
- Frontend: HTML, CSS (embedded in Flask template)
Syntax Sage employs four specialized AI agents:
- 👨💻 Code Compiler and Executor: Compiles and executes submitted code accurately.
- 🔍 Code Optimization Specialist: Analyzes code for optimization opportunities and complexity.
- 📘 Code Explanation Expert: Generates clear summaries and explanations of code.
- 📈 Student Performance Analyst:: Monitors and analyzes student coding patterns over time.
Before you begin, ensure you have met the following requirements:
- Python 3.7+
- pip (Python package manager)
- Ollama installed and running with the llama3.1:latest model
-
Clone the repository
git clone https://github.com/akhil-varsh/SyntaxSage.git -
Navigate to Folder
cd SyntaxSage -
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install the required packages
pip install flask crewai langchain-community
-
Start the Flask application:
python app.py -
Open your web browser and navigate to
http://localhost:5000. -
In the left panel, enter your code in the text area provided.
-
Click the "Analyze Code" button to submit your code.
-
View the results in the right panel, which will include output from all four AI agents:
- Compilation and execution results
- Optimization and complexity analysis
- Code explanation and summary
- Performance tracking insights
- When code is submitted, Syntax Sage creates tasks for each AI agent based on the input.
- The CrewAI framework orchestrates these agents, allowing them to work together to analyze the code.
- Each agent performs its specialized task:
- The Code Compiler and Executor compiles and runs the code.
- The Code Optimization Specialist analyzes for improvements and complexity.
- The Code Explanation Expert provides a clear summary.
- The Student Performance Analyst tracks progress over time.
- The results from all agents are collected and presented in the user interface.
Contributions to Syntax Sage are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the CrewAI team for their powerful AI orchestration framework.
Made with ❤️ by Akhil
