
RAGLLMsRAGASPython
Contract Q&A RAG
2025Portfolio project
A portfolio project exploring retrieval and generation for contract questions, with RAGAS used to evaluate the pipeline.
The problem
Answering precise questions about long legal contracts by hand is slow and easy to get wrong.
How it works
- 01, InputContract documents
Long legal contracts to answer questions about.
- 02, Tool or codeRetrieval
Finds the contract passages relevant to the question.
- 03, ModelGrounded generation
An LLM answers using the retrieved context.
- 04, Tool or codeRAGAS evaluation
Measures retrieval and answer quality while iterating.
↺ Tune and re-measure: back to step 02
What I did
- Built a retrieval-augmented pipeline over the contract documents.
- Tuned retrieval and generation for precise, grounded answers.
- Measured quality with RAGAS instead of relying on impressions.
Results
- Produced answers that include supporting contract context.
- Used RAGAS to compare pipeline quality during development.