# Repository Briefing: rcortx/kiwiq
> Source: https://repoforai.com/repo/rcortx/kiwiq (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/rcortx/kiwiq
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: B (50/100 · Maintenance 6/35 · Adoption 18/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, API
- **Momentum**: 2,138 ★ total (+0 24h / +0 7d) · 239 forks
- **When to Use**: Best for: Python teams building self-hosted content, research, or diagnostics workflows that need versioned documents, human approval, and live run progress behind an API. Skip if: You need a visual builder, an offline model runtime out of the box, or a lightweight library that fits into an existing orchestration stack.

## Overview
```text
### Architecture & Core Mechanics
KiwiQ separates the API from workflow execution. The `kiwi_app` FastAPI service exposes workflow, RAG, data-job, and WebSocket endpoints alongside authentication and billing. The workflow service compiles Python or JSON `GraphSchema` definitions to LangGraph. Prefect orchestrates execution through `services/workflow_service/services/worker.py`, while RabbitMQ carries asynchronous events between services. The reusable node registry in `services/workflow_service/registry/nodes/` is the main point for extending graph behavior.

The storage layers serve distinct purposes: PostgreSQL holds relational state and LangGraph checkpoints, MongoDB stores versioned customer documents and workflow configuration, Weaviate handles vector retrieval, and Redis supports caching and sessions. The Python manifest includes Pydantic for typed models and settings, SQLModel and Alembic for relational persistence and migrations, and `langgraph-checkpoint-postgres` for checkpoint integration.

### Key Capabilities & Differentiators
The SDK offers 24+ reusable node types, from routing, conditional branches, and data transforms to tool execution, nested workflows, and human review. A workflow can pause for input or approval, with run progress streamed over WebSocket. The node set also includes a Python runner with a sandboxing design; assess that isolation before allowing untrusted tenants to submit code.

LLM integrations cover OpenAI, Anthropic, Google Gemini, Perplexity, Fireworks, and AWS Bedrock. RAG combines document ingestion and Weaviate retrieval, while customer-data nodes load, store, and delete MongoDB-backed documents. The 27+ example workflows in `standalone_test_client/` include graph definitions, prompt inputs, and test runners. Content generation, diagnostics, deep research, and lead scoring make them useful starting points for marketing automation, not evidence of equivalent coverage in unrelated domains.

### Trade-offs & Limitations
Compared with using LangGraph directly, KiwiQ bundles an API, workers, storage integrations, progress streaming, and examples that would otherwise need to be assembled around the graph runtime. That is useful if the application needs checkpointed runs, human review, and document retrieval together. For a small workflow or a team with an established API and job stack, direct LangGraph integration avoids operating redundant services. Graphs are defined in code or JSON; the Prefect dashboard is for operations, not visual workflow authoring.

The cost of the integrated stack is coordinating upgrades, backups, and failure handling across several services. Plan recovery around both PostgreSQL checkpoints and the MongoDB documents that workflows reference. External model calls also bring network dependencies, rate limits, and usage charges. Apache-2.0 allows commercial self-hosting, but does not change provider terms or the data-handling obligations of a deployment.

### Hardware & Deployment Guide
For local evaluation, use Python 3.12, Poetry, Docker, and Docker Compose. Populate `.env` from `.env.sample` with service credentials, a JWT secret, and keys for the model providers you intend to use. Run `docker compose -f docker-compose-dev.yml up --build` for the containerized development stack with persistent volumes and live reload. The API exposes interactive docs on port 8000, and the Prefect dashboard is on port 4201.

Production Compose uses Nginx and Certbot for TLS, external PostgreSQL and MongoDB, resource limits, rotating logs, and health checks. Its four-concurrent-workflow setting is a tuning point, not a capacity benchmark. For a non-Docker deployment, run `kiwi_app.main:app` with Uvicorn and start the Prefect worker separately, with backing services provisioned independently. Self-hosting the API and workers does not make provider-backed workflows offline. No release is listed, so there is no tagged release milestone to use as an upgrade baseline.
```

## Key Capabilities
```text
- Graph compilation: `services/workflow_service/graph/` turns Python or JSON schemas into LangGraph workflows for Prefect execution.
- Reusable nodes: 24+ node types cover routing, transforms, model calls, tool execution, human review, and nested workflows.
- State separation: PostgreSQL stores checkpoints, MongoDB versions documents, Weaviate serves vector retrieval, and Redis handles caching and sessions.
- Run visibility: RabbitMQ carries asynchronous events, WebSocket streams progress, and Prefect provides an orchestration dashboard.
- Reference workflows: 27+ definitions include graph schemas, prompts, runner scripts, and human-review test inputs.
- Deployment paths: Development Compose bundles backing services; production Compose uses external PostgreSQL and MongoDB and adds TLS termination.
```

## Quick Start / Clone
```bash
# Development (all services including databases)
docker compose -f docker-compose-dev.yml up --build
```
