Skip to content

KAI-Flow v0.1 Alpha

Choose a tag to compare

@MetehanaydemirKafein MetehanaydemirKafein released this 26 Dec 20:52
· 180 commits to test since this release
f62cabe

KAI-Fusion v0.1 Alpha - First Release

Release Date: December 26, 2025
Version: 0.1.0-alpha


🎉 Welcome to KAI-Fusion!

We're thrilled to announce the first alpha release of KAI-Fusion, an enterprise-grade AI workflow orchestration platform built on LangGraph and LangChain. KAI-Fusion empowers developers and organizations to build sophisticated, visual AI workflows with a powerful drag-and-drop interface while maintaining complete control over their AI infrastructure.


🏗️ Platform Architecture

LangGraph-Based Workflow Engine

KAI-Fusion is built on LangGraph StateGraph, leveraging cutting-edge stateful workflow orchestration:

  • State Management: Uses FlowState for conversation and execution context management
  • Graph Compilation: GraphBuilder compiles visual workflows into executable LangGraph pipelines
  • Node Execution: NodeExecutor handles node-level execution within the graph
  • Control Flow: Advanced control flow management with conditional branching and parallel execution
  • Memory Persistence: PostgreSQL-backed memory storage with LangGraph checkpointing

Node Architecture

KAI-Fusion implements a sophisticated node classification system based on BaseNode:

  1. Provider Nodes - Create LangChain objects (LLMs, Tools, Embeddings)
  2. Processor Nodes - Orchestrate multiple inputs (Agents, Chains)
  3. Terminator Nodes - Transform and finalize outputs (Parsers, Formatters)
  4. Memory Nodes - Manage conversation state and persistence

📦 Available Nodes

🤖 LLM Nodes

OpenAI Language Model (OpenAINode)

  • Description: Advanced OpenAI GPT integration with streaming support
  • Supported Models: GPT-4, GPT-4-Turbo, GPT-3.5-Turbo, GPT-4o, GPT-4o-mini
  • Features:
    • Streaming responses with real-time output
    • Temperature and token limit control
    • System prompt customization
    • Response format configuration (JSON, text)
    • LangSmith tracing integration
  • Configuration:
    • API Key (credential-based authentication)
    • Model selection
    • Temperature (0.0 - 2.0)
    • Max tokens (1 - 32000)
    • Top P sampling
    • Frequency/Presence penalties

