This project converts natural language prompts into code using AI agents and tools.
- Python backend for agent logic
- Web frontend in
generated_project/(HTML, CSS, JS) - Modular design with
agent/for graph, prompt, states, and tools
Prompt2Code is an AI-powered engineering project generator. It takes natural language prompts and produces a complete codebase, including backend logic and a web frontend.
- Agent System:
- Modular agents: Planner, Architect, Coder
- Uses LangChain, LangGraph, and Groq LLM for reasoning and code generation
- Agents communicate via a state graph (
agent/graph.py)
- Tools:
- File operations, directory listing, and shell commands are abstracted in
agent/tools.py
- File operations, directory listing, and shell commands are abstracted in
- State Management:
- Project plans, implementation steps, and file purposes are modeled in
agent/states.py
- Project plans, implementation steps, and file purposes are modeled in
- Prompts:
- Custom prompt templates for each agent in
agent/prompt.py
- Custom prompt templates for each agent in
- Located in
generated_project/ - Includes a responsive Todo App (
index.html,styles.css,script.js) - Features: Add, edit, delete, filter, and persist todos in local storage
groq,langchain,langchain-core,langchain-groq,langgraph,pydantic,python-dotenv
- Set your Groq API key in
.env(never commit secrets)
.idea/folder for JetBrains IDEs (PyCharm, etc.)- VS Code settings supported via
.vscode/
- Add new agent logic in
agent/ - Extend frontend features in
generated_project/
- Clone the repository
- Install Python dependencies (see
pyproject.toml) - Configure your environment variables in
.env(do not commit secrets) - Start the backend:
python main.py - Open
generated_project/index.htmlin your browser
main.py— Entry point for backendagent/— Core agent logicgenerated_project/— Web frontend
Pull requests are welcome. For major changes, please open an issue first.
MIT
