Work with pipeline

Use pipeline when you need to orchestrate retrieval, prompt assembly, and llm generation in a single ragpipeline.run() call — returns ragresult with the answer and citationrecord provenance.

Prerequisites

Steps

  1. Understand the class hierarchy. Read the interfaces to see how pipeline is structured before extending or modifying. The key classes are:

    • RagResult in src/attune_rag/pipeline.py — Output of RagPipeline.run.
    • RagPipeline in src/attune_rag/pipeline.py — LLM-agnostic RAG pipeline.
  2. Decide whether to extend or modify. If the class has subclasses, extend with a new one rather than changing the base. If it stands alone, modify directly.

  3. Make your change. Follow existing patterns — naming, error handling, and logging style.

  4. Run the related tests. Target with pytest -k "pipeline".

Key files

Common modifications

Classes you are most likely to extend: