fakruddinbabadudekula/layered-rag-backend ? reverse-engineered prompt

Reverse engineered prompt

Build me a Python backend for a simple RAG app where people can sign up, log in, and then upload PDF files to chat with them later.

I want JWT auth with access and refresh tokens, and the refresh token should be kept in an HttpOnly cookie. After a user uploads a PDF, the app should validate it, split it into chunks, create embeddings, and store the vectors in a way that keeps each chat session isolated so documents from one session never show up in another. Then the user should be able to ask questions and get answers with citations back to the source chunks used.

Please also save conversation history, uploaded file info, and assistant replies in a database, and make the API return consistent error messages when something goes wrong. Add structured request logging with a request id, async handling throughout, and make it easy to run with Docker. If you need to check any current library docs while building it, go ahead and look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab