# KiwiQ: Open-Source Multi-Agent Workflow Platform Built on LangGraph and Prefect

> KiwiQ is a self-hosted multi-agent orchestration platform that lets you define complex AI workflows as JSON or Python graph schemas. It was built to power marketing AI agents in production, compiled on LangGraph for execution logic, and coordinated through Prefect for task scheduling. It is now fully open-sourced.

**rcortx/kiwiq** — Production-grade multi-agent orchestration platform - JSON-defined agents, multi-tier memory, and built-in observability. Battle-tested on 200+ enterprise AI agents. Now fully open-sourced (prod at https://kiwiq.ai).

- Repository: https://github.com/rcortx/kiwiq
- Stars: 2,226 · Forks: 240
- Language: Python
- License: Apache-2.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/rcortx-kiwiq

## What KiwiQ Does and How It Was Built

KiwiQ defines AI workflows as directed graphs. Each node in the graph is one of 24+ built-in types: LLM calls, routing decisions, conditional branches, data transformations, web scraping operations, sandboxed code execution, sub-workflow invocations, and more. You write the graph structure as a Python or JSON schema, and KiwiQ compiles it to LangGraph for execution and dispatches it through Prefect as a managed task.

The project was built to run KiwiQ AI's marketing automation product in production. The README states it was battle-tested on 200+ enterprise AI agents in that environment before being open-sourced. The 27 included workflow definitions cover content creation, diagnostic workflows, lead scoring, deep research, and playbook generation, and these are production-derived templates rather than example code.

The multi-provider LLM support covers OpenAI, Anthropic, Google Gemini, Perplexity, Fireworks, and AWS Bedrock. Switching providers is a matter of configuring the appropriate API key in .env and selecting the provider in the workflow node definition.

## System Architecture: Six Required Services

KiwiQ's architecture has six services that must be running for full functionality. The FastAPI application (kiwi_app) handles authentication, billing, workflow API calls, RAG operations, data jobs, and WebSocket connections. RabbitMQ carries async events between the API and workers. Prefect manages workflow scheduling and execution. Redis provides caching and session management. PostgreSQL holds relational state, workflow configurations, and LangGraph checkpoints. MongoDB stores versioned customer data and prompt templates. Weaviate is the vector database used for RAG pipelines.

In the development Docker Compose setup (docker-compose-dev.yml), all seven services run as containers, including a Prefect Server and a separate Prefect Agent container. The production setup (docker-compose.prod.yml) runs with external managed databases for PostgreSQL and MongoDB, Nginx and Certbot for TLS, resource limits on all containers, and JSON-file logging with rotation.

The architecture diagram in the README shows FastAPI at the top, with RabbitMQ, Prefect, and Redis as the three parallel middle layers, and the databases as the persistence tier below. The event-driven design means workflow steps communicate through RabbitMQ rather than blocking API calls.

## Installing and Starting KiwiQ

The prerequisites are Python 3.12, Poetry, Docker, and Docker Compose. Clone and install:

```bash
git clone https://github.com/kiwiq-ai/kiwiq-oss.git
cd kiwiq-oss
poetry install
```

Copy the environment file and fill in required values:

```bash
cp .env.sample .env
```

The required variables include OPENAI_API_KEY (for LLM nodes), PostgreSQL credentials (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB), MongoDB credentials (MONGO_ROOT_USERNAME, MONGO_ROOT_PASSWORD), RabbitMQ credentials, REDIS_PASSWORD, and SECRET_KEY for JWT authentication. The .env.sample file shows the full list. Generate the JWT secret with:

```bash
openssl rand -hex 32
```

Start all services for development:

```bash
docker compose -f docker-compose-dev.yml up --build
```

After startup, the API documentation is at http://localhost:8000/docs, the Prefect dashboard at http://localhost:4201, and RabbitMQ management at http://localhost:15672.

## Workflow Node Types and Human-in-the-Loop

The 24+ node types cover the common operations in AI agent workflows. LLM nodes send prompts to a configured provider and receive completions. Routing nodes direct workflow execution based on output values. Conditional branching nodes create decision trees. Data transform nodes reshape data between workflow steps. Web scraping nodes handle LinkedIn profiles, company pages, and general web crawling. Code execution nodes run user-defined Python in a sandbox (the untrusted_code_runner/ directory in the repository). Sub-workflow nodes invoke another workflow definition as a child.

Human-in-the-Loop (HITL) is a first-class feature. HITL nodes pause a workflow execution and wait for human review, input, or approval. The mechanism uses real-time WebSocket streaming to push the pending approval request to the calling application. This is specifically useful for marketing automation workflows where legal or brand review is required before sending content.

The 27 included workflow definitions are stored in the repository and named in the README. Content creation, deep research, and playbook generation are among those listed. Each is a starting point that can be modified using the JSON schema rather than requiring custom code.

## RAG Pipelines and Multi-Tier Memory

KiwiQ's memory model uses four persistence layers with different properties. PostgreSQL holds relational state, workflow execution checkpoints for LangGraph, and user/billing data. MongoDB stores versioned documents, customer data, and prompt templates with CRUD workflow nodes. Weaviate is the vector database, used for document ingestion, semantic search, and retrieval-augmented generation. Redis caches session data and intermediate workflow results.

RAG pipelines ingest documents into Weaviate, and retrieval nodes can query Weaviate during workflow execution to inject relevant context into LLM prompts. The WEAVIATE_QUERY_DEFAULTS_LIMIT variable in .env.sample controls how many results are returned by default from vector search queries.

Versioned document storage in MongoDB is handled through dedicated CRUD workflow nodes. This is designed for workflows that maintain per-customer state, such as marketing campaign histories or customer interaction logs, that need to survive across multiple workflow runs.

## Limitations and Infrastructure Cost

The infrastructure requirements are the dominant limitation. Running KiwiQ requires seven services (FastAPI app, PostgreSQL, MongoDB, Redis, RabbitMQ, Weaviate, and Prefect) plus a Prefect worker process. The production Docker Compose configuration notes that the platform is tuned for 4x concurrent workflow execution, suggesting that higher concurrency requires additional configuration.

The no-Docker path described in the README shows the complexity of running services directly:

```bash
export PYTHONPATH=$(pwd):$(pwd)/services
poetry run uvicorn kiwi_app.main:app --host 0.0.0.0 --port 8000 --reload
```

You would need to run each of the database services separately.

A lighter alternative for simpler use cases is n8n, which also provides visual workflow automation with AI integrations but does not require Weaviate, Prefect, or a separate RabbitMQ instance. The tradeoff is that n8n does not compile workflows to LangGraph and does not have the same level of RAG pipeline and vector search integration that KiwiQ provides.

## Claude Code Support, License, and Maintenance

The repository ships a CLAUDE.md file at the root that provides Claude Code with full context about the project. The README notes that Claude Code will automatically pick up CLAUDE.md when run from the repo root, and can help with local setup, running tests, modifying services, building workflows, debugging, and navigating the codebase.

KiwiQ is licensed under Apache-2.0, permitting commercial use and modification without requiring source disclosure. The repository has no GitHub releases but the pyproject.toml shows version 0.1.0. The last push was on 2026-04-13.

The .env.sample includes a Stripe integration variable, which corresponds to the billing feature mentioned in the README's feature list. Teams deploying KiwiQ internally who do not need billing can leave Stripe credentials empty; the README does not document whether the billing feature can be fully disabled.

## Conclusion

KiwiQ is a well-specified platform for teams that need a self-hosted, multi-agent orchestration layer with observable execution and human-in-the-loop approval steps. The infrastructure requirements are significant: PostgreSQL, MongoDB, Redis, RabbitMQ, and Weaviate must all be running before any workflow executes. This is not a lightweight tool for prototyping. The last push was on 2026-04-13, which is within six months of today; the project is in active use but not under rapid development. Teams considering adoption should verify whether the 27 included workflow definitions cover their use case before building custom nodes, and should review the .env.sample for the full list of required credentials before committing to the setup.

## FAQ

### What databases does KiwiQ require?

KiwiQ uses four: PostgreSQL for relational state and workflow checkpoints, MongoDB for versioned customer data and prompt templates, Weaviate for vector search and RAG, and Redis for caching. RabbitMQ is also required for the event bus.

### Can KiwiQ workflows pause for human review before proceeding?

Yes. The Human-in-the-Loop feature pauses workflow execution at a designated node and waits for approval via a WebSocket connection. The README lists HITL as a first-class feature used in the original production system.

### Does KiwiQ support AI providers other than OpenAI?

Yes. The README lists OpenAI, Anthropic, Google Gemini, Perplexity, Fireworks, and AWS Bedrock as supported providers. The .env.sample shows the API key variable for each.

## Sources

- [Issues](https://github.com/rcortx/kiwiq/issues)
- [License: Apache-2.0](https://github.com/rcortx/kiwiq/blob/main/LICENSE)
- [rcortx/kiwiq on GitHub](https://github.com/rcortx/kiwiq)
- [README](https://github.com/rcortx/kiwiq/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/rcortx-kiwiq