OpenAI Compatible (OpenAICompatibleNode)

  • Description: Universal connector for any OpenAI-compatible API endpoint
  • Supported Providers:
    • Commercial: OpenRouter, Groq, DeepSeek, Together AI, Perplexity
    • Local: LocalAI, vLLM, Ollama (compatibility mode), LM Studio
    • Self-hosted: Any OpenAI API-compatible server
  • Features:
    • Custom base URL configuration
    • Flexible model name input
    • Automatic provider-specific headers (e.g., OpenRouter)
    • Streaming support
    • Standard OpenAI parameters
    • Optional API key (for local servers)
  • Configuration:
    • Base URL (e.g., https://openrouter.ai/api/v1, http://localhost:8080/v1)
    • Model name (e.g., anthropic/claude-3.5-sonnet, llama3-70b-8192)
    • API Key (credential-based, optional for local)
    • Temperature (0.0 - 2.0)
    • Max tokens (1 - 200000)
    • Top P, Frequency/Presence penalties
    • Timeout configuration
    • OpenRouter-specific: Site URL and Site Name
  • Use Cases:
    • Access hundreds of models via OpenRouter
    • Connect to local LLM inference servers
    • Use alternative AI providers
    • Cost optimization with cheaper providers
    • Multi-provider fallback strategies

🔧 Tool Nodes

HTTP Client (HttpRequestNode)

  • Description: Universal HTTP client for external API integration
  • Supported Methods: GET, POST, PUT, PATCH, DELETE
  • Features:
    • Custom headers and authentication
    • Request/response body handling
    • Timeout configuration
    • SSL verification control
    • Jinja2 templating for dynamic requests
    • Retry logic with exponential backoff
  • Use Cases:
    • REST API integration
    • Web scraping
    • External service orchestration
    • Data retrieval and submission

Vector Retriever (VectorRetrieverNode)

  • Description: Semantic search and document retrieval from vector databases
  • Supported Backends: PGVector, Chroma, FAISS
  • Features:
    • Similarity search with configurable K
    • MMR (Maximal Marginal Relevance) retrieval
    • Metadata filtering
    • Hybrid search capabilities
    • Reranking with Cohere
  • Configuration:
    • Search type (similarity, MMR, threshold)
    • Top K results (1-100)
    • Score threshold (0.0-1.0)
    • Fetch K for MMR
    • Lambda diversity

Tavily Search (TavilySearchNode)

  • Description: Web search integration powered by Tavily API
  • Features:
    • Real-time web search
    • News and general search modes
    • Configurable result count
    • Domain filtering
    • Search depth control
  • Use Cases:
    • Real-time information retrieval
    • Research and fact-checking
    • News aggregation
    • Market intelligence

Cohere Reranker (CohereRerankerNode)

  • Description: Advanced reranking for search results using Cohere's models
  • Features:
    • Semantic reranking
    • Relevance scoring
    • Top N selection
    • Multi-language support
  • Integration: Works seamlessly with Vector Retriever

🧠 Agent Nodes

React Agent (ReactAgentNode)

  • Description: Reasoning and Acting (ReAct) agent with LangGraph integration
  • Architecture: Built on LangGraph's create_react_agent
  • Features:
    • Multi-tool orchestration
    • Step-by-step reasoning
    • Memory integration
    • LangSmith tracing
    • Streaming support
    • Error handling and recovery
  • Capabilities:
    • Dynamic tool selection
    • Context-aware decision making
    • Multi-turn conversations
    • Task decomposition
  • Configuration:
    • LLM provider connection
    • Tool connections (multiple)
    • Memory connection
    • Max iterations (1-50)
    • Verbose logging toggle

🧮 Memory Nodes

Buffer Memory (BufferMemoryNode)

  • Description: Complete conversation history storage with PostgreSQL persistence
  • Features:
    • Unlimited history retention
    • Database persistence across sessions
    • Session-aware storage
    • LangSmith tracing
    • Multi-tenancy support
  • Use Cases:
    • Long-form conversations
    • Complex problem solving
    • Research workflows
    • Training scenarios

Conversation Memory (ConversationMemoryNode)

  • Description: Sliding window memory for recent conversation context
  • Features:
    • Configurable window size (1-50 messages)
    • Session isolation
    • Memory optimization
    • Lazy loading
    • Auto cleanup
  • Configuration:
    • Window size (K messages)
    • Memory key
    • Compression options
    • Encryption support
  • Use Cases:
    • Real-time chat
    • Token-constrained scenarios
    • Performance-critical workflows

📄 Document Loaders

Document Loader (DocumentLoaderNode)

  • Description: Load and process documents from various sources
  • Supported Formats: PDF, TXT, CSV, JSON, DOCX, HTML
  • Features:
    • Batch processing
    • Metadata extraction
    • Encoding detection
    • Error handling

Web Scraper (WebScraperNode)

  • Description: Extract content from web pages
  • Features:
    • HTML parsing
    • Content extraction
    • Link following
    • Rate limiting
    • User agent customization

✂️ Text Processing

Chunk Splitter (ChunkSplitterNode)

  • Description: Split documents into manageable chunks for processing
  • Strategies:
    • Character-based splitting
    • Token-based splitting
    • Recursive splitting
    • Semantic splitting
  • Configuration:
    • Chunk size
    • Chunk overlap
    • Separators
    • Keep metadata

String Input (StringInputNode)

  • Description: Manual text input for workflows
  • Features:
    • Multi-line text support
    • Template variables
    • Dynamic input injection

🔗 Vector Stores

Vector Store Orchestrator (VectorStoreOrchestratorNode)

  • Description: Unified interface for vector database operations
  • Supported Backends:
    • PGVector (PostgreSQL)
    • Chroma
    • FAISS
    • Pinecone
  • Operations:
    • Document ingestion
    • Similarity search
    • Metadata filtering
    • Collection management

🎯 Embeddings

OpenAI Embeddings (OpenAIEmbeddingsNode)

  • Description: Generate vector embeddings using OpenAI's models
  • Supported Models:
    • text-embedding-ada-002
    • text-embedding-3-small
    • text-embedding-3-large
  • Features:
    • Batch processing
    • Dimension configuration
    • Cost optimization

⚙️ Workflow Control

Start Node (StartNode)

  • Description: Entry point for workflow execution
  • Features:
    • Initial input handling
    • Variable initialization
    • State setup

End Node (EndNode)

  • Description: Workflow termination and output formatting
  • Features:
    • Output formatting (JSON, text, structured)
    • Result validation
    • State finalization

🎬 Trigger Nodes

Webhook Trigger (WebhookTriggerNode)

  • Description: HTTP webhook for external workflow triggering
  • Supported Methods: GET, POST, PUT, PATCH, DELETE, HEAD
  • Features:
    • Automatic endpoint generation
    • Bearer token authentication
    • Event type filtering
    • Payload validation
    • CORS support
    • Rate limiting (0-1000 req/min)
    • Real-time event streaming
  • Configuration:
    • Authentication toggle
    • Allowed event types
    • Max payload size (1KB-10MB)
    • Timeout settings
  • Endpoints:
    • /api/v1/webhooks/{webhook_id} - Trigger endpoint
    • /api/v1/webhooks/{webhook_id}/stream - Event stream
    • /api/v1/webhooks/{webhook_id}/stats - Statistics

Timer Start (TimerStartNode)

  • Description: Schedule-based workflow execution
  • Schedule Types:
    • Interval (60s - 24h)
    • Cron expression
    • One-time execution
    • Manual trigger
  • Features:
    • Automatic workflow triggering
    • Timezone support (UTC, EST, PST, etc.)
    • Max execution limits
    • Retry on failure
    • Background execution
  • Configuration:
    • Schedule type
    • Trigger data payload
    • Timeout settings
    • Auto-trigger toggle

💻 Processing Nodes

Code Node (CodeNode)

  • Description: Execute custom Python code within workflows
  • Features:
    • Sandboxed execution
    • Input/output variable mapping
    • Error handling
    • Dependency management

🔄 Working Principles

LangGraph-Based Execution

  1. Workflow Definition: Users create visual workflows using drag-and-drop interface
  2. Graph Compilation: GraphBuilder converts visual workflow into LangGraph StateGraph
  3. State Initialization: FlowState initialized with user inputs and session context
  4. Node Execution: Each node executes sequentially based on graph topology
  5. State Updates: Node outputs update the shared FlowState
  6. Memory Persistence: Conversation history saved to PostgreSQL via BufferMemoryNode
  7. Result Streaming: Real-time output streamed to client via WebSocket

State Management Flow

User Input
    ↓
FlowState Initialization
    ↓
GraphBuilder.compile()
    ↓
StateGraph Creation
    ↓
Node 1 Execution → State Update
    ↓
Node 2 Execution → State Update
    ↓
...
    ↓
Node N Execution → State Update
    ↓
Final State → End Node
    ↓
Result Output

Memory Architecture

  • Session-Based: Each conversation has unique session ID
  • Persistent Storage: PostgreSQL stores complete history
  • Lazy Loading: Memory loaded on-demand
  • Windowed Access: Configurable window for recent context
  • Cross-Workflow: Memory shared across workflow rebuilds

🎨 Key Features

Visual Workflow Builder

  • Drag-and-drop node interface
  • Real-time validation
  • Connection auto-mapping
  • Visual debugging
  • Workflow templates

Enterprise Security

  • Authentication: JWT-based user authentication
  • Authorization: Role-based access control (RBAC)
  • Encryption: AES-256 encryption for sensitive data
  • API Keys: Secure credential management
  • Multi-tenancy: Organization-level isolation

Real-Time Processing

  • WebSocket Support: Live workflow execution updates
  • Streaming Responses: Real-time LLM output
  • Event Broadcasting: Webhook event streaming
  • Connection Pooling: Efficient resource management

Monitoring & Observability

  • LangSmith Integration: Full tracing support
  • Enhanced Logging: Structured JSON logging
  • Performance Monitoring: Execution time tracking
  • Error Tracking: Comprehensive error handling
  • Analytics: Workflow execution statistics

Scalability

  • Async Processing: Full async/await support
  • Connection Pooling: Database connection management
  • Execution Queue: Concurrent workflow handling
  • Resource Limits: Configurable memory and CPU limits
  • Horizontal Scaling: Stateless API design

🛠️ Technical Stack

Backend

  • Framework: FastAPI 0.104+
  • Language: Python 3.11+
  • AI Framework: LangChain 0.1.0+, LangGraph 0.0.20+
  • Database: PostgreSQL 14+ with PGVector
  • ORM: SQLAlchemy 2.0+
  • Message Queue: Redis (optional)

Frontend

  • Framework: React 18+
  • State Management: Zustand
  • UI Library: Tailwind CSS
  • Workflow Editor: React Flow
  • HTTP Client: Axios

Infrastructure

  • Container: Docker, Docker Compose
  • Web Server: Uvicorn (ASGI)
  • Reverse Proxy: Nginx (optional)
  • Monitoring: LangSmith, Prometheus (optional)

📋 Installation

Prerequisites

  • Python 3.11 or higher
  • PostgreSQL 14+ with PGVector extension
  • Node.js 18+ (for frontend)
  • Docker & Docker Compose (optional)

Quick Start with Docker

# Clone the repository
git clone https://github.com/your-org/KAI-Fusion.git
cd KAI-Fusion

# Copy environment files
cp .env.example .env
cp backend/.env.example backend/.env
cp client/.env.example client/.env

# Configure your environment variables
# Edit .env files with your API keys and database credentials

# Start with Docker Compose
docker-compose up -d

# Access the application
# Backend API: http://localhost:8000
# Frontend: http://localhost:3000
# API Docs: http://localhost:8000/docs

Manual Installation

# Backend setup
cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Database setup
# Create PostgreSQL database and install PGVector extension
psql -U postgres
CREATE DATABASE kaifusion;
\c kaifusion
CREATE EXTENSION vector;

# Run migrations
alembic upgrade head

# Start backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000

# Frontend setup (in new terminal)
cd client
npm install
npm run dev

📚 Getting Started

Create Your First Workflow

  1. Access the Platform: Navigate to http://localhost:3000
  2. Login/Register: Create an account or login
  3. Create Workflow: Click "New Workflow"
  4. Add Nodes:
  5. Connect Nodes: Draw connections between nodes
  6. Configure: Set node parameters
  7. Execute: Click "Run" to test workflow
  8. Deploy: Save and deploy workflow

Example: Simple Chat Workflow

[Start] → [OpenAI LLM] → [End]

Example: RAG (Retrieval Augmented Generation)

[Start] → [Vector Retriever] → [React Agent] → [End]
               ↓                      ↓
         [OpenAI Embeddings]    [OpenAI LLM]
                                     ↓
                              [Conversation Memory]

Example: Web Research Agent

[Timer/Webhook] → [Tavily Search] → [React Agent] → [HTTP Client] → [End]
                                          ↓              ↓
                                    [OpenAI LLM]   [Cohere Reranker]

🔧 Configuration

Environment Variables

Backend Configuration (.env)

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/kaifusion
POSTGRES_PASSWORD=your_secure_password

# Security
SECRET_KEY=your-secret-key-here
ENCRYPTION_KEY=your-encryption-key-here

# AI Providers (Optional - can be set per-workflow)
OPENAI_API_KEY=sk-...
TAVILY_API_KEY=tvly-...
COHERE_API_KEY=...

# LangSmith Tracing (Optional)
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=ls__...
LANGCHAIN_PROJECT=kaifusion

# Application
APP_ENV=development
DEBUG=true
CORS_ORIGINS=http://localhost:3000

Frontend Configuration (client/.env)

REACT_APP_API_URL=http://localhost:8000
REACT_APP_WS_URL=ws://localhost:8000

🔐 API Documentation

REST API

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc
  • OpenAPI JSON: http://localhost:8000/openapi.json

Key Endpoints

Workflows

  • POST /api/v1/workflows - Create workflow
  • GET /api/v1/workflows - List workflows
  • GET /api/v1/workflows/{id} - Get workflow
  • PUT /api/v1/workflows/{id} - Update workflow
  • DELETE /api/v1/workflows/{id} - Delete workflow
  • POST /api/v1/workflows/execute - Execute workflow

Nodes

  • GET /api/v1/nodes - List available nodes
  • GET /api/v1/nodes/{type} - Get node metadata

Credentials

  • POST /api/v1/credentials - Create credential
  • GET /api/v1/credentials - List credentials
  • PUT /api/v1/credentials/{id} - Update credential
  • DELETE /api/v1/credentials/{id} - Delete credential

Webhooks

  • POST /api/v1/webhooks/{webhook_id} - Trigger webhook
  • GET /api/v1/webhooks/{webhook_id}/stream - Stream events
  • GET /api/v1/webhooks/{webhook_id}/stats - Get statistics

🐛 Known Issues & Limitations (Alpha Release)

Current Limitations

  1. Node Library: Limited to core nodes (more coming in beta)
  2. UI Polish: Some UI elements need refinement
  3. Documentation: API docs are minimal (expanding in beta)
  4. Testing: Unit test coverage at ~60% (target: 90%)
  5. Performance: Not optimized for large-scale deployments yet

Known Issues

  1. Memory Management: High memory usage with large conversation histories
  2. Error Handling: Some edge cases not handled gracefully
  3. Workflow Export: Export feature is experimental
  4. Mobile Support: Limited mobile responsiveness
  5. Browser Compatibility: Best on Chrome/Firefox (Safari has issues)

🗺️ Roadmap

v0.2 Beta (Q1 2025)

  • Additional LLM providers (Anthropic, Google, Mistral)
  • Advanced vector store nodes (Pinecone, Weaviate)
  • Workflow templates library
  • Enhanced error handling
  • Performance optimizations
  • Comprehensive documentation

v1.0 Stable (Q2 2025)

  • Production-ready stability
  • Multi-language support
  • Advanced workflow analytics
  • Enterprise SSO integration
  • API versioning
  • Mobile app

Future Releases

  • Visual workflow debugger
  • A/B testing framework
  • Cost optimization tools
  • Custom node marketplace
  • Workflow version control
  • Team collaboration features

🤝 Contributing

We welcome contributions from the community! Please see CONTRIBUTING.md for guidelines.

Development Setup

# Fork the repository
git clone https://github.com/your-username/KAI-Fusion.git
cd KAI-Fusion

# Create feature branch
git checkout -b feature/your-feature-name

# Make changes and test
# ...

# Submit pull request

Code of Conduct

Please read our CODE_OF_CONDUCT.md before contributing.


📄 License

This project is open source. See LICENSE for details.


📞 Support


🙏 Acknowledgments

KAI-Fusion is built on the shoulders of giants:

  • LangChain Team - For the incredible LangChain framework
  • LangGraph Team - For the powerful state management system
  • OpenAI - For GPT models and embeddings
  • FastAPI - For the amazing web framework
  • React Flow - For the visual workflow editor
  • PostgreSQL & PGVector - For robust vector storage

📊 Release Statistics

  • Total Nodes: 25+
  • Node Categories: 9
  • Lines of Code: ~50,000+
  • Dependencies: 40+ packages
  • Documentation Pages: 15+
  • Contributors: 5+

🎯 What's Next?

  1. Try it out: Install KAI-Fusion and create your first workflow
  2. Report bugs: Help us improve by reporting issues
  3. Request features: Tell us what you need
  4. Contribute: Join our community of developers
  5. Star the repo: Show your support on GitHub

Thank you for trying KAI-Fusion v0.1 Alpha!

We're excited to have you on this journey as we build the future of AI workflow orchestration. Your feedback and contributions are invaluable in shaping the platform.

Happy building! 🚀


Last Updated: December 26, 2025
Release: v0.1.0-alpha
Build: #1