A powerful, AI-assisted visual flow authoring tool built with Next.js 15, React Flow, and LangChain. Design interactive flow diagrams with natural language AI assistance for creating, modifying, and managing nodes and connections.
- Interactive Canvas: Drag, drop, and connect nodes with an intuitive interface
- Real-time Editing: Edit node labels inline with immediate updates
- Multiple Node Types: Support for Action, AI Model, and Data Source nodes
- Custom Edges: Beautiful custom edge styling and animations
- Zoom & Pan: Full canvas navigation with minimap support
- Natural Language Commands: Modify flows using plain English
- Smart Node Management: Add, update, delete, and connect nodes via AI
- Context-Aware: Understands current flow state for intelligent suggestions
- Powered by Groq: Fast LLM responses using LangChain integration
- Persistent Storage: Automatic saving with local storage persistence
- Undo/Redo: Full history tracking with 50-step undo support
- Flow Save/Load: Save multiple flow configurations
- Export/Import: JSON-based flow sharing and backup
- Dark/Light Theme: Seamless theme switching
- Responsive Design: Works across desktop and mobile devices
- Accessible Components: Built with Radix UI primitives
- Smooth Animations: Framer Motion powered transitions
- Next.js 15: App Router with Server Actions
- React 19: Latest React features and performance improvements
- TypeScript 5: Type-safe development
- Tailwind CSS: Utility-first styling
- shadcn/ui: Beautiful, accessible component library
- Radix UI: Headless UI primitives
- React Flow 11: Professional flow diagram library
- Zustand: Lightweight state management
- Framer Motion: Smooth animations and transitions
- LangChain: AI orchestration framework
- Groq: High-performance LLM inference
- Zod: Schema validation for AI responses
- Node.js 18.x or later
- npm, yarn, or pnpm
-
Clone the repository
git clone <repository-url> cd aiflow-builder
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
cp .env.example .env.local
Add your Groq API key:
GROQ_API_KEY=your_groq_api_key_here
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
-
Add Nodes: Use the AI assistant panel to add nodes:
"Add a data source node called 'User Input'" "Create an AI model node for processing" "Add an action node named 'Send Email'" -
Connect Nodes: Either drag connections manually or use AI:
"Connect User Input to AI Model" "Link the AI Model to Send Email action" -
Edit Nodes: Click on any node to edit its label inline, or use AI:
"Change the User Input node to 'Customer Data'" "Update the action node label to 'Generate Report'"
The AI assistant understands various natural language commands:
- Creating: "Add a new action node", "Create a data source"
- Connecting: "Connect node A to node B", "Link these nodes"
- Updating: "Change the label to X", "Rename this node"
- Deleting: "Remove this node", "Delete the connection"
- Layout: "Organize the nodes", "Arrange horizontally"
Ctrl/Cmd + Z: UndoCtrl/Cmd + Y: RedoCtrl/Cmd + S: Save flowDelete: Delete selected nodes/edgesEscape: Deselect all
aiflow-builder/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
βββ components/ # React components
β βββ flow/ # Flow-related components
β β βββ FlowEditor.tsx # Main flow canvas
β β βββ FlowControls.tsx # Flow controls
β β βββ nodes/ # Node components
β β βββ edges/ # Edge components
β βββ layout/ # Layout components
β β βββ ai-assistant-panel.tsx
β β βββ header.tsx
β βββ ui/ # shadcn/ui components
βββ store/ # Zustand stores
β βββ useFlowStore.ts # Flow state management
βββ lib/ # Utilities
β βββ utils.ts
βββ hooks/ # Custom React hooks
The project uses Tailwind CSS v4 with custom configuration in postcss.config.mjs.
ESLint is configured with Next.js recommended rules in eslint.config.mjs.
TypeScript configuration is in tsconfig.json with strict mode enabled.
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on every push
# Build the image
docker build -t aiflow-builder .
# Run the container
docker run -p 3000:3000 aiflow-builder# Build the project
npm run build
# Start the production server
npm startWe welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Use conventional commit messages
- Add tests for new features
- Update documentation as needed
- Ensure components are accessible
// Node management
addNode(node: Node): void
updateNode(nodeId: string, updates: Partial<Node>): void
deleteNode(nodeId: string): void
// Edge management
addEdge(connection: Connection | Edge): void
deleteEdge(edgeId: string): void
// History management
undo(): void
redo(): void
pushToHistory(): void
// Persistence
saveFlow(name: string): string
loadFlow(flowId: string): booleanThe AI assistant processes natural language commands and returns structured operations:
interface FlowOperation {
action: string
nodeId?: string
nodeType?: 'dataSource' | 'aiModel' | 'action'
nodeLabel?: string
nodePosition?: { x: number; y: number }
sourceId?: string
targetId?: string
}Build Errors
- Ensure all dependencies are installed
- Check Node.js version compatibility
- Verify TypeScript configuration
AI Assistant Not Working
- Check Groq API key configuration
- Verify environment variables are set
- Check network connectivity
Performance Issues
- Enable React Strict Mode for development
- Use React DevTools for debugging
- Check for memory leaks in large flows
This project is licensed under the MIT License - see the LICENSE file for details.
- React Flow for the excellent flow diagram library
- shadcn/ui for the beautiful component system
- Radix UI for accessible primitives
- LangChain for AI orchestration
- Groq for fast LLM inference
Made with β€οΈ by the Sai Aryan Goswami