How to Build a Document Q&A App in Langflow Without Code
Langflow is a visual builder for LLM applications. You drag nodes onto a canvas — a file loader, a text splitter, an embedding model, a vector store, a chat model — and connect them into a working pipeline. The whole thing runs locally with a single Docker command or as a desktop app.
A document Q&A bot is the standard starting project, and it is a good test of the tool. It needs a retrieval step, a generation step, and a mental model of how chunks flow. Under 15 minutes if you know the shape of a RAG pipeline.
What do you need before you start?
Two things: Langflow running, and at least one API key.
Running it:
docker run -p 7860:7860 langflowai/langflow:latest
Then open http://localhost:7860. The desktop installer is simpler if you do not want Docker.
For keys, OpenAI is the path of least resistance. You can also run everything against local models via Ollama, which takes more setup but costs nothing per token.
Which nodes does a document Q&A app need?
Five, connected in a line with one branch.
- File — loads a PDF, TXT, or DOCX.
- Split Text — chunks the document. Default chunk size is 1000 characters with 200 overlap. That default is fine for prose and bad for tables.
- Embeddings — turns chunks into vectors. OpenAI’s text-embedding-3-small costs about $0.02 per million tokens, which for a 50-page PDF is effectively free.
- Chroma — stores the vectors. Defaults to in-memory, which means your data disappears on restart.
- Chat Output plus a Prompt template — takes retrieved chunks and the user question, sends both to the model.
The branch is the retriever: Chroma’s output feeds the Prompt template’s context field.
How do you actually wire it up?
Build left to right, test as you go.
- Drop File, choose your PDF, and hit run on that node alone. You should see extracted text in the output.
- Connect File to Split Text and run. Look at the chunk count. A 60-page document usually lands between 150 and 400 chunks.
- Connect Split Text to Embeddings and Chroma. Add your OpenAI key in the Embeddings node’s settings.
- Run Chroma. If you see documents stored, the ingestion half is done.
- Connect Chroma to a Prompt template as the context variable, add a Chat Model node, and wire Chat Output.
Every node can be run individually. Do that instead of hitting the global play button, because a failure in node four hides what node one returned.
What breaks first?
Chunking tables. A pricing table split at 1000 characters becomes fragments with no headers. For structured documents, raise chunk size to 2000 and enable the markdown-aware splitter if the file preserves structure.
Forgetting to persist. Chroma in memory means reindexing every restart. Switch to persistent mode or connect a hosted vector database before you show the app to anyone.
Top-k too high. The retriever returns four chunks by default. Pushing it to 20 gives the model more context and worse answers, because irrelevant chunks dilute the relevant one.
No system prompt. Without one, the model answers from general knowledge when retrieval fails. Add a line telling it to say it does not know.
How do you share the app?
Langflow exposes each flow as an API endpoint, and there is a built-in playground tab with a shareable URL. For production, export the flow as JSON or deploy the flow through Langflow’s API, then call it from your own front end.
The API route gives you a POST /api/v1/run/{flow_id} endpoint with the input text as a parameter. That is enough for an internal tool.
Where does Langflow stop being enough?
Complex branching logic. If your app needs conditional routing, retries, and multi-agent coordination, the canvas becomes spaghetti past about 20 nodes. LangGraph handles that better.
High-traffic production. Langflow is a builder and a runtime, but it is not a hardened multi-tenant service. Most teams export the flow and reimplement it in code once it works.
Quick Summary
- Langflow is a drag-and-drop builder for LLM pipelines; run it with
docker run -p 7860:7860 langflowai/langflow:latest. - A document Q&A app needs five nodes: File, Split Text, Embeddings, Chroma, Chat Output.
- Default chunking is 1000 characters with 200 overlap; tables need 2000 and a markdown-aware splitter.
- In-memory Chroma loses data on restart — switch to persistent storage before sharing.
- The canvas gets unmanageable past roughly 20 nodes; export to code for production.
