You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
## [Unreleased]
7
7
8
+
### Changed
9
+
-`pw.xpacks.llm.question_answering.BaseRAGQuestionAnswerer` now supports document reranking. This enables two-stage retrieval where initial vector similarity search is followed by reranking to improve document relevance ordering.
10
+
8
11
### Added
9
12
- JetStream extension is now supported in both NATS read and write connectors.
@@ -450,6 +451,8 @@ class BaseRAGQuestionAnswerer(SummaryQuestionAnswerer):
450
451
Args:
451
452
llm: LLM instance for question answering. See https://pathway.com/developers/api-docs/pathway-xpacks-llm/llms for available models.
452
453
indexer: Indexing object for search & retrieval to be used for context augmentation.
454
+
reranker: Reranker instance to evaluate document relevance. See https://pathway.com/developers/api-docs/pathway-xpacks-llm/rerankers for available models.
455
+
If ``None``, behaves as standard RAG without reranking. Defaults to ``None``.
453
456
default_llm_name: Default LLM model to be used in queries, only used if ``model`` parameter in post request is not specified.
454
457
Omitting or setting this to ``None`` will default to the model name set during LLM's initialization.
455
458
prompt_template: Template for document question answering with short response.
@@ -460,12 +463,14 @@ class BaseRAGQuestionAnswerer(SummaryQuestionAnswerer):
460
463
Defaults to ``SimpleContextProcessor`` that keeps the 'path' metadata and joins the documents with double new lines.
461
464
summarize_template: Template for text summarization. Defaults to ``pathway.xpacks.llm.prompts.prompt_summarize``.
462
465
search_topk: Top k parameter for the retrieval. Adjusts number of chunks in the context.
466
+
rerank_topk: Number of top-scoring documents to retain after reranking, when a reranker is provided.
467
+
If ``None``, defaults to half of ``search_topk``. Defaults to ``None``.
0 commit comments