Using a simple drag-and-drop interface, you can design workflows that answer questions, search the web, process documents, and automate tasks. All workflows are created and managed on a visual canvas, allowing you to see how each component works together. You can test your assistants in real time, adjust their behavior, and deploy them with confidence.
- β‘ Quick Start with Docker
- π» Local Development (Python venv / Conda)
- π§ VS Code Debugging
- π§± Project Structure
- β¨ App Overview
- π Repository Stats
- π Contributing
- π Troubleshooting
- π€ Code of Conduct
- π License
Rename `.env.example` to `.env` in the project root directory and update the values as needed.docker compose up -dOnce running, open:
- Frontend: http://localhost:23058
- Backend (Swagger): http://localhost:23056/docs
Prerequisites
- Python 3.11
- Node.js β₯ 18.15
Rename `.env.example` to `.env` in the project root directory and update the values as needed.Replace host.docker.internal with 127.0.0.1 in the DATABASE_URL variable in the .env file.python -m venv .venv
# Windows (Command Prompt)
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install --upgrade pip
pip install -r backend/requirements.txtconda create -n kai-flow python=3.11 -y
conda activate kai-flow
pip install -r backend/requirements.txtdocker run --name kai ^
-e POSTGRES_DB=kai ^
-e POSTGRES_USER=kai ^
-e POSTGRES_PASSWORD=kai ^
-p 5432:5432 ^
-d postgres:15Ensure your PostgreSQL container is running, then:
python backend/migrations/database_setup.pypython backend/main.pycd client
npm install
npm run dev
# Open the printed Vite URL (e.g. http://localhost:5173)To run the backend with HTTPS locally, generate self-signed certificates:
cd backend/cert
# Windows (PowerShell)
$env:OPENSSL_CONF="C:\Program Files\Git\usr\ssl\openssl.cnf"; openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/C=TR/ST=Istanbul/L=Istanbul/O=KAI/OU=Dev/CN=localhost"
# macOS / Linux
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/C=TR/ST=Istanbul/L=Istanbul/O=KAI/OU=Dev/CN=localhost"A standalone chat widget for embedding KAIβFlow agents into other sites.
cd widget
npm install
npm run devCreate the folder: .vscode/ at the repository root and add launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Backend Main",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/backend/main.py",
"console": "integratedTerminal",
"env": { "DOTENV_PATH": "${workspaceFolder}/.env" }
}
]
}KAI-Flow/
ββ backend/ # FastAPI Backend (Python 3.11)
β ββ app/
β β ββ api/ # REST API endpoints
β β ββ auth/ # Authentication logic
β β ββ core/ # Core utilities (config, engine, etc.)
β β ββ middleware/ # Custom middleware
β β ββ models/ # SQLAlchemy database models
β β ββ nodes/ # Workflow node definitions
β β β ββ agents/ # AI Agent nodes
β β β ββ llms/ # LLM provider nodes
β β β ββ tools/ # Tool nodes (web search, code, etc.)
β β β ββ memory/ # Memory / context nodes
β β β ββ embeddings/ # Embedding nodes
β β β ββ vector_stores/ # Vector store nodes
β β β ββ splitters/ # Text splitter nodes
β β β ββ triggers/ # Workflow trigger nodes
β β β ββ document_loaders/
β β ββ schemas/ # Pydantic schemas
β β ββ services/ # Business logic services
β β ββ routes/ # Route definitions
β ββ migrations/ # Database setup scripts
β ββ main.py # Application entry point
β ββ requirements.txt # Python dependencies
ββ client/ # React 19 Frontend
β ββ app/
β β ββ components/ # React components
β β β ββ canvas/ # Workflow canvas
β β β ββ nodes/ # Node UI components
β β β ββ modals/ # Configuration modals
β β ββ routes/ # Page routes
β β ββ services/ # API service layer
β β ββ stores/ # Zustand state stores
β β ββ lib/ # Utilities
β ββ package.json
β ββ vite.config.ts
ββ widget/ # Embeddable Chat Widget
β ββ src/ # Widget source
β ββ widget.js # Pre-built widget bundle
β ββ package.json
ββ docs/ # Documentation (MkDocs)
ββ .env.example # Environment variable template
ββ docker-compose.yml # Docker Compose configuration
ββ Dockerfile # Backend Docker image
ββ README.md
- Visual Workflow Builder: Drag-and-drop interface powered by XYFlow 12 for creating AI agents and chains.
- Modern Tech Stack: React 19.1, React Router 7, Vite 6.3, Tailwind 4.1, DaisyUI 5 (Frontend) + FastAPI 0.116, LangChain 0.3, LangGraph 0.6 (Backend).
- AI/ML Framework: Integrated LangChain, LangGraph, and LangSmith for building and debugging complex agent flows.
- Vector Database: PostgreSQL with pgvector for embedding storage and semantic search.
- Node Types: LLMs, Agents, Tools (Web Search, Code Execution), Memory, Embeddings, Vector Stores, Document Loaders, Text Splitters, Triggers.
- Embeddable Widget: Export your agents as an embeddable widget (
@kaiflow/widgeton npm). - Secure: JWT-based authentication with Keycloak integration support.
- Scheduling: Built-in cron-based workflow scheduling with APScheduler.
| Metric | Badge |
|---|---|
| All releases (total) | |
| Latest release | |
| Stars (live) | |
| Forks (live) |
We welcome PRs! Please:
- Open an issue describing the change or bug.
- Fork the repo and create a feature branch.
- Add or adjust tests where applicable.
- Open a PR with a clear description and screenshots/GIFs.
β Stargazers Β· π΄ Forkers
Port 5432 already in use
- Stop any existing Postgres:
docker ps, thendocker stop <container> - Or change the host port mapping:
-p 5433:5432
Cannot connect to Postgres
- Verify env values in the root
.envfile - Ensure container is healthy:
docker logs kai
Migrations didnβt run / tables missing
- Re-run from backend directory:
python -m migrations.database_setup - Ensure
CREATE_DATABASE=truein the root.envfile
Frontend cannot reach backend
- Check
client/.envβVITE_API_BASE_URL=http://localhost:8000 - CORS: ensure backend CORS is configured for your dev origin
VS Code doesnβt load env
- Using our snippet? Make sure your app reads
DOTENV_PATH - Alternative: VS Code
"envFile": "${workspaceFolder}/.env"
Please follow our Contributor Covenant Code of Conduct to keep the community welcoming.
Source code is available under the Apache License 2.0 β see LICENSE for details.


