Skip to content

About

RAG Pipeline Studio — visual builder for production RAG pipelines. FastAPI + uv workspace backend (API/worker), Turborepo React frontend, Kubernetes-ready.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RAG Pipeline Studio

Experiment. Configure. Understand every step.

A visual workbench for building RAG pipelines — drag stages onto a canvas, run them one at a time, and inspect exactly what each stage produced before moving to the next.

Python 3.12+ FastAPI React TypeScript PostgreSQL with pgvector Redis Kubernetes

Why

Most RAG tooling hands you one opaque ingest() call. When retrieval quality is bad, you can't tell which step failed — was the PDF partitioned wrong, did chunking split a table in half, or is the embedding just a poor fit?

RAG Pipeline Studio breaks ingestion into eight explicit stages and makes every one of them individually runnable and inspectable. You see the extracted elements, the chunk boundaries, and the bounding boxes on the source page — before anything is embedded.


The playground

Drag stages from the palette onto the canvas and wire them together. Each node runs independently and reports its own state, so you can re-run a single stage after a config change instead of reprocessing the whole document.

The pipeline canvas: a component palette on the left, and Upload → Partition → Transform → Chunk wired together as nodes, each showing its own run state

Open any completed stage to inspect what it actually produced. The Partition stage shows every extracted element — classified as NarrativeText, Image, Table and so on — overlaid as bounding boxes on the original page, alongside a page/table/image count.

The Partition stage inspector: 9 extracted elements across 3 pages with 4 images, drawn as labelled bounding boxes over the source document


The studio

The playground sits inside a broader app shell. Pipelines are versioned definitions — each one can be forked and deployed independently, with run history, monitoring and data surfaces around it.

The Studio shell: sidebar navigation for Pipelines, Templates, Run History, Monitoring, Traces, Metrics, Alerts, Databases, Vector Stores and Queues, with the pipelines list in the main pane


Pipeline stages

Ingestion is modelled as an ordered graph. upload is fixed; the other seven are configurable nodes.

# Stage What it does Status
0 Upload Upload a document, or import one from a URL ✅ Implemented
1 Partition Turn the raw document into structured elements — headings, paragraphs, tables, images ✅ Implemented
2 Chunk Split partitioned elements into meaningful chunks (Basic, By Title) ✅ Implemented
3 Representation Generate alternative representations per chunk — summary, hypothetical questions, keywords — and choose what gets embedded 🚧 Stub
4 Embedding Convert the selected representation into vectors 🚧 Stub
5 Storage / Schema Define how chunks and embeddings are persisted 🚧 Stub
6 Index Configure the vector index used to search the embedding column 🚧 Stub
7 Retrieval Define how an application queries the processed data 🚧 Stub

On the stubs: stages 3–7 are real nodes that genuinely execute — they queue, run through the Worker, emit events and produce artifacts — but return zeroed domain data until their processing logic lands. The plumbing is finished; the algorithms are next. Stages 1–2 do real work, backed by unstructured, dispatching to the concrete partition_<type> function for each detected file type rather than going through partition.auto.


Architecture

                    ┌──────────────────────────┐
   browser  ───────▶│  builder-studio (React)  │
                    └────────────┬─────────────┘
                                 │  REST + SSE
                    ┌────────────▼─────────────┐
                    │   rag-api (FastAPI)      │   pipelines · versions · executions
                    │                          │   uploads · artifacts · observability
                    └──────┬────────────┬──────┘
                     enqueue│            │persist
                    ┌───────▼──────┐  ┌──▼──────────────────┐
                    │    Redis     │  │  Postgres+pgvector  │
                    └───────┬──────┘  └─────────────────────┘
                            │ consume
                    ┌───────▼──────────────────┐
                    │  rag-worker              │──▶ MinIO / S3  (documents, artifacts)
                    │  stage implementations   │
                    └──────────────────────────┘

Stage progress streams back to the canvas over Server-Sent Events, which is why nodes flip from Ready → Running → Completed live while a run is in flight.

Backend — a uv workspace sharing one virtualenv:

Package Role
packages/core Pipeline schema, stage registry, execution graph, artifacts, events
packages/db SQLModel tables + Alembic migrations (pipelines, pipeline_versions, executions, jobs, artifacts)
services/api FastAPI app — the only thing the frontend talks to
services/worker Queue consumer that runs stages and writes artifacts

Frontend — a pnpm + Turborepo monorepo: apps/builder-studio (the Studio shell plus the playground canvas), with packages/pipeline-schema and packages/ui shared underneath.


Quickstart

Requires Docker, uv and pnpm.

1 — Bring up the backend (Postgres + pgvector, Redis, MinIO, API, Worker):

cd backend/infra
docker compose up --build

2 — Run migrations once Postgres is healthy:

cd backend/packages/db
DATABASE_URL=postgresql+asyncpg://rag:rag@localhost:5432/rag \
  uv run --package rag-db alembic upgrade head

3 — Start the frontend:

cd frontend/apps/builder-studio
pnpm install && pnpm dev

Open the printed URL (Vite starts at :5173 and increments if taken) and head to /pipelines. The API defaults to http://localhost:8000 — override with VITE_API_BASE_URL in apps/builder-studio/.env, and note that Vite does not hot-reload .env, so restart pnpm dev after editing it.

A Kubernetes path (plain kubectl-appliable manifests, no Helm) lives in backend/infra/.


Development

cd backend
uv sync --all-packages          # always --all-packages: one shared venv

Syncing with --package <name> instead thrashes packages in and out of the shared virtualenv and produces ModuleNotFoundErrors that aren't real bugs.

cd frontend/apps/builder-studio
pnpm --filter builder-studio typecheck
pnpm --filter builder-studio lint

DEV_GUIDE.md covers the Kubernetes workflow, port-forwarding, live logs, image-tag bumping and migration authoring in detail.


Status

Phase 1. The execution engine, queue, artifact store, event streaming, pipeline versioning and the full canvas UI are working end to end; partition and chunk do real work. Next up is filling in the remaining stage implementations, then the observability stack (OpenTelemetry, Tempo, Loki, Prometheus, Grafana) — deliberately deferred until there are real stage implementations worth tracing.

Auth, billing and multi-tenancy are out of scope for this phase.

About

RAG Pipeline Studio — visual builder for production RAG pipelines. FastAPI + uv workspace backend (API/worker), Turborepo React frontend, Kubernetes-ready.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages