CSHaitao/LexRAG — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a Python toolkit for testing RAG in legal consultation chats.

I want it to work with a dataset of Chinese legal conversations where each case has several rounds of questions and answers, plus a law library of legal articles. The tool should turn each conversation into searchable questions using different strategies, like only the latest question, the full chat history, or a rewritten standalone question using an LLM.

Then it should retrieve the most relevant laws using either semantic search or keyword search, save the retrieval results, and let me generate legal style answers using the retrieved laws as references. Please include simple example scripts so I can run the whole flow from processing, to retrieval, to answer generation, to evaluation. Make the settings easy to change for different models, API keys, local models, batch sizes, and number of laws to use.

Keep it modular and research friendly, with sample data paths and clear output files. Look up current docs online if you need to.

Want more depth? Deep Reverse