FeatureFuel
4

[Feature Request] Configurable query/document instructions for embedding models

Source: paperless-ngx/paperless-ngx#14724 · opened by @moedesux
Description Please add optional instruction/prefix settings for the embedding model, applied to query embeddings (and optionally document embeddings), for example: • PAPERLESS_AI_LLM_EMBEDDING_QUERY_INSTRUCTION: text prepended to every query before it is embedded • PAPERLESS_AI_LLM_EMBEDDING_DOCUMENT_INSTRUCTION: text prepended to every chunk before it is embedded (optional; empty by default) Both would default to empty, so current behaviour stays the same. Many current embedding models are trained with asymmetric prompts and lose a lot of retrieval quality when queries are embedded as raw text: • Qwen3-Embedding: Instruct: <task>\nQuery: <query> on the query side only • multilingual-e5 / e5: query: and passage: • nomic-embed-text: search_query: and search_document: • EmbeddingGemma: task prompts such as task: search result | query: Right now there is no way to set these. The openai-like and ollama backends send the raw text, …

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests