Blog · 2026-11-24
RAG Inside a Low-Code Platform: Knowledge Base, Vector DB, and Document Ingestion
The full retrieval-augmented pipeline — real PDF/DOCX extraction, four embedding providers, five vector stores, and a RAG node that inherits its store from the flow — as composable flow nodes.
Ask a generated Workcraft app a question and most of the time the answer comes from an AI node with a prompt. Ask it a question about your documents — the employee handbook, the spec PDF, the ops runbook — and you're in retrieval-augmented generation territory: find the passages that matter, then let the model answer against them. Workcraft ships the whole RAG pipeline as flow nodes, which means a question-answering automation is something you draw, not something you code. This post takes the pipeline apart: what each node does, what runs underneath it, and where the rough edges are.

Two things called "knowledge base"
First, a disambiguation worth making up front. There are two related-but-separate surfaces:
- The Knowledge Base collection — a lightweight document store: title, content, file attachments, cached reads. Useful as a content repository; it does not vectorize what you put in it.
- The RAG pipeline — the subject of this post: document ingestion → text extraction → chunking → embeddings → a real vector database → similarity retrieval → an LLM answering with citations. This lives in the flow designer as four composable nodes.
The RAG pipeline is where the interesting engineering is, so that's what follows.
The four-node chain
A knowledge-backed flow in Workcraft looks like this on the canvas:
Document Upload ──► Embedding ──► Vector DB ──► (later, per question) RAG
ingest vectorize store retrieve + answer
The first three nodes build the index; the RAG node consumes it at query time. Documents can also be fed to the store outside the canvas through the platform's document-upload path — same extraction underneath.
Document Upload — extraction that actually works
The Document Upload node delegates to the platform's document processor, and this is the pleasant surprise: the extraction is real. PDFs go through Apache PDFBox, DOCX through Apache POI, and plain text/Markdown read directly. Uploaded files persist on disk with a saved index, so restarts don't orphan them — and the same extractor serves every ingestion path, so there's no "the UI path works but the other one silently doesn't" split.
Chunking is a sliding window — default 1,000 characters with 200 overlap — but it breaks at the last word boundary before the limit rather than mid-token, and each chunk carries its index plus start/end positions. PDFs also yield document metadata (title, author, page count) when metadata preservation is on. Chunking is opt-in per node, which is a sensible default: pass whole documents through when your downstream consumer doesn't need pieces.
Embedding — four providers, one normalization pass
The Embedding node dispatches on provider:
- OpenAI —
text-embedding-ada-002by default, optional dimensions parameter - Azure OpenAI — same request shape against your deployment endpoint
- Cohere — the hosted embed API
- HuggingFace — the hosted inference API
A local sentence-transformers option appears in the list but politely declines — a local embedding service is a documented future step, not a shipped one. Batch mode splits a textarea on newlines and embeds each line, and an optional L2/unit normalization pass runs on the result — handy when your vector store is configured for cosine distance and you want clean score thresholds.
Vector DB — five backends, five operations
The Vector DB node is a thin, honest adapter. Five providers are implemented end-to-end — Qdrant, Pinecone, Weaviate, Chroma, and Milvus — each with the same five operations: search, upsert, delete, create-collection, list-collections. Sensible defaults ship in the designer: Qdrant on localhost, a shared default collection, 1,536 dimensions, cosine distance.
The adapter work is where providers differ — different auth headers, different search bodies, different schema styles. The node hides all of it behind the same config panel. There's even a small scar that teaches: one provider's API rejects a distance metric spelled in all-caps in favor of title-case — the kind of bug you only find by running it once.
RAG — where retrieval meets the model
The RAG node is the payoff, and its wiring is the cleverest detail: it discovers its vector store config from the flow itself. The flow engine scans the current flow's nodes, finds the Vector DB node, and hands its connection details to the retriever. One place to configure the store; the RAG node inherits it. Query text supports {{input}} templating, resolved from upstream node outputs — so a Chat Input node's message can become the semantic-search query directly.

Five steps run in order at query time:
- Embed the query — same embedding config as ingestion, with the API key resolving from the node, then the tenant's AI settings.
- Vector search — top-K similarity search with a score threshold and optional metadata filters, scoped to the executing tenant (more on that below). Results are deduplicated by file and chunk index, keeping the higher-scored duplicate.
- Context assembly — retrieved chunks become a numbered source list the model can quote.
- LLM generation — the assembled prompt goes through the platform's existing AI-node providers (OpenAI, Ollama, Gemini, HuggingFace, Perplexity) rather than reimplementing five clients.
- Citations — with citations on, a Sources footer lists each contributing file, chunk number, and relevance score — appended to the model's answer, not woven into its prose.
The second consumer: agents, not just flows
The retrieval half is also wired into the AI-agent engine. When an agent step declares a knowledge query, a retriever embeds it, searches, and returns context text. Two details matter:
- App-scoped search. App-structure chunks are indexed with an app identifier, and agent retrieval filters on it — an assistant answers from that app's structure, not the whole store. The AI app generator uses the same mechanism with component filters to pull only the relevant knowledge-base section into a prompt.
- Fail-soft by contract. The retriever's documented spec: empty or failed retrieval returns empty and never throws — a down vector DB degrades the answer instead of killing the agent turn. Per-tenant settings govern whose key pays for embeddings and how many chunks come back.
Isolation on a shared index
All tenants share the default collection — so the retrieval path enforces isolation in the query itself. Every indexed chunk is stamped with the tenant that ingested it (platform-seeded knowledge carries a shared tag), and search is fail-closed: a query can only return chunks belonging to the executing tenant or tagged as shared platform knowledge. Chunks with no tenant stamp — say, written before stamping existed — are excluded rather than leaked.
Configuration surface
Everything above is overridable without code: the vector-store connection, embedding provider and model, and document storage path are deployment settings; per-tenant AI keys and retrieval depth live in Settings → Tenant Settings; and each node exposes its own provider, model, top-K, similarity threshold, temperature, max tokens, chunk size/overlap, and citations toggle. The RAG nodes themselves are gated behind the ai.rag feature on Pro plans and above.
What this doesn't cover yet
Honest caveats, verified in source:
- RAG retrieval is Qdrant-only today. Although the Vector DB node stores to five providers, the retrieval path speaks Qdrant's search protocol — point the flow at another provider and the node fails fast with a clear error naming the provider, rather than returning silent empty results. Multi-provider retrieval is the obvious next step.
retrievalStrategyis accepted and ignored. The options listsimilarity/mmr/hybrid, but only similarity search runs — no MMR diversity, no keyword fusion.- The out-of-canvas upload path chunks naively. Documents fed through the designer path get word-boundary chunking; the other upload path cuts at exact character offsets and can split mid-word.
- Five providers, one well-lit path. Non-Qdrant storage adapters are implemented but we traced them code-only; only Qdrant's behavior is corroborated end-to-end by the retrieval path.
Next in the series: migrating off hosted builders — what the same pipeline looks like when you own the deployment.
Deeper reference: flow node reference · automation flows · AI agents & tools. Want to try it? Get a demo workspace or read the docs.
Want to try it? Get a demo workspace or read the docs.