FastAPI & LangChain RAG Pipeline Optimization
Worldwide
Diagnosed and resolved multiple critical issues in a live production RAG (Retrieval-Augmented Generation) pipeline built on Python and FastAPI. The system was returning irrelevant document chunks due to a misconfigured chunking strategy fixed by tuning chunk size and overlap parameters to match the document structure, which immediately improved retrieval precision. Identified and corrected an embedding pipeline bug where documents were being re-embedded on every query instead of at ingestion time, causing significant latency spikes in production. Refactored the pipeline to embed at upload andstore vectors in the database, reducing average response time by over 60%. Resolved LLM hallucination issues caused by insufficient context being passed in the system prompt — rewrote the prompt template to enforce strict grounding instructions and added a relevance score threshold so the LLM only responds when retrieved chunks exceed a confidence cutoff. Fixed a broken FastAPI endpoint that was silently swallowing retrieval errors and returning empty responses to the frontend — added proper exception handling, structured error responses, and request logging for observability. Stack: Python · FastAPI · LangChain · OpenAI API · Vector DB (ChromaDB /Pinecone) · Prompt Engineering · REST API
- Less than 30 hrs/weekHourly
- < 1 monthDuration
- ExpertExperience Level
$20.00
-
$30.00
Hourly- Remote Job
- One-time projectProject Type
Skills and Expertise
Activity on this job
- Proposals:20 to 50
- Last viewed by client:2 weeks ago
- Hires:1
- Interviewing:0
- Invites sent:0
- Unanswered invites:0
About the client
- United KingdomBelfast12:24 PM
- $8K total spent229 hires, 6 active
- 240 hours
Explore similar jobs on Upwork
How it works
Create your free profileHighlight your skills and experience, show your portfolio, and set your ideal pay rate.
Work the way you wantApply for jobs, create easy-to-by projects, or access exclusive opportunities that come to you.
Get paid securelyFrom contract to payment, we help you work safely and get paid securely.
About Upwork
- 4.9/5(Average rating of clients by professionals)
- G2 2021#1 freelance platform
- 49,000+Signed contract every week
- $2.3BFreelancers earned on Upwork in 2020
Find the best freelance jobs
Growing your career is as easy as creating a free profile and finding work like this that fits your skills.
Trusted by