Build a document-grounded RAG support chatbot with LangChain, Qdrant and OpenAI for a 500-PDF client
An AI engineer describes a retrieval-augmented chatbot deployed for one client with over 500 PDFs, with the chunking and retrieval choices, and reports 94% answer accuracy against 61% for plain GPT-4.
Evidence: The author reports this. We have not checked it beyond reading the source.
The business problem
A business with a large body of documents needs a support or knowledge chatbot that answers from its own files rather than making things up.
What was tried
Documents are loaded and split into 1,000-character chunks with 200 overlap, embedded with OpenAI's small embedding model and stored in Qdrant. Each question retrieves the top four chunks by similarity, which are placed in the prompt for the model (gpt-4o-mini in the code). A FastAPI chat endpoint keeps the last five exchanges, and the post suggests metadata filtering and an optional reranker.
What was reported (positive)
The author reports 94% answer accuracy versus 61% for plain GPT-4, hallucinations under 2% versus 28% without retrieval, and responses in under two seconds, and says satisfaction improved without figures.
Limitations
How accuracy and hallucination were measured (dataset, sample, grading) is not stated, and the client, costs and failure cases are not described. The code sample is not production-ready: it uses one global memory object so conversations are not separated per user, allows all origins in CORS and has no authentication or error handling, and some classes it uses are deprecated. The year is not shown.
What you need
Python, FastAPI, LangChain, Qdrant, an OpenAI key and the client's documents. Costs are not stated.
Sources
- DEV Community (Darshit Radadiya) ↗ Firsthand write-up, publication date unknown
Source published: unknown. Last reviewed here: October 11, 2026. Spot a mistake? Tell us.
Tools in this workflow
- OpenAI API: Embeddings and answersTry OpenAI API
- Qdrant: Vector storeTry Qdrant
- LangChain: Retrieval pipelineTry LangChain
Get new workflows like this by email
A short selection of the most useful new workflows, including the ones that did not work. Free, and you can unsubscribe at any time.
Related workflows
Design a support email agent that sends only safe answers, drafts the rest, keeps a human copy of every email, and gets tested with hostile mail before it can send
A solo app founder built a support agent that answers known how-to questions and drafts everything else for him. The rules came first: a fixed escalation list checked outside the model, a copy of every email to him, and a hostile-email test that exposed a false pass.
Replace a support agent's list of 'never' rules with positive rules that name a data source and an exact fallback, then measure on 400 real messages
A solo operator found his support agent refusing simple return questions because of 23 prohibitions in its prompt. He rewrote them as nine rules, each with a data source and a fallback, and cut wrongful refusals from 14.2 to 1.2 percent on a test set.
Run a long-lived SaaS behind the scenes with cheap script checks first, agents second, and findings filed as tasks instead of alerts
The owner of a 16-year-old affiliate site builder describes how small agents now watch servers, triage support and work the bug list: scripts catch problems, agents investigate, findings go on a deduplicated task list, and risky actions are blocked in code.
Catch duplicate customer replies from a self-scheduled AI inbox agent with run counts, claim rows and a heartbeat
A solo operator let his agent write its own cron line for an AI email-reply job. It ran 6,048 times in three weeks and answered 12 emails six times each. He lists the fixes: claim a window first, a unique key, a lock, and alerts on missing runs.