AlgoGenie is an AI-powered multi-agent system designed to help you solve Data Structures and Algorithms (DSA) problems with ease. It takes your problem description in natural language, generates an algorithm, converts it into executable Python code, runs it safely, and provides an explanation — all in one seamless pipeline.
This project is built using the powerful Microsoft AutoGen framework, which makes it easy to orchestrate specialized AI agents working together.
- Accepts your DSA problem in natural language (e.g. “Find all students with marks above 85.”).
- Generates an algorithm explanation in plain English.
- Produces clean, executable Python code for the problem.
- Executes the code in a sandboxed Docker container for safety.
- Returns both the code and the output so you can confirm correctness.
- Python
- Microsoft AutoGen
- Docker
- Streamlit (for UI)
- Multi-Agent System Architecture
AlgoGenie uses a multi-agent round-robin model where specialized AI agents collaborate:
- DSA Expert Agent → Reads the problem statement and proposes an algorithm in plain English
- Python Expert Agent → Converts the algorithm into Python code
- Python Runner Agent (UserProxyAgent) → Runs the code safely inside Docker and returns outputs
This approach mirrors how human teams work—specialists collaborating to deliver a robust solution.
DSA-Solver/
│
├── AutoGen Basics/
│ ├── example.py # Sample AutoGen code example
│ ├── team_example.py # Example of using multiple agents as a team
│ ├── requirements.txt # Python dependencies for AutoGen basics
│ ├── diagram-export-...png # Diagram illustrating architecture or workflow
│
├── env-algogenie/ # Python virtual environment (Conda/venv)
│
├── Research/
│ ├── Project Structure.ipynb # Jupyter notebook explaining project structure
│ ├── requirements.txt # Python dependencies for research experiments
│ ├── output-*.lua # Lua output files from experiments or agents
│ ├── agent-backend.py # Python backend for research agents
│ └── agent-backend enhanced.py # Enhanced version of agent-backend.py
│
├── AlgoGenie/
│ ├── agents/
│ │ ├── __pycache__/ # Compiled Python bytecode cache
│ │ ├── code_executor_agent.py # Agent for executing generated Python code
│ │ └── problem_solver.py # Agent for understanding DSA problems
│ │
│ ├── config/
│ │ ├── __pycache__/ # Compiled Python bytecode cache
│ │ ├── constant.py # Constants and config values
│ │ └── docker_utils.py # Utility functions for managing Docker execution
│ │
│ ├── teams/
│ │ ├── __pycache__/ # Compiled Python bytecode cache
│ │ └── dsa_team.py # Defines the multi-agent team orchestration
│ │
│ ├── temp/ # Temporary files or working directory
│ ├── app.py # Streamlit app entry point for AlgoGenie UI
│ ├── main.py # Main script to run the application
│ └── requirements.txt # Python dependencies for AlgoGenie
│
├── LICENSE.txt # License file (MIT, etc.)
└── README.md # Root project documentation
git clone https://github.com/kunalmishravitb/Algo-Genie.git
cd Algo-Geniepython -m venv env-algogenie
source env-algogenie/bin/activateFrom inside the AlgoGenie folder:
pip install -r requirements.txtThe Python Runner Agent executes code safely inside a Docker container. Make sure Docker Desktop is running on your system.
Run the Streamlit app:
streamlit run app.pyPrompt:
“Write code to add two numbers represented as linked lists.”
Output:
- Explanation of algorithm
- Python code
- Execution result verifying correctness
- All code execution happens in Docker for isolation.
- Secrets and API keys (if any) are managed via
.envfiles and never committed to GitHub.
MIT License
Built with ❤️ and curiosity by Kunal Mishra.