Production-ready RAG pipeline#2
Merged
Merged
Conversation
- remove hackrx-key.pem from filesystem; already in .gitignore - fix CORS: drop allow_credentials=True with wildcard origins (invalid per spec) - fix route ordering bug: API/health routes now registered before SPA catch-all - add real pytest suite (10 tests covering health, upload, query endpoints) - rewrite CI: add lint (ruff/eslint), pytest, jest steps with dep caching - fix docker-compose healthcheck: curl → python stdlib (curl absent in slim image) - convert Dockerfile.backend to multi-stage build - remove minimal_main.py; consolidate on documind_main.py as sole entry point - fix routes.py encapsulation: delete_document delegates to api_service method - delegate file parsing in routes.py to text_extract.process_file_content - add delete_document() method to DocuMindAPIService - add requirements-dev.txt with pytest/ruff/httpx - redesign UploadView and QueryView: Syne + JetBrains Mono, amber accent, corner bracket animations, entry fade-ins, scoped component CSS - update README project structure section Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- add frontend/vercel.json (CRA build config + SPA rewrites) - strip frontend build step from render.yaml (Vercel owns it now) - remove NODE_VERSION and REACT_APP_API_URL from render.yaml env vars
- remove unused imports (os, asyncio, Tuple, json, uuid, etc.) across services/ - fix 4 bare except -> except Exception in text_extract.py - prefix unused local variables with _ in cloud_vector_service.py - add noqa: F401 for conditional imports inside try blocks (pinecone, qdrant)
- Mount services/routes.py router in documind_main.py (was serving stub
endpoints that returned demo responses)
- Switch embeddings from Gemini to OpenAI text-embedding-3-small (1536d)
- Route chat through OpenAI gpt-4o-mini directly, drop broken Gemini path
- Fix PDF extraction: ext passed without dot ("pdf" vs ".pdf") caused
raw binary to be chunked instead of extracted text (176 chunks → 3)
- Add BM25 hybrid search over in-memory chunks so keyword matches like
"Python" are never missed by vector similarity alone
- Run Pinecone upsert and query in thread executor to avoid blocking
the async event loop
- Expand retrieval candidate pool: max(top_k*4, min(chunks, 60))
- Add per-step timing logs to upload pipeline
- Restore pinecone>=3.0.0 to requirements.txt, clean up render.yaml build
- Update embedding dimension from 3072 → 1536 throughout
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
/healthreturns 200🤖 Generated with Claude Code