> For the complete documentation index, see [llms.txt](https://nomadamas.gitbook.io/ragchain-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nomadamas.gitbook.io/ragchain-docs/pipeline.md).

# Pipeline

## Overview

The RAGchain framework pipeline is a pre-constructed workflow in the RAGchain framework, designed to simplify and streamline the process of setting up and running a RAG system.

In other words, think of it as a cookbook: it provides you with recipes for different workflows that you can choose from. Instead of having to gather all your ingredients (components) and figure out how they work together on your own, you simply select an option from this 'cookbook', which already has all these details sorted out for you.

### Why Use Pipelines?

Building an entire workflow from scratch can be complex and time-consuming. The pipeline approach offers several advantages:

1. **Simplicity**: Pipelines abstract away many underlying complexities involved in setting up a workflow. Just call pipeline, and use it.
2. **Efficiency**: Using pipelines allows developers to leverage pre-built workflows, saving time and effort.

### Using Pipelines

To use a pipeline within the RAGchain framework:

1. Choose an appropriate pipeline based on your specific requirements.
2. Configure options as per your need.
3. Run the chosen pipeline.

Here's an example using [`BasicRunPipeline`](/ragchain-docs/pipeline/basicrunpipeline.md):

```python
pipeline = BasicRunPipeline(BM25Retrieval(save_path="your-bm25.pkl"), OpenAI())
question = "What is the purpose of RAGchain project?"
answer = pipeline.run.invoke({"question": question})
```

### Building Your Own Pipeline

While we provide various pipelines for convenience, we also understand that developers may want more control over their workflows or require something unique that isn't covered by our existing pipelines.

You're free to build your own custom pipelines using individual components provided by our framework if none of our pre-built pipelines meet your specific needs.

Plus, you can use your workflow without using pipeline. You can use LCEL's runnable directly. Please check out [LCEL documentation](/ragchain-docs/ragchain-structure/llm.md) for more information.

But, you have to make `Pipeline` class for evaluating your pipeline using our [`Evaluator`](/ragchain-docs/ragchain-structure/benchmark.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nomadamas.gitbook.io/ragchain-docs/pipeline.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
