DiagramBot.ai is an AI-powered tool designed to generate Mermaid diagrams through simple chat-based interaction. It leverages Google Generative AI to help users create a wide variety of diagrams such as flowcharts, ER diagrams, pie charts, and more—without needing to manually write code or understand the underlying Mermaid syntax.
- AI-Powered Diagram Generation: Simply describe the diagram you need, and the tool will generate the corresponding Mermaid code and visual representation.
- Supported Diagram Types:
- Flowcharts (
graph TD
,graph LR
) - Pie Charts (
pie
) - Gantt Charts (
gantt
) - Sequence Diagrams (
sequenceDiagram
) - Class Diagrams (
classDiagram
) - State Diagrams (
stateDiagram
) - Entity-Relationship Diagrams (ERD) (
erDiagram
)
- Flowcharts (
- Versatile Output: Diagrams can be downloaded in PNG, PDF, or Mermaid code formats.
- Editable Diagrams: Users can edit the generated Mermaid code directly within the tool and regenerate the diagram.
TBA
- Python 3.7+
- Google Generative AI API Key: DiagramBot.ai uses Google Generative AI to generate diagrams. Make sure you have an API key from Google. Set it in your environment variables as
GEMINI_API_KEY
.
-
Clone the repository:
git clone https://github.com/mrnithesh/DiagramBot-ai.git cd DiagramBot.ai
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set your Google Generative AI API Key in the environment:
export GEMINI_API_KEY=your_google_api_key
Start the Streamlit app using the following command:
streamlit run app.py
- Chat with the AI: Enter your description of the diagram (e.g., "Create a flowchart for a login system") in the chat interface.
- View and Download Diagrams: The generated diagram will be displayed alongside options to download the diagram as PNG, PDF, or Mermaid code.
- Edit Mermaid Code: You can manually edit the generated Mermaid code in the code tab and regenerate the diagram with the updated code.
Here are some example queries you can use with DiagramBot.ai:
- "Generate a flowchart showing the process of logging in, checking credentials, and accessing the dashboard."
- "Create an ER diagram with a customer placing an order for a product."
- "Show a Gantt chart for a project with development, testing, and deployment phases."
DiagramBot.ai supports the following types of diagrams:
- Flowcharts: Visualize step-by-step processes using
graph TD
orgraph LR
. - Pie Charts: Create percentage-based pie charts.
- Gantt Charts: Plan project timelines with start dates and durations.
- Sequence Diagrams: Show how entities communicate with each other over time.
- Class Diagrams: Define classes and relationships in an object-oriented structure.
- State Diagrams: Represent the state transitions of a system.
- Entity-Relationship Diagrams (ERD): Model relationships between data entities.
Contributions are welcome! Here's how you can help:
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature
- Make your changes and commit them:
git commit -m "Add a new feature"
- Push your branch to your forked repository:
git push origin feature/your-feature
- Open a pull request with a description of your changes.
If you encounter any bugs or have feature requests, feel free to open an issue in the Issues section. I’m always open to feedback and ideas to improve the tool.
This project is licensed under the MIT License. See the LICENSE file for details.
- GitHub: github.com/mrnithesh
- LinkedIn: linkedin.com/in/mrnithesh
Feel free to reach out if you have any questions, ideas, or suggestions for DiagramBot.ai!