← Back to work
Contract Q&A RAG
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

  1. 01, Input
    Contract documents

    Long legal contracts to answer questions about.

  2. 02, Tool or code
    Retrieval

    Finds the contract passages relevant to the question.

  3. 03, Model
    Grounded generation

    An LLM answers using the retrieved context.

  4. 04, Tool or code
    RAGAS evaluation

    Measures retrieval and answer quality while iterating.

↺ Tune and re-measure: back to step 02
InputTool or codeModel

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.