# `GEPA.Adapters.GenericRAG.Pipeline`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/adapters/generic_rag/pipeline.ex#L1)

A small, adapter-local RAG pipeline used by `GEPA.Adapters.GenericRAG`.

Candidate components are plain text templates. Supported placeholders:
`{query}`, `{documents}`, `{context}`, and `{metadata}`.

# `t`

```elixir
@type t() :: %GEPA.Adapters.GenericRAG.Pipeline{
  config: map(),
  embedder: GEPA.Embeddings.provider() | nil,
  embedding_function: (String.t() -&gt; [number()]) | nil,
  embedding_model: String.t(),
  llm: term(),
  llm_client: term(),
  vector_store: term()
}
```

# `default_embedding_function`

```elixir
@spec default_embedding_function(String.t()) :: [float()]
```

Deterministic fallback embedding function used when no custom embedding function is supplied.

# `execute_rag`

```elixir
@spec execute_rag(t(), String.t(), map(), map()) :: map()
```

Execute a RAG pipeline using explicit query, prompt, and config arguments.

# `format_documents`

```elixir
@spec format_documents([map()]) :: String.t()
```

# `generate_answer`

```elixir
@spec generate_answer(t(), String.t(), String.t(), String.t()) :: String.t()
```

Generate an answer from query, context, and a prompt template.

# `new`

```elixir
@spec new(keyword() | map()) :: t()
```

# `reformulate_query`

```elixir
@spec reformulate_query(t(), String.t(), String.t()) :: String.t()
```

Reformulate a query with a prompt template.

# `render_template`

```elixir
@spec render_template(String.t(), map()) :: String.t()
```

# `retrieve_documents`

```elixir
@spec retrieve_documents(t(), String.t(), map()) :: [map()]
```

Retrieve documents for a query under the provided config.

# `run`

```elixir
@spec run(t(), map(), map()) :: map()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
